Search in sources :

Example 56 with ArmorStand

use of com.loohp.interactionvisualizer.entityholders.ArmorStand in project InteractionVisualizer by LOOHP.

the class BrewingStandDisplay method onBreakBrewingStand.

@EventHandler(priority = EventPriority.MONITOR)
public void onBreakBrewingStand(TileEntityRemovedEvent event) {
    Block block = event.getBlock();
    if (!brewstand.containsKey(block)) {
        return;
    }
    Map<String, Object> map = brewstand.get(block);
    if (map.get("Item") instanceof Item) {
        Item item = (Item) map.get("Item");
        PacketManager.removeItem(InteractionVisualizerAPI.getPlayers(), item);
    }
    if (map.get("Stand") instanceof ArmorStand) {
        ArmorStand stand = (ArmorStand) map.get("Stand");
        PacketManager.removeArmorStand(InteractionVisualizerAPI.getPlayers(), stand);
    }
    brewstand.remove(block);
}
Also used : Item(com.loohp.interactionvisualizer.entityholders.Item) ArmorStand(com.loohp.interactionvisualizer.entityholders.ArmorStand) Block(org.bukkit.block.Block) EventHandler(org.bukkit.event.EventHandler)

Aggregations

ArmorStand (com.loohp.interactionvisualizer.entityholders.ArmorStand)56 Location (org.bukkit.Location)30 Block (org.bukkit.block.Block)30 HashMap (java.util.HashMap)25 Vector (org.bukkit.util.Vector)24 Item (com.loohp.interactionvisualizer.entityholders.Item)23 EventHandler (org.bukkit.event.EventHandler)23 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)16 Player (org.bukkit.entity.Player)14 BlockFace (org.bukkit.block.BlockFace)9 ItemStack (org.bukkit.inventory.ItemStack)9 BlockData (org.bukkit.block.data.BlockData)8 Directional (org.bukkit.block.data.Directional)7 SurroundingPlaneArmorStand (com.loohp.interactionvisualizer.entityholders.SurroundingPlaneArmorStand)6 InventoryView (org.bukkit.inventory.InventoryView)5 DynamicVisualizerEntity (com.loohp.interactionvisualizer.entityholders.DynamicVisualizerEntity)4 ItemFrame (com.loohp.interactionvisualizer.entityholders.ItemFrame)4 VisualizerEntity (com.loohp.interactionvisualizer.entityholders.VisualizerEntity)4 Collection (java.util.Collection)4 Inventory (org.bukkit.inventory.Inventory)4