use of com.loohp.interactionvisualizer.entityholders.ArmorStand in project InteractionVisualizer by LOOHP.
the class BeaconDisplay method spawnArmorStands.
public Map<String, ArmorStand> spawnArmorStands(Block block) {
Map<String, ArmorStand> map = new HashMap<>();
Location origin = block.getLocation().add(0.5, 0.25, 0.5);
SurroundingPlaneArmorStand line1 = new SurroundingPlaneArmorStand(origin.clone().add(0.0, 0.25, 0.0), 0.7, pathType);
setStand(line1);
SurroundingPlaneArmorStand line2 = new SurroundingPlaneArmorStand(origin.clone(), 0.7, pathType);
setStand(line2);
SurroundingPlaneArmorStand line3 = new SurroundingPlaneArmorStand(origin.clone().add(0.0, -0.25, 0.0), 0.7, pathType);
setStand(line3);
map.put("1", line1);
map.put("2", line2);
map.put("3", line3);
PacketManager.sendArmorStandSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.HOLOGRAM, KEY), line1);
PacketManager.sendArmorStandSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.HOLOGRAM, KEY), line2);
PacketManager.sendArmorStandSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.HOLOGRAM, KEY), line3);
return map;
}
use of com.loohp.interactionvisualizer.entityholders.ArmorStand in project InteractionVisualizer by LOOHP.
the class BeeHiveDisplay method onBreakBeehive.
@EventHandler(priority = EventPriority.MONITOR)
public void onBreakBeehive(TileEntityRemovedEvent event) {
Block block = event.getBlock();
if (!beehiveMap.containsKey(block)) {
return;
}
Map<String, Object> map = beehiveMap.get(block);
if (map.get("0") instanceof ArmorStand) {
ArmorStand stand = (ArmorStand) map.get("0");
PacketManager.removeArmorStand(InteractionVisualizerAPI.getPlayers(), stand);
}
if (map.get("1") instanceof ArmorStand) {
ArmorStand stand = (ArmorStand) map.get("1");
PacketManager.removeArmorStand(InteractionVisualizerAPI.getPlayers(), stand);
}
beehiveMap.remove(block);
}
use of com.loohp.interactionvisualizer.entityholders.ArmorStand in project InteractionVisualizer by LOOHP.
the class BeeNestDisplay method spawnArmorStands.
public Map<String, ArmorStand> spawnArmorStands(Block block) {
Map<String, ArmorStand> map = new HashMap<>();
Location origin = block.getLocation();
BlockData blockData = block.getState().getBlockData();
BlockFace facing = ((Directional) blockData).getFacing();
Location target = block.getRelative(facing).getLocation();
Vector direction = target.toVector().subtract(origin.toVector()).multiply(0.7);
Location loc0 = block.getLocation().clone().add(direction).add(0.5, 0.25, 0.5);
ArmorStand line0 = new ArmorStand(loc0.clone());
setStand(line0);
Location loc1 = block.getLocation().clone().add(direction).add(0.5, 0, 0.5);
ArmorStand line1 = new ArmorStand(loc1.clone());
setStand(line1);
map.put("0", line0);
map.put("1", line1);
PacketManager.sendArmorStandSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.HOLOGRAM, KEY), line0);
PacketManager.sendArmorStandSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.HOLOGRAM, KEY), line1);
return map;
}
use of com.loohp.interactionvisualizer.entityholders.ArmorStand in project InteractionVisualizer by LOOHP.
the class BlastFurnaceDisplay method onBreakBlastFurnace.
@EventHandler(priority = EventPriority.MONITOR)
public void onBreakBlastFurnace(TileEntityRemovedEvent event) {
Block block = event.getBlock();
if (!blastfurnaceMap.containsKey(block)) {
return;
}
Map<String, Object> map = blastfurnaceMap.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);
}
blastfurnaceMap.remove(block);
}
use of com.loohp.interactionvisualizer.entityholders.ArmorStand in project InteractionVisualizer by LOOHP.
the class SoulCampfireDisplay method spawnArmorStands.
public Map<String, ArmorStand> spawnArmorStands(Block block) {
Map<String, ArmorStand> map = new HashMap<>();
Location origin = block.getLocation();
BlockData blockData = block.getState().getBlockData();
BlockFace facing = ((Directional) blockData).getFacing();
Location target = block.getRelative(facing).getLocation();
Vector direction = rotateVectorAroundY(target.toVector().subtract(origin.toVector()).multiply(0.44194173), 135);
Location loc = origin.clone().add(0.5, 0.3, 0.5);
ArmorStand slot1 = new ArmorStand(loc.clone().add(direction));
setStand(slot1);
ArmorStand slot2 = new ArmorStand(loc.clone().add(rotateVectorAroundY(direction.clone(), 90)));
setStand(slot2);
ArmorStand slot3 = new ArmorStand(loc.clone().add(rotateVectorAroundY(direction.clone(), 180)));
setStand(slot3);
ArmorStand slot4 = new ArmorStand(loc.clone().add(rotateVectorAroundY(direction.clone(), -90)));
setStand(slot4);
map.put("1", slot1);
map.put("2", slot2);
map.put("3", slot3);
map.put("4", slot4);
PacketManager.sendArmorStandSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.HOLOGRAM, KEY), slot1);
PacketManager.sendArmorStandSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.HOLOGRAM, KEY), slot2);
PacketManager.sendArmorStandSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.HOLOGRAM, KEY), slot3);
PacketManager.sendArmorStandSpawn(InteractionVisualizerAPI.getPlayerModuleList(Modules.HOLOGRAM, KEY), slot4);
return map;
}
Aggregations