mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
Check mining rank before processing double drops
This commit is contained in:
@ -6,7 +6,6 @@ import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagConflictException;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
|
||||
import com.sk89q.worldguard.protection.regions.RegionContainer;
|
||||
import com.sk89q.worldguard.protection.regions.RegionQuery;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
@ -16,13 +15,6 @@ import static org.bukkit.Bukkit.getServer;
|
||||
public class WorldGuardManager {
|
||||
private static WorldGuardManager instance;
|
||||
private WorldGuardPlugin worldGuardPluginRef;
|
||||
private RegionContainer container;
|
||||
|
||||
public WorldGuardManager() {
|
||||
if(WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
container = WorldGuard.getInstance().getPlatform().getRegionContainer();
|
||||
}
|
||||
}
|
||||
|
||||
public static WorldGuardManager getInstance() {
|
||||
if(instance == null)
|
||||
@ -40,7 +32,7 @@ public class WorldGuardManager {
|
||||
com.sk89q.worldedit.util.Location loc = localPlayer.getLocation();
|
||||
|
||||
//WorldGuardPlugin worldGuard = getWorldGuard();
|
||||
RegionQuery query = container.createQuery();
|
||||
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
|
||||
|
||||
//ApplicableRegionSet set = query.getApplicableRegions(loc);
|
||||
|
||||
@ -56,7 +48,7 @@ public class WorldGuardManager {
|
||||
com.sk89q.worldedit.util.Location loc = localPlayer.getLocation();
|
||||
|
||||
//WorldGuardPlugin worldGuard = getWorldGuard();
|
||||
RegionQuery query = container.createQuery();
|
||||
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
|
||||
|
||||
//ApplicableRegionSet set = query.getApplicableRegions(loc);
|
||||
|
||||
@ -72,7 +64,7 @@ public class WorldGuardManager {
|
||||
com.sk89q.worldedit.util.Location loc = localPlayer.getLocation();
|
||||
|
||||
//WorldGuardPlugin worldGuard = getWorldGuard();
|
||||
RegionQuery query = container.createQuery();
|
||||
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
|
||||
|
||||
//ApplicableRegionSet set = query.getApplicableRegions(loc);
|
||||
|
||||
@ -93,10 +85,8 @@ public class WorldGuardManager {
|
||||
|
||||
public void registerFlags()
|
||||
{
|
||||
if(getWorldGuard() == null)
|
||||
return;
|
||||
|
||||
FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();
|
||||
|
||||
try {
|
||||
// register our flag with the registry
|
||||
registry.register(WorldGuardFlags.MCMMO_ENABLE_WG_FLAG);
|
||||
|
@ -43,7 +43,7 @@ public class WorldGuardUtils {
|
||||
if(detectedIncompatibleWG)
|
||||
return false;
|
||||
|
||||
WorldGuardPlugin worldGuardPlugin = getWorldGuard();
|
||||
worldGuardPluginRef = getWorldGuard();
|
||||
|
||||
return isLoaded;
|
||||
}
|
||||
@ -104,12 +104,12 @@ public class WorldGuardUtils {
|
||||
} catch (ClassNotFoundException e) {
|
||||
mcMMO.p.getLogger().severe("Missing WorldGuard class - "+classString);
|
||||
markWGIncompatible();
|
||||
break; //Break out of the loop
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return detectedIncompatibleWG;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user