diff --git a/src/com/gmail/St3venAU/plugins/ArmorStandTools/MainListener.java b/src/com/gmail/St3venAU/plugins/ArmorStandTools/MainListener.java index 269d6a8..0b69929 100644 --- a/src/com/gmail/St3venAU/plugins/ArmorStandTools/MainListener.java +++ b/src/com/gmail/St3venAU/plugins/ArmorStandTools/MainListener.java @@ -19,6 +19,7 @@ import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.SignChangeEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.inventory.CraftItemEvent; import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryDragEvent; @@ -29,6 +30,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.inventory.CraftingInventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.metadata.FixedMetadataValue; @@ -240,6 +242,21 @@ public class MainListener implements Listener { } } + @SuppressWarnings("deprecation") + @EventHandler + public void onCraftItem(CraftItemEvent event) { + if (event.isCancelled()) return; + final Player p = (Player) event.getWhoClicked(); + CraftingInventory inventory = event.getInventory(); + for(ItemStack is : inventory.getContents()) { + if(ArmorStandTool.isTool(is)) { + event.setCancelled(true); + p.updateInventory(); + return; + } + } + } + @SuppressWarnings("deprecation") @EventHandler public void onInventoryClick(InventoryClickEvent event) { diff --git a/src/config.yml b/src/config.yml index 2378103..f809a1b 100644 --- a/src/config.yml +++ b/src/config.yml @@ -4,7 +4,7 @@ # # Main Config # -# File generated by: v2.2.0 +# File generated by: v2.2.1 # (If this is not the version you are running, consider deleting this # config to allow it to be re-created. There may be new config options) # diff --git a/src/language.yml b/src/language.yml index 3601b32..f9828a5 100644 --- a/src/language.yml +++ b/src/language.yml @@ -4,7 +4,7 @@ # # Language Config # -# File generated by: v2.2.0 +# File generated by: v2.2.1 # (If this is not the version you are running, consider deleting this # config to allow it to be re-created. There may be new config options) # diff --git a/src/plugin.yml b/src/plugin.yml index 68d03c6..d8163bb 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ main: com.gmail.St3venAU.plugins.ArmorStandTools.Main name: ArmorStandTools -version: 2.2.0 +version: 2.2.1 author: St3venAU description: Armor stand manipulation tools softdepend: [WorldGuard, PlotSquared]