diff options
-rw-r--r-- | Essentials/src/messages.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_cs.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_da.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_de.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_en.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_es.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_fi.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_fr.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_it.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_nl.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_pl.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_pt.properties | 2 | ||||
-rw-r--r-- | Essentials/src/messages_se.properties | 2 | ||||
-rw-r--r-- | EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java | 38 |
14 files changed, 63 insertions, 1 deletions
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index f46a42314..7e3d0ed9d 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 9c05f7aba..5925b136a 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -459,3 +459,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 10794e3ef..72571648e 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 312647887..05e40e602 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index f46a42314..7e3d0ed9d 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index dd0ad7494..8f9b65277 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties index 9ea0819ce..54e506def 100644 --- a/Essentials/src/messages_fi.properties +++ b/Essentials/src/messages_fi.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 3551fad51..c9410573e 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index b4a6a0d95..9ac579319 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index d64fd52f3..b70f49070 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index 5a98a7ee5..3a4d0362b 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index 4d5d59b22..8e7e7df77 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties index 43a181a6c..d65a6a0a2 100644 --- a/Essentials/src/messages_se.properties +++ b/Essentials/src/messages_se.properties @@ -456,3 +456,5 @@ distance=\u00a76Distance: {0} giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76. warpList={0} uptime=\u00a76Uptime:\u00a7c {0} +antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74. +antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74. diff --git a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java index a58ffa04e..1fc57525d 100644 --- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java +++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java @@ -15,7 +15,9 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.*; import org.bukkit.event.inventory.CraftItemEvent; import org.bukkit.event.painting.PaintingBreakByEntityEvent; +import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.inventory.ItemStack; @@ -248,9 +250,43 @@ public class EssentialsAntiBuildListener implements Listener event.setCancelled(true); if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildUse", item.getType().toString())); + user.sendMessage(_("antiBuildCraft", item.getType().toString())); } } } } + + @EventHandler(priority = EventPriority.LOW) + public void onPlayerPickupItem(PlayerPickupItemEvent event) + { + + final User user = ess.getUser(event.getPlayer()); + final ItemStack item = event.getItem().getItemStack(); + + if (!metaPermCheck(user, "craft", item.getTypeId(), item.getData().getData())) + { + event.setCancelled(true); + event.getItem().setPickupDelay(50); + } + + } + + @EventHandler(priority = EventPriority.LOW) + public void onPlayerDropItem(PlayerDropItemEvent event) + { + + final User user = ess.getUser(event.getPlayer()); + final ItemStack item = event.getItemDrop().getItemStack(); + + if (!metaPermCheck(user, "drop", item.getTypeId(), item.getData().getData())) + { + event.setCancelled(true); + user.updateInventory(); + if (ess.getSettings().warnOnBuildDisallow()) + { + user.sendMessage(_("antiBuildDrop", item.getType().toString())); + } + } + + } } |