diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-11-04 18:02:36 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-11-04 18:02:36 +0000 |
commit | 587f5329915328a023e46e880f573a009e72d8a2 (patch) | |
tree | aa1000b9ab317daecab02dde06de551234cfd340 /EssentialsAntiBuild/src | |
parent | 10244d5f90a5fdc8f90327c40ff37b0803677372 (diff) | |
download | Essentials-587f5329915328a023e46e880f573a009e72d8a2.tar Essentials-587f5329915328a023e46e880f573a009e72d8a2.tar.gz Essentials-587f5329915328a023e46e880f573a009e72d8a2.tar.lz Essentials-587f5329915328a023e46e880f573a009e72d8a2.tar.xz Essentials-587f5329915328a023e46e880f573a009e72d8a2.zip |
Use durability instead of itemdata for antibuild checks.
Fixes potion blocking using antibuild.
Diffstat (limited to 'EssentialsAntiBuild/src')
-rw-r--r-- | EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java index a14036c2e..7e5c60476 100644 --- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java +++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java @@ -51,7 +51,7 @@ public class EssentialsAntiBuildListener implements Listener return user.isAuthorized(blockPerm); } - private boolean metaPermCheck(final User user, final String action, final int blockId, final byte data) + private boolean metaPermCheck(final User user, final String action, final int blockId, final short data) { final String blockPerm = "essentials.build." + action + "." + blockId; final String dataPerm = blockPerm + ":" + data; @@ -219,7 +219,7 @@ public class EssentialsAntiBuildListener implements Listener if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) { - if (event.hasItem() && !metaPermCheck(user, "interact", item.getTypeId(), item.getData().getData())) + if (event.hasItem() && !metaPermCheck(user, "interact", item.getTypeId(), item.getDurability())) { event.setCancelled(true); if (ess.getSettings().warnOnBuildDisallow()) @@ -251,7 +251,7 @@ public class EssentialsAntiBuildListener implements Listener if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) { - if (!metaPermCheck(user, "craft", item.getTypeId(), item.getData().getData())) + if (!metaPermCheck(user, "craft", item.getTypeId(), item.getDurability())) { event.setCancelled(true); if (ess.getSettings().warnOnBuildDisallow()) @@ -272,7 +272,7 @@ public class EssentialsAntiBuildListener implements Listener if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) { - if (!metaPermCheck(user, "pickup", item.getTypeId(), item.getData().getData())) + if (!metaPermCheck(user, "pickup", item.getTypeId(), item.getDurability())) { event.setCancelled(true); event.getItem().setPickupDelay(50); @@ -289,7 +289,7 @@ public class EssentialsAntiBuildListener implements Listener if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) { - if (!metaPermCheck(user, "drop", item.getTypeId(), item.getData().getData())) + if (!metaPermCheck(user, "drop", item.getTypeId(), item.getDurability())) { event.setCancelled(true); user.updateInventory(); |