Check mining rank before processing double drops

This commit is contained in:
nossr50
2019-06-24 23:25:15 -07:00
parent 421d6cff3b
commit d9b84b0ab3
10 changed files with 25 additions and 31 deletions

View File

@ -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);

View File

@ -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;
}
/**