3
0
Mirror von https://github.com/St3venAU/ArmorStandTools.git synchronisiert 2024-12-29 13:00:07 +01:00
Dieser Commit ist enthalten in:
Steven 2016-11-24 22:28:41 +08:00
Ursprung 37c06ec14c
Commit a89887bcf6
4 geänderte Dateien mit 20 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -19,6 +19,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.SignChangeEvent; import org.bukkit.event.block.SignChangeEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent; 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.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.inventory.CraftingInventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.metadata.FixedMetadataValue; 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") @SuppressWarnings("deprecation")
@EventHandler @EventHandler
public void onInventoryClick(InventoryClickEvent event) { public void onInventoryClick(InventoryClickEvent event) {

Datei anzeigen

@ -4,7 +4,7 @@
# #
# Main Config # 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 # (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) # config to allow it to be re-created. There may be new config options)
# #

Datei anzeigen

@ -4,7 +4,7 @@
# #
# Language Config # 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 # (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) # config to allow it to be re-created. There may be new config options)
# #

Datei anzeigen

@ -1,6 +1,6 @@
main: com.gmail.St3venAU.plugins.ArmorStandTools.Main main: com.gmail.St3venAU.plugins.ArmorStandTools.Main
name: ArmorStandTools name: ArmorStandTools
version: 2.2.0 version: 2.2.1
author: St3venAU author: St3venAU
description: Armor stand manipulation tools description: Armor stand manipulation tools
softdepend: [WorldGuard, PlotSquared] softdepend: [WorldGuard, PlotSquared]