From 70ca2c7964e5f5c6aaeb22109847bec3936d07a2 Mon Sep 17 00:00:00 2001 From: cnr Date: Tue, 15 Nov 2016 13:58:07 -0600 Subject: [PATCH] Add 1.11 support --- .../src/mineplex/core/CustomTagFix.java | 27 +++-- .../mineplex/core/bonuses/BonusManager.java | 70 ++++++------ .../core/creature/command/MobCommand.java | 11 ++ .../disguise/disguises/DisguiseAgeable.java | 6 +- .../disguise/disguises/DisguiseAmbient.java | 4 +- .../disguise/disguises/DisguiseAnimal.java | 6 +- .../disguises/DisguiseAnimalBase.java | 4 +- .../disguises/DisguiseArmorStand.java | 2 +- .../core/disguise/disguises/DisguiseBase.java | 32 ++++-- .../core/disguise/disguises/DisguiseBat.java | 2 +- .../disguise/disguises/DisguiseBlaze.java | 2 +- .../disguise/disguises/DisguiseBlock.java | 3 +- .../core/disguise/disguises/DisguiseCat.java | 2 +- .../disguises/DisguiseCaveSpider.java | 3 +- .../disguise/disguises/DisguiseChicken.java | 6 +- .../core/disguise/disguises/DisguiseCow.java | 6 +- .../disguise/disguises/DisguiseCreature.java | 7 +- .../disguise/disguises/DisguiseCreeper.java | 2 +- .../disguise/disguises/DisguiseEnderman.java | 2 +- .../disguise/disguises/DisguiseGolem.java | 6 +- .../disguise/disguises/DisguiseGuardian.java | 6 +- .../disguise/disguises/DisguiseHorse.java | 2 +- .../disguise/disguises/DisguiseHuman.java | 4 +- .../disguises/DisguiseInsentient.java | 9 +- .../disguise/disguises/DisguiseIronGolem.java | 2 +- .../disguise/disguises/DisguiseLiving.java | 12 +-- .../disguise/disguises/DisguiseMagmaCube.java | 3 +- .../disguise/disguises/DisguiseMonster.java | 4 +- .../disguise/disguises/DisguiseMooshroom.java | 4 +- .../core/disguise/disguises/DisguisePig.java | 6 +- .../disguise/disguises/DisguisePigZombie.java | 4 +- .../disguise/disguises/DisguiseRabbit.java | 6 +- .../disguise/disguises/DisguiseSheep.java | 2 +- .../disguise/disguises/DisguiseSkeleton.java | 2 +- .../disguise/disguises/DisguiseSlime.java | 2 +- .../disguise/disguises/DisguiseSnowman.java | 6 +- .../disguise/disguises/DisguiseSpider.java | 2 +- .../disguise/disguises/DisguiseSquid.java | 6 +- .../disguises/DisguiseTameableAnimal.java | 4 +- .../disguise/disguises/DisguiseVillager.java | 7 +- .../disguise/disguises/DisguiseWitch.java | 2 +- .../disguise/disguises/DisguiseWither.java | 5 +- .../core/disguise/disguises/DisguiseWolf.java | 2 +- .../disguise/disguises/DisguiseZombie.java | 6 +- .../gadgets/wineffect/WinEffectHalloween.java | 33 +++--- .../src/mineplex/core/hologram/Hologram.java | 34 +++--- .../src/mineplex/core/mount/HorseMount.java | 6 +- .../core/mount/types/MountChicken.java | 4 +- .../core/mount/types/MountSpider.java | 3 +- .../src/mineplex/core/utils/UtilVariant.java | 65 +++++++++++ .../hub/modules/AdminMountManager.java | 18 ++-- .../mineplex/hub/modules/WorldManager.java | 11 +- .../game/core/boss/snake/SnakeSegment.java | 20 ++-- .../game/games/castlesiege/CastleSiege.java | 78 +++++++------- .../games/christmas/content/PumpkinKing.java | 31 +++--- .../game/games/christmas/parts/Part4.java | 6 +- .../wither/data/WitherMinionManager.java | 49 ++++++--- .../games/smash/kits/KitSkeletalHorse.java | 8 +- .../perks/witherskeleton/PerkWitherImage.java | 6 +- .../game/arcade/kit/perks/PerkHorsePet.java | 58 +++++----- .../game/arcade/kit/perks/PerkSkeletons.java | 101 +++++++++++------- .../game/arcade/kit/perks/PerkWolfPet.java | 65 ++++++----- 62 files changed, 543 insertions(+), 364 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/utils/UtilVariant.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java index 67e0e00fb..8372203e6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java @@ -9,16 +9,6 @@ import java.util.Map.Entry; import java.util.Set; import java.util.UUID; -import mineplex.core.common.DummyEntity; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.event.CustomTagEvent; -import mineplex.core.packethandler.IPacketHandler; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.packethandler.PacketHandler; -import mineplex.core.packethandler.PacketVerifier; -import mineplex.core.packethandler.PacketInfo; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; import net.minecraft.server.v1_8_R3.DataWatcher; import net.minecraft.server.v1_8_R3.DataWatcher.WatchableObject; import net.minecraft.server.v1_8_R3.Entity; @@ -42,10 +32,19 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.event.player.PlayerToggleFlightEvent; -import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.plugin.java.JavaPlugin; +import mineplex.core.common.DummyEntity; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.event.CustomTagEvent; +import mineplex.core.packethandler.IPacketHandler; +import mineplex.core.packethandler.PacketHandler; +import mineplex.core.packethandler.PacketInfo; +import mineplex.core.packethandler.PacketVerifier; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + public class CustomTagFix extends MiniPlugin implements IPacketHandler { private Map> _entityMap = new HashMap<>(); @@ -524,9 +523,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler } else { - PacketPlayOutEntityMetadata entityMetadata = new PacketPlayOutEntityMetadata(); - entityMetadata.a = entityIds[0]; - entityMetadata.b = watcher.c(); + PacketPlayOutEntityMetadata entityMetadata = new PacketPlayOutEntityMetadata(entityIds[0], watcher, true); packetList.bypassProcess(entityMetadata); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java index d609f656b..82829872e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java @@ -1,5 +1,37 @@ package mineplex.core.bonuses; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.Queue; +import java.util.TimeZone; +import java.util.UUID; + +import net.minecraft.server.v1_8_R3.DataWatcher; +import net.minecraft.server.v1_8_R3.EntityCreeper; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Sound; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.player.PlayerInteractAtEntityEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.plugin.java.JavaPlugin; +import org.jooq.SQLDialect; +import org.jooq.impl.DSL; + import mineplex.core.MiniClientPlugin; import mineplex.core.account.CoreClient; import mineplex.core.account.CoreClientManager; @@ -47,36 +79,6 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.core.youtube.YoutubeManager; import mineplex.database.Tables; import mineplex.serverdata.database.DBPool; -import net.minecraft.server.v1_8_R3.DataWatcher; -import net.minecraft.server.v1_8_R3.EntityCreeper; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.player.PlayerInteractAtEntityEvent; -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.plugin.java.JavaPlugin; -import org.jooq.SQLDialect; -import org.jooq.impl.DSL; - -import java.sql.Date; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Queue; -import java.util.TimeZone; -import java.util.UUID; public class BonusManager extends MiniClientPlugin implements ILoginProcessor { @@ -719,9 +721,7 @@ public class BonusManager extends MiniClientPlugin implements I watcher.a(0, (byte) 0, EntityCreeper.META_ENTITYDATA, (byte) 0); watcher.a(1, (short) 300, EntityCreeper.META_AIR, 0); watcher.a(17, (byte) 1, EntityCreeper.META_POWERED, true); - PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(); - packet.a = _carlNpc.getEntity().getEntityId(); - packet.b = watcher.c(); + PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(_carlNpc.getEntity().getEntityId(), watcher, true); UtilPlayer.sendPacket(player, packet); } @@ -736,9 +736,7 @@ public class BonusManager extends MiniClientPlugin implements I // Charged DataWatcher watcher = new DataWatcher(null); watcher.a(17, (byte) 0, EntityCreeper.META_POWERED, false); - PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(); - packet.a = _carlNpc.getEntity().getEntityId(); - packet.b = watcher.c(); + PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(_carlNpc.getEntity().getEntityId(), watcher, true); UtilPlayer.sendPacket(player, packet); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java index faf8929e2..33e0ed950 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java @@ -10,6 +10,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; import org.bukkit.entity.Ageable; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; +import org.bukkit.entity.Guardian; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; import org.bukkit.entity.Skeleton.SkeletonType; @@ -163,6 +164,16 @@ public class MobCommand extends MultiCommandBase UtilPlayer.message(caller, F.desc("Angry", "True")); argHandle.add(arg); } + + else if (arg.equalsIgnoreCase("elder")) + { + for (Entity ent : entSet) + if (ent instanceof Guardian) + ((Guardian)ent).setElder(true); + + UtilPlayer.message(caller, F.desc("Elder", "True")); + argHandle.add(arg); + } //Profession else if (arg.toLowerCase().charAt(0) == 'p') diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAgeable.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAgeable.java index f51230ef4..c70db1088 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAgeable.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAgeable.java @@ -2,13 +2,13 @@ package mineplex.core.disguise.disguises; import net.minecraft.server.v1_8_R3.EntityAgeable; -import org.bukkit.entity.*; +import org.bukkit.entity.EntityType; public abstract class DisguiseAgeable extends DisguiseCreature { - public DisguiseAgeable(EntityType disguiseType, org.bukkit.entity.Entity entity) + public DisguiseAgeable(EntityType disguiseType, org.bukkit.entity.Entity entity, Class clazz) { - super(disguiseType, entity); + super(disguiseType, entity, clazz); DataWatcher.a(12, new Byte((byte)0), EntityAgeable.META_BABY, false); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAmbient.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAmbient.java index d72e9aafb..668ee91e8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAmbient.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAmbient.java @@ -4,8 +4,8 @@ import org.bukkit.entity.EntityType; public abstract class DisguiseAmbient extends DisguiseInsentient { - public DisguiseAmbient(EntityType entityType, org.bukkit.entity.Entity entity) + public DisguiseAmbient(EntityType entityType, org.bukkit.entity.Entity entity, Class clazz) { - super(entityType, entity); + super(entityType, entity, clazz); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimal.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimal.java index e65ff3d5f..af73365c1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimal.java @@ -1,11 +1,11 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.*; +import org.bukkit.entity.EntityType; public abstract class DisguiseAnimal extends DisguiseAgeable { - public DisguiseAnimal(EntityType disguiseType, org.bukkit.entity.Entity entity) + public DisguiseAnimal(EntityType disguiseType, org.bukkit.entity.Entity entity, Class clazz) { - super(disguiseType, entity); + super(disguiseType, entity, clazz); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimalBase.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimalBase.java index f47327a24..f3ce535e6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimalBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimalBase.java @@ -5,9 +5,9 @@ import org.bukkit.entity.EntityType; public class DisguiseAnimalBase extends DisguiseAnimal { - public DisguiseAnimalBase(EntityType entityType, org.bukkit.entity.Entity entity) + public DisguiseAnimalBase(EntityType entityType, org.bukkit.entity.Entity entity, Class clazz) { - super(entityType, entity); + super(entityType, entity, clazz); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseArmorStand.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseArmorStand.java index 79695ec61..5c8d79dd2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseArmorStand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseArmorStand.java @@ -13,7 +13,7 @@ public class DisguiseArmorStand extends DisguiseInsentient { public DisguiseArmorStand(org.bukkit.entity.Entity entity) { - super(EntityType.ARMOR_STAND, entity); + super(EntityType.ARMOR_STAND, entity, EntityArmorStand.class); DataWatcher.a(10, (byte) 0, EntityArmorStand.META_ARMOR_OPTION, (byte) 0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java index 2d0334abc..91c763e5c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java @@ -1,7 +1,13 @@ package mineplex.core.disguise.disguises; -import mineplex.core.common.DummyEntity; -import mineplex.core.common.util.UtilPlayer; +import java.lang.ref.WeakReference; +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import net.minecraft.server.v1_8_R3.DataWatcher; import net.minecraft.server.v1_8_R3.Entity; import net.minecraft.server.v1_8_R3.EntityPlayer; @@ -12,18 +18,17 @@ import net.minecraft.server.v1_8_R3.Packet; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata; import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; import net.minecraft.server.v1_8_R3.WorldServer; + import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.entity.CreatureSpawnEvent; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import mineplex.core.common.util.UtilPlayer; public abstract class DisguiseBase { + private final Map,net.minecraft.server.v1_8_R3.Entity> dummyEntities = new HashMap<>(); private WeakReference _entity = new WeakReference<>(null); protected DataWatcher DataWatcher; @@ -37,7 +42,7 @@ public abstract class DisguiseBase */ private boolean _hideIfNotDisguised = false; - public DisguiseBase(EntityType entityType, org.bukkit.entity.Entity entity) + public DisguiseBase(EntityType entityType, org.bukkit.entity.Entity entity, Class entityClazz) { if (entity == null) { @@ -48,7 +53,18 @@ public abstract class DisguiseBase setEntity(entity); - DataWatcher = new DataWatcher(new DummyEntity(null)); + DataWatcher = new DataWatcher(dummyEntities.computeIfAbsent(entityClazz, clazz -> + { + try + { + Constructor constructor = clazz.getDeclaredConstructor(net.minecraft.server.v1_8_R3.World.class); + return constructor.newInstance((net.minecraft.server.v1_8_R3.World)null); + } catch (Exception e) + { + e.printStackTrace(); + return null; + } + })); DataWatcher.a(0, (byte) 0, net.minecraft.server.v1_8_R3.Entity.META_ENTITYDATA, (byte) 0); DataWatcher.a(1, (short) 300, net.minecraft.server.v1_8_R3.Entity.META_AIR, 300); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBat.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBat.java index b5100c880..eed6f6e85 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBat.java @@ -8,7 +8,7 @@ public class DisguiseBat extends DisguiseCreature { public DisguiseBat(org.bukkit.entity.Entity entity) { - super(EntityType.BAT, entity); + super(EntityType.BAT, entity, EntityBat.class); DataWatcher.a(16, new Byte((byte) 0), EntityBat.META_UPSIDEDOWN, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlaze.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlaze.java index c0d782982..9c7e1bedb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlaze.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlaze.java @@ -8,7 +8,7 @@ public class DisguiseBlaze extends DisguiseMonster { public DisguiseBlaze(org.bukkit.entity.Entity entity) { - super(EntityType.BLAZE, entity); + super(EntityType.BLAZE, entity, EntityBlaze.class); DataWatcher.a(16, new Byte((byte) 0), EntityBlaze.META_FIRE, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java index 387208c51..8b23dfceb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java @@ -2,6 +2,7 @@ package mineplex.core.disguise.disguises; import java.util.Random; +import net.minecraft.server.v1_8_R3.EntityFallingBlock; import net.minecraft.server.v1_8_R3.MathHelper; import net.minecraft.server.v1_8_R3.Packet; import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntity; @@ -16,7 +17,7 @@ public class DisguiseBlock extends DisguiseBase public DisguiseBlock(org.bukkit.entity.Entity entity, int blockId, int blockData) { - super(EntityType.FALLING_BLOCK, entity); + super(EntityType.FALLING_BLOCK, entity, EntityFallingBlock.class); _blockId = blockId; _blockData = blockData; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCat.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCat.java index 621d77259..6cebfee7a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCat.java @@ -8,7 +8,7 @@ public class DisguiseCat extends DisguiseTameableAnimal { public DisguiseCat(org.bukkit.entity.Entity entity) { - super(EntityType.OCELOT, entity); + super(EntityType.OCELOT, entity, EntityOcelot.class); DataWatcher.a(18, Byte.valueOf((byte) 0), EntityOcelot.META_TYPE, 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCaveSpider.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCaveSpider.java index 09b3d076a..ff4bf7a7a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCaveSpider.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCaveSpider.java @@ -2,6 +2,7 @@ package mineplex.core.disguise.disguises; import org.bukkit.entity.EntityType; +import net.minecraft.server.v1_8_R3.EntityCaveSpider; import net.minecraft.server.v1_8_R3.EntitySpider; public class DisguiseCaveSpider extends DisguiseMonster @@ -9,7 +10,7 @@ public class DisguiseCaveSpider extends DisguiseMonster public DisguiseCaveSpider(org.bukkit.entity.Entity entity) { - super(EntityType.CAVE_SPIDER, entity); + super(EntityType.CAVE_SPIDER, entity, EntityCaveSpider.class); DataWatcher.a(16, new Byte((byte) 0), EntitySpider.META_CLIMBING, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseChicken.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseChicken.java index f55c6d707..8c4155c46 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseChicken.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseChicken.java @@ -1,12 +1,14 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.*; +import net.minecraft.server.v1_8_R3.EntityChicken; + +import org.bukkit.entity.EntityType; public class DisguiseChicken extends DisguiseAnimal { public DisguiseChicken(org.bukkit.entity.Entity entity) { - super(EntityType.CHICKEN, entity); + super(EntityType.CHICKEN, entity, EntityChicken.class); } public String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCow.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCow.java index 86b1dc192..e26a08a1b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCow.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCow.java @@ -1,12 +1,14 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.*; +import net.minecraft.server.v1_8_R3.EntityCow; + +import org.bukkit.entity.EntityType; public class DisguiseCow extends DisguiseAnimal { public DisguiseCow(org.bukkit.entity.Entity entity) { - super(EntityType.COW, entity); + super(EntityType.COW, entity, EntityCow.class); } public String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java index d477ab3bc..c888e73a4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java @@ -3,13 +3,14 @@ package mineplex.core.disguise.disguises; import net.minecraft.server.v1_8_R3.MathHelper; import net.minecraft.server.v1_8_R3.Packet; import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; -import org.bukkit.entity.*; + +import org.bukkit.entity.EntityType; public abstract class DisguiseCreature extends DisguiseInsentient { - public DisguiseCreature(EntityType disguiseType, org.bukkit.entity.Entity entity) + public DisguiseCreature(EntityType disguiseType, org.bukkit.entity.Entity entity, Class entityClazz) { - super(disguiseType, entity); + super(disguiseType, entity, entityClazz); } @SuppressWarnings("deprecation") diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreeper.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreeper.java index 6d1eeb73b..189ac20f0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreeper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreeper.java @@ -8,7 +8,7 @@ public class DisguiseCreeper extends DisguiseMonster { public DisguiseCreeper(org.bukkit.entity.Entity entity) { - super(EntityType.CREEPER, entity); + super(EntityType.CREEPER, entity, EntityCreeper.class); DataWatcher.a(16, Byte.valueOf((byte) -1), EntityCreeper.META_FUSE_STATE, -1); DataWatcher.a(17, Byte.valueOf((byte) 0), EntityCreeper.META_POWERED, false); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java index d8d9703c4..8aee3501f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java @@ -19,7 +19,7 @@ public class DisguiseEnderman extends DisguiseMonster { public DisguiseEnderman(org.bukkit.entity.Entity entity) { - super(EntityType.ENDERMAN, entity); + super(EntityType.ENDERMAN, entity, EntityEnderman.class); DataWatcher.a(16, new Short((short) 0), EntityEnderman.META_BLOCK, Optional. absent()); DataWatcher.a(17, new Byte((byte) 0), EntityEnderman.META_BLOCK, Optional. absent()); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGolem.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGolem.java index de5a8b1fd..2457d6a4a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGolem.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGolem.java @@ -1,11 +1,11 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.*; +import org.bukkit.entity.EntityType; public abstract class DisguiseGolem extends DisguiseCreature { - public DisguiseGolem(EntityType disguiseType, org.bukkit.entity.Entity entity) + public DisguiseGolem(EntityType disguiseType, org.bukkit.entity.Entity entity, Class clazz) { - super(disguiseType, entity); + super(disguiseType, entity, clazz); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGuardian.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGuardian.java index af05e67bb..d65455002 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGuardian.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseGuardian.java @@ -1,14 +1,14 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.*; - import net.minecraft.server.v1_8_R3.EntityGuardian; +import org.bukkit.entity.EntityType; + public class DisguiseGuardian extends DisguiseCreature { public DisguiseGuardian(org.bukkit.entity.Entity entity) { - super(EntityType.GUARDIAN, entity); + super(EntityType.GUARDIAN, entity, EntityGuardian.class); DataWatcher.a(16, 0, EntityGuardian.META_ELDER, (byte) 0); DataWatcher.a(17, 0, EntityGuardian.META_TARGET, 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHorse.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHorse.java index cbd7ee097..b2c06f503 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHorse.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHorse.java @@ -12,7 +12,7 @@ public class DisguiseHorse extends DisguiseAnimal { public DisguiseHorse(org.bukkit.entity.Entity entity) { - super(EntityType.HORSE, entity); + super(EntityType.HORSE, entity, EntityHorse.class); DataWatcher.a(16, Integer.valueOf(0), EntityHorse.META_HORSE_STATE, (byte) 0); DataWatcher.a(19, Byte.valueOf((byte) 0), EntityHorse.META_TYPE, 0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHuman.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHuman.java index 344af0254..1931af450 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHuman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseHuman.java @@ -3,11 +3,13 @@ package mineplex.core.disguise.disguises; import net.minecraft.server.v1_8_R3.EntityHuman; import org.bukkit.entity.EntityType; +import mineplex.core.common.DummyEntity; + public abstract class DisguiseHuman extends DisguiseLiving { public DisguiseHuman(EntityType disguiseType, org.bukkit.entity.Entity entity) { - super(disguiseType, entity); + super(disguiseType, entity, DummyEntity.class); byte skin = 0; skin |= (1 << 0); //Enable Cape diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseInsentient.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseInsentient.java index 843af0c09..6d0f650d4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseInsentient.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseInsentient.java @@ -1,18 +1,19 @@ package mineplex.core.disguise.disguises; -import mineplex.core.common.*; import net.minecraft.server.v1_8_R3.EntityInsentient; -import org.bukkit.*; +import org.bukkit.ChatColor; import org.bukkit.entity.EntityType; +import mineplex.core.common.Rank; + public abstract class DisguiseInsentient extends DisguiseLiving { private boolean _showArmor; - public DisguiseInsentient(EntityType disguiseType, org.bukkit.entity.Entity entity) + public DisguiseInsentient(EntityType disguiseType, org.bukkit.entity.Entity entity, Class clazz) { - super(disguiseType, entity); + super(disguiseType, entity, clazz); DataWatcher.a(3, Byte.valueOf((byte) 0), EntityInsentient.META_CUSTOMNAME_VISIBLE, false); DataWatcher.a(2, "", EntityInsentient.META_CUSTOMNAME, ""); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseIronGolem.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseIronGolem.java index 0e487c7e7..07165e023 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseIronGolem.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseIronGolem.java @@ -8,7 +8,7 @@ public class DisguiseIronGolem extends DisguiseGolem { public DisguiseIronGolem(org.bukkit.entity.Entity entity) { - super(EntityType.IRON_GOLEM, entity); + super(EntityType.IRON_GOLEM, entity, EntityIronGolem.class); DataWatcher.a(16, Byte.valueOf((byte) 0), EntityIronGolem.META_PLAYER_CREATED, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseLiving.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseLiving.java index dc3608873..47624d0e9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseLiving.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseLiving.java @@ -3,24 +3,24 @@ package mineplex.core.disguise.disguises; import java.util.ArrayList; import java.util.Random; +import net.minecraft.server.v1_8_R3.EntityLiving; +import net.minecraft.server.v1_8_R3.Packet; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityEquipment; + import org.bukkit.Material; import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; -import net.minecraft.server.v1_8_R3.EntityLiving; -import net.minecraft.server.v1_8_R3.Packet; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntityEquipment; - public abstract class DisguiseLiving extends DisguiseBase { private static Random _random = new Random(); private boolean _invisible; private ItemStack[] _equipment = new ItemStack[5]; - public DisguiseLiving(EntityType disguiseType, org.bukkit.entity.Entity entity) + public DisguiseLiving(EntityType disguiseType, org.bukkit.entity.Entity entity, Class clazz) { - super(disguiseType, entity); + super(disguiseType, entity, clazz); DataWatcher.a(6, Float.valueOf(1.0F), EntityLiving.META_HEALTH, 1F); DataWatcher.a(7, Integer.valueOf(0), EntityLiving.META_POTION_COLOR, 0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMagmaCube.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMagmaCube.java index 904835bba..2de9ca123 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMagmaCube.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMagmaCube.java @@ -1,5 +1,6 @@ package mineplex.core.disguise.disguises; +import net.minecraft.server.v1_8_R3.EntityMagmaCube; import net.minecraft.server.v1_8_R3.EntitySlime; import net.minecraft.server.v1_8_R3.MathHelper; import net.minecraft.server.v1_8_R3.Packet; @@ -10,7 +11,7 @@ public class DisguiseMagmaCube extends DisguiseInsentient { public DisguiseMagmaCube(org.bukkit.entity.Entity entity) { - super(EntityType.MAGMA_CUBE, entity); + super(EntityType.MAGMA_CUBE, entity, EntityMagmaCube.class); DataWatcher.a(16, new Byte((byte) 1), EntitySlime.META_SIZE, 1); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMonster.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMonster.java index d64c04a7d..e1d5b3ec8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMonster.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMonster.java @@ -4,8 +4,8 @@ import org.bukkit.entity.*; public abstract class DisguiseMonster extends DisguiseCreature { - public DisguiseMonster(EntityType disguiseType, org.bukkit.entity.Entity entity) + public DisguiseMonster(EntityType disguiseType, org.bukkit.entity.Entity entity, Class clazz) { - super(disguiseType, entity); + super(disguiseType, entity, clazz); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMooshroom.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMooshroom.java index 8b6d64485..91c5c6eba 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMooshroom.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMooshroom.java @@ -1,12 +1,14 @@ package mineplex.core.disguise.disguises; +import net.minecraft.server.v1_8_R3.EntityMushroomCow; + import org.bukkit.entity.*; public class DisguiseMooshroom extends DisguiseAnimal { public DisguiseMooshroom(org.bukkit.entity.Entity entity) { - super(EntityType.MUSHROOM_COW, entity); + super(EntityType.MUSHROOM_COW, entity, EntityMushroomCow.class); } public String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePig.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePig.java index b2ce16dc1..750e0bd4f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePig.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePig.java @@ -1,12 +1,14 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.*; +import net.minecraft.server.v1_8_R3.EntityPig; + +import org.bukkit.entity.EntityType; public class DisguisePig extends DisguiseAnimal { public DisguisePig(org.bukkit.entity.Entity entity) { - super(EntityType.PIG, entity); + super(EntityType.PIG, entity, EntityPig.class); } public String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePigZombie.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePigZombie.java index 259dfb163..8e0c8de9c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePigZombie.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePigZombie.java @@ -1,12 +1,14 @@ package mineplex.core.disguise.disguises; +import net.minecraft.server.v1_8_R3.EntityPigZombie; + import org.bukkit.entity.*; public class DisguisePigZombie extends DisguiseZombie { public DisguisePigZombie(org.bukkit.entity.Entity entity) { - super(EntityType.PIG_ZOMBIE, entity); + super(EntityType.PIG_ZOMBIE, entity, EntityPigZombie.class); } protected String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseRabbit.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseRabbit.java index 3facd4fe2..0461a8fe2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseRabbit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseRabbit.java @@ -1,18 +1,18 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.EntityType; - import net.minecraft.server.v1_8_R3.EntityRabbit; import net.minecraft.server.v1_8_R3.MathHelper; import net.minecraft.server.v1_8_R3.Packet; import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; +import org.bukkit.entity.EntityType; + public class DisguiseRabbit extends DisguiseAnimal { public DisguiseRabbit(org.bukkit.entity.Entity entity) { - super(EntityType.RABBIT, entity); + super(EntityType.RABBIT, entity, EntityRabbit.class); DataWatcher.a(18, Byte.valueOf((byte) 0), EntityRabbit.META_TYPE, 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSheep.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSheep.java index 83e32ad0a..7ed6edc16 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSheep.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSheep.java @@ -9,7 +9,7 @@ public class DisguiseSheep extends DisguiseAnimal { public DisguiseSheep(org.bukkit.entity.Entity entity) { - super(EntityType.SHEEP, entity); + super(EntityType.SHEEP, entity, EntitySheep.class); DataWatcher.a(16, new Byte((byte) 0), EntitySheep.META_WOOL_STATE, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSkeleton.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSkeleton.java index 122490073..9c099a369 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSkeleton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSkeleton.java @@ -9,7 +9,7 @@ public class DisguiseSkeleton extends DisguiseMonster { public DisguiseSkeleton(org.bukkit.entity.Entity entity) { - super(EntityType.SKELETON, entity); + super(EntityType.SKELETON, entity, EntitySkeleton.class); DataWatcher.a(13, Byte.valueOf((byte) 0), EntitySkeleton.META_TYPE, 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSlime.java index 96bb78cd9..dcbb66702 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSlime.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSlime.java @@ -10,7 +10,7 @@ public class DisguiseSlime extends DisguiseInsentient { public DisguiseSlime(org.bukkit.entity.Entity entity) { - super(EntityType.SLIME, entity); + super(EntityType.SLIME, entity, EntitySlime.class); DataWatcher.a(16, new Byte((byte) 1), EntitySlime.META_SIZE, 1); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSnowman.java index 0c643e94d..569a6316f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSnowman.java @@ -1,11 +1,13 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.*; +import net.minecraft.server.v1_8_R3.EntitySnowman; + +import org.bukkit.entity.EntityType; public class DisguiseSnowman extends DisguiseGolem { public DisguiseSnowman(org.bukkit.entity.Entity entity) { - super(EntityType.SNOWMAN, entity); + super(EntityType.SNOWMAN, entity, EntitySnowman.class); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSpider.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSpider.java index 8851de909..f90bb860f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSpider.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSpider.java @@ -8,7 +8,7 @@ public class DisguiseSpider extends DisguiseMonster { public DisguiseSpider(org.bukkit.entity.Entity entity) { - super(EntityType.SPIDER, entity); + super(EntityType.SPIDER, entity, EntitySpider.class); DataWatcher.a(16, new Byte((byte) 0), EntitySpider.META_CLIMBING, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSquid.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSquid.java index 040d5de5c..c03e50b35 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSquid.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSquid.java @@ -1,12 +1,14 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.*; +import net.minecraft.server.v1_8_R3.EntitySquid; + +import org.bukkit.entity.EntityType; public class DisguiseSquid extends DisguiseMonster { public DisguiseSquid(org.bukkit.entity.Entity entity) { - super(EntityType.SQUID, entity); + super(EntityType.SQUID, entity, EntitySquid.class); } protected String getHurtSound() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseTameableAnimal.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseTameableAnimal.java index 8309387c9..c281b020b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseTameableAnimal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseTameableAnimal.java @@ -10,9 +10,9 @@ import com.google.common.base.Optional; public abstract class DisguiseTameableAnimal extends DisguiseAnimal { - public DisguiseTameableAnimal(EntityType disguiseType, org.bukkit.entity.Entity entity) + public DisguiseTameableAnimal(EntityType disguiseType, org.bukkit.entity.Entity entity, Class clazz) { - super(disguiseType, entity); + super(disguiseType, entity, clazz); DataWatcher.a(16, Byte.valueOf((byte) 0), EntityTameableAnimal.META_SITTING_TAMED, (byte) 0); DataWatcher.a(17, "", EntityTameableAnimal.META_OWNER, Optional. absent()); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseVillager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseVillager.java index d9f367bdf..9f36f02f7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseVillager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseVillager.java @@ -1,12 +1,15 @@ package mineplex.core.disguise.disguises; -import org.bukkit.entity.*; +import net.minecraft.server.v1_8_R3.EntityVillager; + +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; public class DisguiseVillager extends DisguiseAgeable { public DisguiseVillager(Entity entity) { - super(EntityType.VILLAGER, entity); + super(EntityType.VILLAGER, entity, EntityVillager.class); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWitch.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWitch.java index 83db8142c..8bb8c12e4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWitch.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWitch.java @@ -8,7 +8,7 @@ public class DisguiseWitch extends DisguiseMonster { public DisguiseWitch(org.bukkit.entity.Entity entity) { - super(EntityType.WITCH, entity); + super(EntityType.WITCH, entity, EntityWitch.class); DataWatcher.a(21, Byte.valueOf((byte) 0), EntityWitch.META_AGGRESSIVE, false); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWither.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWither.java index 333d283bd..6c715ce0a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWither.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWither.java @@ -3,15 +3,12 @@ package mineplex.core.disguise.disguises; import net.minecraft.server.v1_8_R3.EntityWither; import org.bukkit.entity.EntityType; -import org.bukkit.entity.LivingEntity; - -import mineplex.core.common.util.UtilMath; public class DisguiseWither extends DisguiseMonster { public DisguiseWither(org.bukkit.entity.Entity entity) { - super(EntityType.WITHER, entity); + super(EntityType.WITHER, entity, EntityWither.class); DataWatcher.a(17, new Integer(0), EntityWither.META_INVUL_TIME, 0); DataWatcher.a(18, new Integer(0), EntityWither.META_TARGET_1, 0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java index 3b663f075..952f4a284 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java @@ -8,7 +8,7 @@ public class DisguiseWolf extends DisguiseTameableAnimal { public DisguiseWolf(org.bukkit.entity.Entity entity) { - super(EntityType.WOLF, entity); + super(EntityType.WOLF, entity, EntityWolf.class); DataWatcher.a(18, new Float(20F), EntityWolf.META_WOLF_HEALTH, 20F); DataWatcher.a(19, new Byte((byte) 0), EntityWolf.META_BEGGING, false); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseZombie.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseZombie.java index df1d4118e..1aacdc46e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseZombie.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseZombie.java @@ -8,12 +8,12 @@ public class DisguiseZombie extends DisguiseMonster { public DisguiseZombie(Entity entity) { - this(EntityType.ZOMBIE, entity); + this(EntityType.ZOMBIE, entity, EntityZombie.class); } - public DisguiseZombie(EntityType disguiseType, Entity entity) + public DisguiseZombie(EntityType disguiseType, Entity entity, Class clazz) { - super(disguiseType, entity); + super(disguiseType, entity, clazz); DataWatcher.a(12, Byte.valueOf((byte) 0), EntityZombie.META_CHILD, false); DataWatcher.a(13, Byte.valueOf((byte) 0), EntityZombie.META_VILLAGER, false); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectHalloween.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectHalloween.java index ffd1e29be..17d8c4075 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectHalloween.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectHalloween.java @@ -3,16 +3,6 @@ package mineplex.core.gadget.gadgets.wineffect; import java.util.ArrayList; import java.util.List; -import mineplex.core.common.skin.SkinData; -import mineplex.core.common.util.*; -import mineplex.core.common.util.particles.ColoredParticle; -import mineplex.core.common.util.particles.DustSpellColor; -import mineplex.core.disguise.disguises.DisguisePlayer; -import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.gadgets.particle.unrelated.BabyFireworkEffect; -import mineplex.core.gadget.types.WinEffectGadget; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; @@ -22,6 +12,26 @@ import org.bukkit.entity.Skeleton; import org.bukkit.event.EventHandler; import org.bukkit.inventory.ItemStack; +import mineplex.core.common.skin.SkinData; +import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilShapes; +import mineplex.core.common.util.UtilSkull; +import mineplex.core.common.util.UtilText; +import mineplex.core.common.util.particles.ColoredParticle; +import mineplex.core.common.util.particles.DustSpellColor; +import mineplex.core.disguise.disguises.DisguisePlayer; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.particle.unrelated.BabyFireworkEffect; +import mineplex.core.gadget.types.WinEffectGadget; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; + public class WinEffectHalloween extends WinEffectGadget { @@ -119,10 +129,9 @@ public class WinEffectHalloween extends WinEffectGadget private void spawnSkeleton() { - Skeleton skeleton = getBaseLocation().getWorld().spawn(getBaseLocation(), Skeleton.class); + Skeleton skeleton = UtilVariant.spawnWitherSkeleton(getBaseLocation()); skeleton.setCustomName(getRank(_player) + _player.getName()); skeleton.setCustomNameVisible(true); - skeleton.setSkeletonType(Skeleton.SkeletonType.WITHER); skeleton.getEquipment().setHelmet(new ItemStack(Material.JACK_O_LANTERN)); UtilEnt.ghost(skeleton, true, false); UtilEnt.Vegetate(skeleton); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/hologram/Hologram.java b/Plugins/Mineplex.Core/src/mineplex/core/hologram/Hologram.java index b06707ed2..f873ea35c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/hologram/Hologram.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/hologram/Hologram.java @@ -1,14 +1,12 @@ package mineplex.core.hologram; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; -import org.bukkit.Location; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.util.Vector; - -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilPlayer; import net.minecraft.server.v1_8_R3.DataWatcher; import net.minecraft.server.v1_8_R3.EntityArmorStand; import net.minecraft.server.v1_8_R3.Packet; @@ -18,6 +16,14 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport; import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; +import org.bukkit.Location; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilPlayer; + public class Hologram { public enum HologramTarget { @@ -481,12 +487,6 @@ public class Hologram { // Send update metadata packets Integer entityId = _entityIds.get(i); - PacketPlayOutEntityMetadata metadata1_8 = new PacketPlayOutEntityMetadata(); - PacketPlayOutEntityMetadata metadata1_9 = new PacketPlayOutEntityMetadata(); - - metadata1_8.a = entityId; - metadata1_9.a = entityId; - DataWatcher watcher1_8 = new DataWatcher(null); DataWatcher watcher1_9 = new DataWatcher(null); @@ -504,11 +504,9 @@ public class Hologram { watcher1_9.a(10, (byte) 16, EntityArmorStand.META_ARMOR_OPTION, (byte) 16); } } - metadata1_8.b = watcher1_8.c(); - metadata1_9.b = watcher1_9.c(); - packets1_8.add(metadata1_8); - packets1_9.add(metadata1_9); + packets1_8.add(new PacketPlayOutEntityMetadata(entityId, watcher1_8, true)); + packets1_9.add(new PacketPlayOutEntityMetadata(entityId, watcher1_9, true)); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/HorseMount.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/HorseMount.java index 05a85e24d..f383958b4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/HorseMount.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/HorseMount.java @@ -23,6 +23,7 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; public class HorseMount extends Mount> { @@ -103,13 +104,12 @@ public class HorseMount extends Mount> //Remove other mounts Manager.DeregisterAll(player); - - Horse horse = player.getWorld().spawn(player.getLocation(), Horse.class); + + Horse horse = UtilVariant.spawnHorse(player.getLocation(), _variant); horse.setAdult(); horse.setAgeLock(true); horse.setColor(_color); horse.setStyle(_style); - horse.setVariant(_variant); horse.setOwner(player); horse.setMaxDomestication(1); horse.setJumpStrength(_jump); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountChicken.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountChicken.java index 68b439005..6c8382210 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountChicken.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountChicken.java @@ -28,6 +28,7 @@ import mineplex.core.mount.SingleEntityMountData; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; public class MountChicken extends HorseMount { @@ -61,12 +62,11 @@ public class MountChicken extends HorseMount //Remove other mounts Manager.DeregisterAll(player); - Horse horse = player.getWorld().spawn(player.getLocation(), Horse.class); + Horse horse = UtilVariant.spawnHorse(player.getLocation(), _variant); horse.setAdult(); horse.setAgeLock(true); horse.setColor(_color); horse.setStyle(_style); - horse.setVariant(_variant); horse.setOwner(player); horse.setMaxDomestication(1); horse.setJumpStrength(_jump); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java index 90b7ab87c..3962bf332 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java @@ -35,6 +35,7 @@ import mineplex.core.mount.SingleEntityMountData; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; public class MountSpider extends HorseMount { @@ -76,7 +77,7 @@ public class MountSpider extends HorseMount //Remove other mounts Manager.DeregisterAll(player); - Horse horse = player.getWorld().spawn(player.getLocation(), Horse.class); + Horse horse = UtilVariant.spawnHorse(player.getLocation(), _variant); horse.setAdult(); horse.setAgeLock(true); horse.setColor(_color); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/utils/UtilVariant.java b/Plugins/Mineplex.Core/src/mineplex/core/utils/UtilVariant.java new file mode 100644 index 000000000..8134ca1f5 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/utils/UtilVariant.java @@ -0,0 +1,65 @@ +package mineplex.core.utils; + +import net.minecraft.server.v1_8_R3.EntityGuardian; +import net.minecraft.server.v1_8_R3.EntityHorse; +import net.minecraft.server.v1_8_R3.EntitySkeleton; +import net.minecraft.server.v1_8_R3.EntityZombie; +import net.minecraft.server.v1_8_R3.World; + +import org.bukkit.Location; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; +import org.bukkit.entity.Guardian; +import org.bukkit.entity.Horse; +import org.bukkit.entity.Skeleton; +import org.bukkit.entity.Zombie; +import org.bukkit.event.entity.CreatureSpawnEvent; + +public class UtilVariant +{ + + public static Horse spawnHorse(Location location, Horse.Variant variant) + { + World world = ((CraftWorld) location.getWorld()).getHandle(); + + EntityHorse horse = new EntityHorse(world); + horse.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + horse.setType(variant.ordinal()); + world.addEntity(horse, CreatureSpawnEvent.SpawnReason.CUSTOM); + + return (Horse) horse.getBukkitEntity(); + } + + public static Zombie spawnZombieVillager(Location location) + { + World world = ((CraftWorld) location.getWorld()).getHandle(); + + EntityZombie zombie = new EntityZombie(world); + zombie.setVillager(true); + world.addEntity(zombie, CreatureSpawnEvent.SpawnReason.CUSTOM); + + return (Zombie) zombie.getBukkitEntity(); + } + + public static Skeleton spawnWitherSkeleton(Location location) + { + World world = ((CraftWorld) location.getWorld()).getHandle(); + + EntitySkeleton skeleton = new EntitySkeleton(world); + skeleton.setSkeletonType(1); + world.addEntity(skeleton, CreatureSpawnEvent.SpawnReason.CUSTOM); + + return (Skeleton) skeleton.getBukkitEntity(); + } + + public static Guardian spawnElderGuardian(Location location) + { + World world = ((CraftWorld) location.getWorld()).getHandle(); + + EntityGuardian guardian = new EntityGuardian(world); + guardian.setElder(true); + world.addEntity(guardian, CreatureSpawnEvent.SpawnReason.CUSTOM); + + return (Guardian) guardian.getBukkitEntity(); + + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java index 90806d135..d1ba19b1f 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java @@ -3,24 +3,25 @@ package mineplex.hub.modules; import java.util.ArrayList; import java.util.HashMap; -import mineplex.core.MiniPlugin; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilPlayer; -import mineplex.hub.HubManager; -import mineplex.hub.commands.HorseSpawn; - import org.bukkit.Material; import org.bukkit.entity.Horse; -import org.bukkit.entity.Player; import org.bukkit.entity.Horse.Color; import org.bukkit.entity.Horse.Style; import org.bukkit.entity.Horse.Variant; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.inventory.ItemStack; +import mineplex.core.MiniPlugin; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.utils.UtilVariant; +import mineplex.hub.HubManager; +import mineplex.hub.commands.HorseSpawn; + public class AdminMountManager extends MiniPlugin { private HubManager Manager; @@ -291,12 +292,11 @@ public class AdminMountManager extends MiniPlugin Horse horse = _mounts.remove(caller); if (horse != null) horse.remove(); - horse = caller.getWorld().spawn(caller.getLocation(), Horse.class); + horse = UtilVariant.spawnHorse(caller.getLocation(), var); horse.setAdult(); horse.setAgeLock(true); horse.setColor(Color.DARK_BROWN); horse.setStyle(Style.WHITE_DOTS); - horse.setVariant(var); horse.setOwner(caller); horse.setMaxDomestication(1); horse.setJumpStrength(1); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java index 1d8a19f78..0d83153c4 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java @@ -20,7 +20,6 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Pig; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; -import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.entity.Snowman; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -50,6 +49,7 @@ import mineplex.core.gadget.event.GadgetCollideEntityEvent; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; import mineplex.hub.HubManager; import mineplex.hub.HubType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -130,11 +130,14 @@ public class WorldManager extends MiniPlugin //Spawn if (Manager.Type == HubType.Halloween) { - Skeleton ent = loc.getWorld().spawn(loc, Skeleton.class); - + final Skeleton ent; if (Math.random() > 0.5) { - ent.setSkeletonType(SkeletonType.WITHER); + ent = UtilVariant.spawnWitherSkeleton(loc); + + } else + { + ent = loc.getWorld().spawn(loc, Skeleton.class); } ent.getEquipment().setHelmet(ItemStackFactory.Instance.CreateStack(Material.PUMPKIN)); diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/snake/SnakeSegment.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/snake/SnakeSegment.java index 3f58ac483..4366c95b1 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/snake/SnakeSegment.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/snake/SnakeSegment.java @@ -2,13 +2,6 @@ package mineplex.minecraft.game.core.boss.snake; import java.util.UUID; -import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; -import org.bukkit.entity.EntityType; -import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; - -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEnt; import net.minecraft.server.v1_8_R3.DataWatcher; import net.minecraft.server.v1_8_R3.EntityArmorStand; import net.minecraft.server.v1_8_R3.Packet; @@ -19,6 +12,14 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport; import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; import net.minecraft.server.v1_8_R3.Vector3f; +import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; +import org.bukkit.entity.EntityType; +import org.bukkit.inventory.ItemStack; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; + public class SnakeSegment { private int _entityId = UtilEnt.getNewEntityId(); @@ -107,10 +108,7 @@ public class SnakeSegment watcher.a(15, new Vector3f(0, 0, 0), EntityArmorStand.META_LEFT_LEG_POSE, new Vector3f(0, 0, 0)); watcher.a(16, new Vector3f(0, 0, 0), EntityArmorStand.META_RIGHT_LEG_POSE, new Vector3f(0, 0, 0)); - PacketPlayOutEntityMetadata meta = new PacketPlayOutEntityMetadata(); - - meta.a = getId(); - meta.b = watcher.c(); + PacketPlayOutEntityMetadata meta = new PacketPlayOutEntityMetadata(getId(), watcher, true); return new Packet[] { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java index e9dba2596..7a8bffcce 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java @@ -1,5 +1,43 @@ package nautilus.game.arcade.game.games.castlesiege; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; + +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Color; +import org.bukkit.Effect; +import org.bukkit.EntityEffect; +import org.bukkit.FireworkEffect.Type; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.entity.Creature; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.Horse; +import org.bukkit.entity.Horse.Style; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.TNTPrimed; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.HandlerList; +import org.bukkit.event.block.Action; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.ExplosionPrimeEvent; +import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; + import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; @@ -18,6 +56,7 @@ import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; + import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; @@ -38,44 +77,6 @@ import nautilus.game.arcade.stats.KingSlayerStatTracker; import nautilus.game.arcade.stats.TeamDeathsStatTracker; import nautilus.game.arcade.stats.TeamKillsStatTracker; import nautilus.game.arcade.stats.WinAsTeamStatTracker; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Color; -import org.bukkit.Effect; -import org.bukkit.EntityEffect; -import org.bukkit.FireworkEffect.Type; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.block.Block; -import org.bukkit.entity.Creature; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.FallingBlock; -import org.bukkit.entity.Horse; -import org.bukkit.entity.Horse.Style; -import org.bukkit.entity.Horse.Variant; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.entity.TNTPrimed; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.HandlerList; -import org.bukkit.event.block.Action; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.entity.EntityTargetEvent; -import org.bukkit.event.entity.ExplosionPrimeEvent; -import org.bukkit.event.entity.PlayerDeathEvent; -import org.bukkit.event.entity.ProjectileHitEvent; -import org.bukkit.event.player.PlayerEvent; -import org.bukkit.event.player.PlayerInteractEntityEvent; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; public class CastleSiege extends TeamGame { @@ -329,7 +330,6 @@ public class CastleSiege extends TeamGame horse.setAgeLock(true); horse.setColor(org.bukkit.entity.Horse.Color.BLACK); horse.setStyle(Style.BLACK_DOTS); - horse.setVariant(Variant.HORSE); horse.setMaxDomestication(1); horse.getInventory().setSaddle(new ItemStack(Material.SADDLE)); horse.getInventory().setArmor(new ItemStack(Material.IRON_BARDING)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/PumpkinKing.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/PumpkinKing.java index 1397465e1..75aca805b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/PumpkinKing.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/PumpkinKing.java @@ -2,30 +2,30 @@ package nautilus.game.arcade.game.games.christmas.content; import java.util.ArrayList; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilParticle.ParticleType; -import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.common.util.UtilTime; -import nautilus.game.arcade.game.games.christmas.ChristmasAudio; -import nautilus.game.arcade.game.games.christmas.parts.Part5; - import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; -import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.entity.TNTPrimed; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.utils.UtilVariant; + +import nautilus.game.arcade.game.games.christmas.ChristmasAudio; +import nautilus.game.arcade.game.games.christmas.parts.Part5; + public class PumpkinKing { private Part5 Host; @@ -45,12 +45,11 @@ public class PumpkinKing _grid = grid; Host.Host.CreatureAllowOverride = true; - _ent = loc.getWorld().spawn(loc, Skeleton.class); + _ent = UtilVariant.spawnWitherSkeleton(loc); Host.Host.CreatureAllowOverride = false; UtilEnt.Vegetate(_ent); UtilEnt.ghost(_ent, true, false); - _ent.setSkeletonType(SkeletonType.WITHER); _ent.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); _ent.getEquipment().setItemInHand(new ItemStack(Material.TNT)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java index 26b282b57..146402ed2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java @@ -23,6 +23,7 @@ import mineplex.core.hologram.Hologram; import mineplex.core.hologram.HologramManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.games.christmas.Christmas; import nautilus.game.arcade.game.games.christmas.ChristmasAudio; @@ -180,15 +181,14 @@ public class Part4 extends Part Location loc = UtilAlg.Random(_mobSpawns); Host.CreatureAllowOverride = true; - Zombie ent = loc.getWorld().spawn(loc, Zombie.class); + Zombie ent = UtilVariant.spawnZombieVillager(loc); Host.CreatureAllowOverride = false; ent.getEquipment().setItemInHand(new ItemStack(Material.WOOD_PICKAXE)); ent.getEquipment().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE)); ent.getEquipment().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS)); ent.getEquipment().setBoots(new ItemStack(Material.LEATHER_BOOTS)); - ent.setVillager(true); - + ent.setCustomName("Evil Elf " + UtilMath.randomElement(_evilElfNames)); ent.setHealth(9); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/data/WitherMinionManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/data/WitherMinionManager.java index ebaff1a07..acbdded52 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/data/WitherMinionManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/data/WitherMinionManager.java @@ -1,17 +1,8 @@ package nautilus.game.arcade.game.games.minecraftleague.variation.wither.data; -import mineplex.core.common.util.*; -import mineplex.core.common.util.UtilParticle.ParticleType; -import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.common.util.UtilTime.TimeUnit; -import mineplex.core.itemstack.ItemBuilder; -import mineplex.core.recharge.Recharge; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.game.Game.GameState; -import nautilus.game.arcade.game.games.minecraftleague.tracker.GrabSkullEvent; -import nautilus.game.arcade.game.games.minecraftleague.variation.wither.WitherVariation; +import java.util.List; +import java.util.Random; + import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.FireworkEffect.Type; @@ -19,8 +10,10 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSkeleton; -import org.bukkit.entity.*; +import org.bukkit.entity.Player; +import org.bukkit.entity.Skeleton; import org.bukkit.entity.Skeleton.SkeletonType; +import org.bukkit.entity.Wither; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -37,8 +30,31 @@ import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; -import java.util.List; -import java.util.Random; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilItem; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTextMiddle; +import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.UtilTime.TimeUnit; +import mineplex.core.itemstack.ItemBuilder; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; + +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game.GameState; +import nautilus.game.arcade.game.games.minecraftleague.tracker.GrabSkullEvent; +import nautilus.game.arcade.game.games.minecraftleague.variation.wither.WitherVariation; public class WitherMinionManager implements Listener { @@ -105,9 +121,8 @@ public class WitherMinionManager implements Listener else chosen = _spawns.get(_lastUsed); _host.Host.CreatureAllowOverride = true; - Entity e = _host.Manager.GetCreature().SpawnEntity(chosen, EntityType.SKELETON); _host.Host.CreatureAllowOverride = false; - ((Skeleton)e).setSkeletonType(SkeletonType.WITHER); + Skeleton e = UtilVariant.spawnWitherSkeleton(chosen); _entity = (Skeleton)e; UtilEnt.ghost(e, true, false); UtilEnt.Vegetate(e); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitSkeletalHorse.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitSkeletalHorse.java index 6bcd59057..0872b37ce 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitSkeletalHorse.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitSkeletalHorse.java @@ -14,6 +14,8 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.UtilInv; import mineplex.core.disguise.disguises.DisguiseHorse; import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.utils.UtilVariant; + import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.games.smash.perks.PerkSmashStats; @@ -110,10 +112,8 @@ public class KitSkeletalHorse extends SmashKit @Override public Entity SpawnEntity(Location loc) { - Horse horse = (Horse) super.SpawnEntity(loc); - - horse.setVariant(Variant.SKELETON_HORSE); - + Horse horse = UtilVariant.spawnHorse(loc, Variant.SKELETON_HORSE); + return horse; } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witherskeleton/PerkWitherImage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witherskeleton/PerkWitherImage.java index bdc668038..348241aab 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witherskeleton/PerkWitherImage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witherskeleton/PerkWitherImage.java @@ -11,7 +11,6 @@ import org.bukkit.Sound; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; -import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityTargetEvent; @@ -29,7 +28,9 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; import mineplex.minecraft.game.core.damage.CustomDamageEvent; + import nautilus.game.arcade.game.games.smash.perks.SmashPerk; public class PerkWitherImage extends SmashPerk @@ -91,10 +92,9 @@ public class PerkWitherImage extends SmashPerk // Spawn Manager.GetGame().CreatureAllowOverride = true; - Skeleton skel = player.getWorld().spawn(player.getEyeLocation().add(player.getLocation().getDirection()), Skeleton.class); Manager.GetGame().CreatureAllowOverride = false; - skel.setSkeletonType(SkeletonType.WITHER); + Skeleton skel = UtilVariant.spawnWitherSkeleton(player.getEyeLocation().add(player.getLocation().getDirection())); skel.getEquipment().setItemInHand(player.getItemInHand()); skel.setMaxHealth(20); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java index 22eb53950..051a3e8d1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java @@ -1,16 +1,8 @@ package nautilus.game.arcade.kit.perks; -import mineplex.core.common.Rank; -import mineplex.core.common.util.*; -import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier; -import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.game.Game; -import nautilus.game.arcade.kit.Perk; +import java.util.HashMap; +import java.util.Iterator; + import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Entity; @@ -25,8 +17,25 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.inventory.ItemStack; -import java.util.HashMap; -import java.util.Iterator; +import mineplex.core.common.Rank; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; + +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game; +import nautilus.game.arcade.kit.Perk; public class PerkHorsePet extends Perk { @@ -53,39 +62,40 @@ public class PerkHorsePet extends Perk return; Manager.GetGame().CreatureAllowOverride = true; - Horse horse = player.getWorld().spawn(player.getLocation(), Horse.class); Manager.GetGame().CreatureAllowOverride = false; - horse.setAdult(); - horse.setAgeLock(true); - horse.setColor(Color.BROWN); - horse.setStyle(Style.NONE); KitModifier kitModifier = getHorseType(player); + final Horse.Variant variant; if (kitModifier != null) { switch (getHorseType(player)) { case Survival_Games_Horseman_Mule: - horse.setVariant(Variant.MULE); + variant = Variant.MULE; break; case Survival_Games_Horseman_Skeleton_Horse: - horse.setVariant(Variant.SKELETON_HORSE); + variant = Variant.SKELETON_HORSE; break; case Survival_Games_Horseman_Zombie_Horse: - horse.setVariant(Variant.UNDEAD_HORSE); + variant = Variant.UNDEAD_HORSE; break; case Survival_Games_Horseman_Donkey: - horse.setVariant(Variant.DONKEY); + variant = Variant.DONKEY; break; default: - horse.setVariant(Variant.HORSE); + variant = Variant.HORSE; break; } } else { - horse.setVariant(Variant.HORSE); + variant = Variant.HORSE; } + Horse horse = UtilVariant.spawnHorse(player.getLocation(), variant); + horse.setAdult(); + horse.setAgeLock(true); + horse.setColor(Color.BROWN); + horse.setStyle(Style.NONE); horse.setOwner(player); horse.setMaxDomestication(1); horse.setJumpStrength(1); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java index 4e7075481..af6651b66 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java @@ -1,18 +1,13 @@ package nautilus.game.arcade.kit.perks; -import mineplex.core.common.Rank; -import mineplex.core.common.util.*; -import mineplex.core.disguise.disguises.DisguiseZombie; -import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier; -import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.kit.Perk; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + import net.minecraft.server.v1_8_R3.EntityCreature; import net.minecraft.server.v1_8_R3.NavigationAbstract; + import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -30,10 +25,23 @@ import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerEvent; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; +import mineplex.core.common.Rank; +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.disguise.disguises.DisguiseZombie; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; +import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; + +import nautilus.game.arcade.kit.Perk; public class PerkSkeletons extends Perk { @@ -100,9 +108,47 @@ public class PerkSkeletons extends Perk Player killed = (Player) event.GetEvent().getEntity(); Manager.GetGame().CreatureAllowOverride = true; - Skeleton skel = killer.getWorld().spawn(killed.getLocation(), Skeleton.class); Manager.GetGame().CreatureAllowOverride = false; + + KitModifier kitModifier = getSkeletonType(killer); + final Skeleton.SkeletonType type; + if (kitModifier != null) + { + switch (kitModifier) + { + case Survival_Games_Necromancer_Wither_Skeleton: + type = Skeleton.SkeletonType.WITHER; + break; + case Survival_Games_Necromancer_Zombie: + type = Skeleton.SkeletonType.NORMAL; + break; + default: + type = Skeleton.SkeletonType.NORMAL; + break; + } + } + else + { + type = Skeleton.SkeletonType.NORMAL; + } + + final Skeleton skel; + if (type == Skeleton.SkeletonType.NORMAL) + { + skel = killer.getWorld().spawn(killed.getLocation(), Skeleton.class); + + } else + { + skel = UtilVariant.spawnWitherSkeleton(killed.getLocation()); + } + + if (kitModifier != null && kitModifier == KitModifier.Survival_Games_Necromancer_Zombie) + { + DisguiseZombie disguiseZombie = new DisguiseZombie(skel); + Manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseZombie); + } + UtilEnt.removeGoalSelectors(skel); skel.setMaxHealth(30); @@ -126,29 +172,6 @@ public class PerkSkeletons extends Perk skel.getEquipment().setLeggingsDropChance(1f); skel.getEquipment().setBootsDropChance(1f); - KitModifier kitModifier = getSkeletonType(killer); - if (kitModifier != null) - { - switch (kitModifier) - { - case Survival_Games_Necromancer_Wither_Skeleton: - skel.setSkeletonType(Skeleton.SkeletonType.WITHER); - break; - case Survival_Games_Necromancer_Zombie: - skel.setSkeletonType(Skeleton.SkeletonType.NORMAL); - DisguiseZombie disguiseZombie = new DisguiseZombie(skel); - Manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseZombie); - break; - default: - skel.setSkeletonType(Skeleton.SkeletonType.NORMAL); - break; - } - } - else - { - skel.setSkeletonType(Skeleton.SkeletonType.NORMAL); - } - if (_name) { skel.setCustomName("Skeletal " + UtilEnt.getName(event.GetEvent().getEntity())); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java index 4914d7264..065bfb462 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java @@ -1,8 +1,43 @@ package nautilus.game.arcade.kit.perks; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; + +import net.minecraft.server.v1_8_R3.EntityCreature; +import net.minecraft.server.v1_8_R3.NavigationAbstract; + +import org.bukkit.DyeColor; +import org.bukkit.EntityEffect; +import org.bukkit.Location; +import org.bukkit.Sound; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWolf; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.Wolf; +import org.bukkit.event.EventHandler; +import org.bukkit.event.block.Action; +import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerQuitEvent; + import mineplex.core.common.Rank; -import mineplex.core.common.util.*; -import mineplex.core.disguise.disguises.DisguiseAnimalBase; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.SpigotUtil; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.disguises.DisguiseGuardian; import mineplex.core.disguise.disguises.DisguiseSquid; import mineplex.core.gadget.GadgetManager; @@ -12,28 +47,8 @@ import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.kit.Perk; -import net.minecraft.server.v1_8_R3.EntityCreature; -import net.minecraft.server.v1_8_R3.NavigationAbstract; -import org.bukkit.DyeColor; -import org.bukkit.EntityEffect; -import org.bukkit.Location; -import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWolf; -import org.bukkit.entity.*; -import org.bukkit.event.EventHandler; -import org.bukkit.event.block.Action; -import org.bukkit.event.entity.EntityTargetEvent; -import org.bukkit.event.entity.PlayerDeathEvent; -import org.bukkit.event.player.PlayerCommandPreprocessEvent; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.event.player.PlayerQuitEvent; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; +import nautilus.game.arcade.kit.Perk; public class PerkWolfPet extends Perk { @@ -382,8 +397,8 @@ public class PerkWolfPet extends Perk Manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseSquid); return; } - DisguiseAnimalBase disguiseAnimal = new DisguiseAnimalBase(entityType, wolf); - Manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseAnimal); + /*DisguiseAnimalBase disguiseAnimal = new DisguiseAnimalBase(entityType, wolf); // TODO: what does this even do? + Manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseAnimal);*/ } }