mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 22:24:43 +02:00
Guice progress
This commit is contained in:
@ -25,9 +25,10 @@
|
||||
*/
|
||||
package com.plotsquared.bukkit.util;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
import com.plotsquared.bukkit.player.BukkitOfflinePlayer;
|
||||
import com.plotsquared.bukkit.player.BukkitPlayer;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.player.OfflinePlotPlayer;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.util.EconHandler;
|
||||
@ -35,11 +36,18 @@ import com.plotsquared.core.util.PermHandler;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BukkitEconHandler extends EconHandler {
|
||||
@Singleton public class BukkitEconHandler extends EconHandler {
|
||||
|
||||
private Economy econ;
|
||||
|
||||
private final PermHandler permHandler;
|
||||
|
||||
@Inject public BukkitEconHandler(@Nullable final PermHandler permHandler) {
|
||||
this.permHandler = permHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean init() {
|
||||
if (this.econ == null) {
|
||||
@ -83,8 +91,8 @@ public class BukkitEconHandler extends EconHandler {
|
||||
* @deprecated Use {@link PermHandler#hasPermission(String, String, String)} instead
|
||||
*/
|
||||
@Deprecated @Override public boolean hasPermission(String world, String player, String perm) {
|
||||
if (PlotSquared.platform().getPermissionHandler() != null) {
|
||||
return PlotSquared.platform().getPermissionHandler().hasPermission(world, player, perm);
|
||||
if (this.permHandler != null) {
|
||||
return this.permHandler.hasPermission(world, player, perm);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user