Blocking Anvil if its a Iron Block and if its located in a ModArena Region.

This commit is contained in:
Cybermaxke 2012-06-27 20:35:21 +03:00
parent 71b20bdeaa
commit d863b8e510

View File

@ -43,6 +43,9 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Skills; import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
import com.garbagemule.MobArena.MobArena;
import com.garbagemule.MobArena.MobArenaHandler;
public class PlayerListener implements Listener { public class PlayerListener implements Listener {
private final mcMMO plugin; private final mcMMO plugin;
@ -225,7 +228,15 @@ public class PlayerListener implements Listener {
/* REPAIR CHECKS */ /* REPAIR CHECKS */
if (Permissions.getInstance().repair(player) && block.getTypeId() == Config.getInstance().getRepairAnvilId()) { if (Permissions.getInstance().repair(player) && block.getTypeId() == Config.getInstance().getRepairAnvilId()) {
if (mcMMO.repairManager.isRepairable(inHand)) { Plugin maPlugin = (MobArena) Bukkit.getServer().getPluginManager().getPlugin("MobArena");
boolean inArena = false;
if (maPlugin != null) {
MobArenaHandler maHandler = new MobArenaHandler();
if (maHandler.inRegion(block.getLocation()) && block.getTypeId() == 42) {
inArena = true;
}
}
if (mcMMO.repairManager.isRepairable(inHand) && !inArena) {
mcMMO.repairManager.handleRepair(player, inHand); mcMMO.repairManager.handleRepair(player, inHand);
event.setCancelled(true); event.setCancelled(true);
player.updateInventory(); player.updateInventory();