Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ArmorStand addStand(Location loc, GameTeam team) {
- Collection<Entity> near = loc.add(0, 1, 0).getWorld().getNearbyEntities(loc, 2, 2, 2);
- boolean nearStand = false;
- for (Entity st : near) {
- if (st instanceof ArmorStand && st.getName().startsWith("Турель")) {
- nearStand = true;
- }
- }
- if (!nearStand) {
- ArmorStand turret = (ArmorStand) loc.getWorld().spawnEntity(loc.add(0.5, 1, 0.5), EntityType.ARMOR_STAND);
- turret.getEquipment().setHelmet(new ItemStack(Material.DISPENSER, 1));
- turret.setSmall(true);
- turret.setInvulnerable(true);
- turret.setCustomName("Турель");
- turret.setGravity(false);
- turret.setCustomNameVisible(true);
- turret.setMetadata("turret", new FixedMetadataValue(plugin, true));
- turret.setMetadata("lived", new FixedMetadataValue(plugin, 0));
- turret.setMetadata("type", new FixedMetadataValue(plugin, "normal"));
- team.addTurret(turret);
- stands.add(turret);
- return turret;
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement