diff options
author | BlackHole <black-hole@live.com> | 2016-03-01 08:30:02 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-01 08:30:02 +1100 |
commit | 6dd5aa2ce1e9195fda5720a9caff48f15ecf6335 (patch) | |
tree | 723ab41544f5e4672a52dc9f0f91545e8afc6e9b /src | |
parent | ff2d64d2b948c960828f056b51c8a7ef33e491ff (diff) | |
download | bukkit-6dd5aa2ce1e9195fda5720a9caff48f15ecf6335.tar bukkit-6dd5aa2ce1e9195fda5720a9caff48f15ecf6335.tar.gz bukkit-6dd5aa2ce1e9195fda5720a9caff48f15ecf6335.tar.lz bukkit-6dd5aa2ce1e9195fda5720a9caff48f15ecf6335.tar.xz bukkit-6dd5aa2ce1e9195fda5720a9caff48f15ecf6335.zip |
Remove EntityType and some deprecated Entity methods
Replaced by EntityType / other methods since February 2012 and April 2012 respectively.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/World.java | 24 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/CreatureSpawner.java | 37 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/CreatureType.java | 108 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/LivingEntity.java | 27 | ||||
-rw-r--r-- | src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java | 19 | ||||
-rw-r--r-- | src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java | 28 |
6 files changed, 0 insertions, 243 deletions
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 127ad9d3..6eb1c0fe 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -348,30 +348,6 @@ public interface World extends PluginMessageRecipient, Metadatable { public Entity spawnEntity(Location loc, EntityType type); /** - * Creates a creature at the given {@link Location} - * - * @param loc The location to spawn the creature - * @param type The creature to spawn - * @return Resulting LivingEntity of this method, or null if it was - * unsuccessful - * @deprecated Has issues spawning non LivingEntities. Use {@link - * #spawnEntity(Location, EntityType) spawnEntity} instead. - */ - @Deprecated - public LivingEntity spawnCreature(Location loc, EntityType type); - - /** - * Creates a creature at the given {@link Location} - * - * @param loc The location to spawn the creature - * @param type The creature to spawn - * @return Resulting LivingEntity of this method, or null if it was - * unsuccessful - */ - @Deprecated - public LivingEntity spawnCreature(Location loc, CreatureType type); - - /** * Strikes lightning at the given {@link Location} * * @param loc The location to strike lightning diff --git a/src/main/java/org/bukkit/block/CreatureSpawner.java b/src/main/java/org/bukkit/block/CreatureSpawner.java index e54d9972..cf4fb717 100644 --- a/src/main/java/org/bukkit/block/CreatureSpawner.java +++ b/src/main/java/org/bukkit/block/CreatureSpawner.java @@ -1,6 +1,5 @@ package org.bukkit.block; -import org.bukkit.entity.CreatureType; import org.bukkit.entity.EntityType; /** @@ -12,15 +11,6 @@ public interface CreatureSpawner extends BlockState { * Get the spawner's creature type. * * @return The creature type. - * @deprecated In favour of {@link #getSpawnedType()}. - */ - @Deprecated - public CreatureType getCreatureType(); - - /** - * Get the spawner's creature type. - * - * @return The creature type. */ public EntityType getSpawnedType(); @@ -32,24 +22,6 @@ public interface CreatureSpawner extends BlockState { public void setSpawnedType(EntityType creatureType); /** - * Set the spawner creature type. - * - * @param creatureType The creature type. - * @deprecated In favour of {@link #setSpawnedType(EntityType)}. - */ - @Deprecated - public void setCreatureType(CreatureType creatureType); - - /** - * Get the spawner's creature type. - * - * @return The creature type's name. - * @deprecated Use {@link #getCreatureTypeName()}. - */ - @Deprecated - public String getCreatureTypeId(); - - /** * Set the spawner mob type. * * @param creatureType The creature type's name. @@ -64,15 +36,6 @@ public interface CreatureSpawner extends BlockState { public String getCreatureTypeName(); /** - * Set the spawner mob type. - * - * @param creatureType The creature type's name. - * @deprecated Use {@link #setCreatureTypeByName(String)}. - */ - @Deprecated - public void setCreatureTypeId(String creatureType); - - /** * Get the spawner's delay. * * @return The delay. diff --git a/src/main/java/org/bukkit/entity/CreatureType.java b/src/main/java/org/bukkit/entity/CreatureType.java deleted file mode 100644 index 127d4756..00000000 --- a/src/main/java/org/bukkit/entity/CreatureType.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.bukkit.entity; - -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Map; - -/** - * Represents a type of creature. - * - * @deprecated Use EntityType instead. - */ -@Deprecated -public enum CreatureType { - // These strings MUST match the strings in nms.EntityTypes and are case sensitive. - CREEPER("Creeper", Creeper.class, 50), - SKELETON("Skeleton", Skeleton.class, 51), - SPIDER("Spider", Spider.class, 52), - GIANT("Giant", Giant.class, 53), - ZOMBIE("Zombie", Zombie.class, 54), - SLIME("Slime", Slime.class, 55), - GHAST("Ghast", Ghast.class, 56), - PIG_ZOMBIE("PigZombie", PigZombie.class, 57), - ENDERMAN("Enderman", Enderman.class, 58), - CAVE_SPIDER("CaveSpider", CaveSpider.class, 59), - SILVERFISH("Silverfish", Silverfish.class, 60), - BLAZE("Blaze", Blaze.class, 61), - MAGMA_CUBE("LavaSlime", MagmaCube.class, 62), - ENDER_DRAGON("EnderDragon", EnderDragon.class, 63), - ENDERMITE("Endermite", Endermite.class, 67), - GUARDIAN("Guardian", Guardian.class, 68), - PIG("Pig", Pig.class, 90), - SHEEP("Sheep", Sheep.class, 91), - COW("Cow", Cow.class, 92), - CHICKEN("Chicken", Chicken.class, 93), - SQUID("Squid", Squid.class, 94), - WOLF("Wolf", Wolf.class, 95), - MUSHROOM_COW("MushroomCow", MushroomCow.class, 96), - SNOWMAN("SnowMan", Snowman.class, 97), - RABBIT("Rabbit", Rabbit.class, 101), - VILLAGER("Villager", Villager.class, 120); - - private String name; - private Class<? extends Entity> clazz; - private short typeId; - - private static final Map<String, CreatureType> NAME_MAP = new HashMap<String, CreatureType>(); - private static final Map<Short, CreatureType> ID_MAP = new HashMap<Short, CreatureType>(); - - static { - for (CreatureType type : EnumSet.allOf(CreatureType.class)) { - NAME_MAP.put(type.name, type); - if (type.typeId != 0) { - ID_MAP.put(type.typeId, type); - } - } - } - - private CreatureType(String name, Class<? extends Entity> clazz, int typeId) { - this.name = name; - this.clazz = clazz; - this.typeId = (short) typeId; - } - - public String getName() { - return name; - } - - public Class<? extends Entity> getEntityClass() { - return clazz; - } - - /** - * - * @return the raw type id - * @deprecated Magic value - */ - @Deprecated - public short getTypeId() { - return typeId; - } - - public static CreatureType fromName(String name) { - return NAME_MAP.get(name); - } - - /** - * - * @param id the raw type id - * @return the matching CreatureType or null - * @deprecated Magic value - */ - @Deprecated - public static CreatureType fromId(int id) { - if (id > Short.MAX_VALUE) { - return null; - } - return ID_MAP.get((short) id); - } - - @Deprecated - public EntityType toEntityType() { - return EntityType.fromName(getName()); - } - - public static CreatureType fromEntityType(EntityType creatureType) { - return fromName(creatureType.getName()); - } -}
\ No newline at end of file diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java index 48e25089..5d35bfcb 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -128,33 +128,6 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance); /** - * Throws an egg from the living entity. - * - * @deprecated use launchProjectile(Egg.class) instead - * @return the egg thrown - */ - @Deprecated - public Egg throwEgg(); - - /** - * Throws a snowball from the living entity. - * - * @deprecated use launchProjectile(Snowball.class) instead - * @return the snowball thrown - */ - @Deprecated - public Snowball throwSnowball(); - - /** - * Shoots an arrow from the living entity. - * - * @deprecated use launchProjectile(Arrow.class) instead - * @return the arrow shot - */ - @Deprecated - public Arrow shootArrow(); - - /** * Returns the amount of air that the living entity has remaining, in * ticks. * diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java index 288e98bd..c035b37b 100644 --- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java @@ -1,7 +1,6 @@ package org.bukkit.event.entity; import org.bukkit.Location; -import org.bukkit.entity.CreatureType; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Cancellable; @@ -22,12 +21,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { this.spawnReason = spawnReason; } - @Deprecated - public CreatureSpawnEvent(Entity spawnee, CreatureType type, Location loc, SpawnReason reason) { - super(spawnee); - spawnReason = reason; - } - public boolean isCancelled() { return canceled; } @@ -51,18 +44,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { } /** - * Gets the type of creature being spawned. - * - * @return A CreatureType value detailing the type of creature being - * spawned - * @deprecated In favour of {@link #getEntityType()}. - */ - @Deprecated - public CreatureType getCreatureType() { - return CreatureType.fromEntityType(getEntityType()); - } - - /** * Gets the reason for why the creature is being spawned. * * @return A SpawnReason value detailing the reason for the creature being diff --git a/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java b/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java index 896347e6..4b5075b0 100644 --- a/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java @@ -1,6 +1,5 @@ package org.bukkit.event.player; -import org.bukkit.entity.CreatureType; import org.bukkit.entity.Egg; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -24,11 +23,6 @@ public class PlayerEggThrowEvent extends PlayerEvent { this.hatchType = hatchingType; } - @Deprecated - public PlayerEggThrowEvent(Player player, Egg egg, boolean hatching, byte numHatches, CreatureType hatchingType) { - this(player, egg, hatching, numHatches, hatchingType.toEntityType()); - } - /** * Gets the egg involved in this event. * @@ -62,17 +56,6 @@ public class PlayerEggThrowEvent extends PlayerEvent { * Get the type of the mob being hatched (EntityType.CHICKEN by default) * * @return The type of the mob being hatched by the egg - * @deprecated In favour of {@link #getHatchingType()}. - */ - @Deprecated - public CreatureType getHatchType() { - return CreatureType.fromEntityType(hatchType); - } - - /** - * Get the type of the mob being hatched (EntityType.CHICKEN by default) - * - * @return The type of the mob being hatched by the egg */ public EntityType getHatchingType() { return hatchType; @@ -82,17 +65,6 @@ public class PlayerEggThrowEvent extends PlayerEvent { * Change the type of mob being hatched by the egg * * @param hatchType The type of the mob being hatched by the egg - * @deprecated In favour of {@link #setHatchingType(EntityType)}. - */ - @Deprecated - public void setHatchType(CreatureType hatchType) { - this.hatchType = hatchType.toEntityType(); - } - - /** - * Change the type of mob being hatched by the egg - * - * @param hatchType The type of the mob being hatched by the egg */ public void setHatchingType(EntityType hatchType) { if(!hatchType.isSpawnable()) throw new IllegalArgumentException("Can't spawn that entity type from an egg!"); |