From 7dcf22262abef77aef9d6ad253be1c5e2c9712a4 Mon Sep 17 00:00:00 2001 From: Wesley Wolfe Date: Fri, 15 Mar 2013 22:19:58 -0500 Subject: Moved all specific minecart entities to sub-package. This change is breaking for the new API for 1.5, including the interfaces for the three new Minecart types and the name of the previously TNT_MINECART material. This change also deprecates the two previous specific minecart types located in the org.bukkit.entity package. This deprecation is not a breaking change and will still be internally supported. Each minecart type has new javadoc to be slightly more descriptive. Included with this are specific references to the interface for each respective EntityType entry. Another package-info.java file has been included as well. All specific minecart types extend minecart, each with a more descriptive name. The naming will also follow the old convention. In addition, the minecart with no specific designation is now more closely referred to as a rideable minecart. --- src/main/java/org/bukkit/Material.java | 2 +- src/main/java/org/bukkit/entity/EntityType.java | 31 ++++++++++++++++++---- .../java/org/bukkit/entity/MinecartHopper.java | 7 ----- .../java/org/bukkit/entity/MinecartMobSpawner.java | 7 ----- src/main/java/org/bukkit/entity/MinecartTNT.java | 7 ----- .../java/org/bukkit/entity/PoweredMinecart.java | 7 +++-- .../java/org/bukkit/entity/StorageMinecart.java | 9 ++++--- .../bukkit/entity/minecart/ExplosiveMinecart.java | 9 +++++++ .../org/bukkit/entity/minecart/HopperMinecart.java | 9 +++++++ .../bukkit/entity/minecart/PoweredMinecart.java | 10 +++++++ .../bukkit/entity/minecart/RideableMinecart.java | 14 ++++++++++ .../bukkit/entity/minecart/SpawnerMinecart.java | 10 +++++++ .../bukkit/entity/minecart/StorageMinecart.java | 12 +++++++++ .../org/bukkit/entity/minecart/package-info.java | 6 +++++ 14 files changed, 107 insertions(+), 33 deletions(-) delete mode 100644 src/main/java/org/bukkit/entity/MinecartHopper.java delete mode 100644 src/main/java/org/bukkit/entity/MinecartMobSpawner.java delete mode 100644 src/main/java/org/bukkit/entity/MinecartTNT.java create mode 100644 src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java create mode 100644 src/main/java/org/bukkit/entity/minecart/HopperMinecart.java create mode 100644 src/main/java/org/bukkit/entity/minecart/PoweredMinecart.java create mode 100644 src/main/java/org/bukkit/entity/minecart/RideableMinecart.java create mode 100644 src/main/java/org/bukkit/entity/minecart/SpawnerMinecart.java create mode 100644 src/main/java/org/bukkit/entity/minecart/StorageMinecart.java create mode 100644 src/main/javadoc/org/bukkit/entity/minecart/package-info.java diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index 425bc5dc..92a33952 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -378,7 +378,7 @@ public enum Material { REDSTONE_COMPARATOR(404), NETHER_BRICK_ITEM(405), QUARTZ(406), - TNT_MINECART(407, 1), + EXPLOSIVE_MINECART(407, 1), HOPPER_MINECART(408, 1), GOLD_RECORD(2256, 1), GREEN_RECORD(2257, 1), diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java index 5b54bfa3..2a115bfc 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java @@ -3,6 +3,12 @@ package org.bukkit.entity; import java.util.HashMap; import java.util.Map; +import org.bukkit.entity.minecart.HopperMinecart; +import org.bukkit.entity.minecart.SpawnerMinecart; +import org.bukkit.entity.minecart.RideableMinecart; +import org.bukkit.entity.minecart.ExplosiveMinecart; +import org.bukkit.entity.minecart.PoweredMinecart; +import org.bukkit.entity.minecart.StorageMinecart; import org.bukkit.inventory.ItemStack; import org.bukkit.Location; import org.bukkit.World; @@ -74,14 +80,29 @@ public enum EntityType { */ BOAT("Boat", Boat.class, 41), /** - * A minecart entities can ride + * @see RideableMinecart + */ + MINECART("MinecartRideable", RideableMinecart.class, 42), + /** + * @see StorageMinecart */ - MINECART("MinecartRideable", Minecart.class, 42), MINECART_CHEST("MinecartChest", StorageMinecart.class, 43), + /** + * @see PoweredMinecart + */ MINECART_FURNACE("MinecartFurnace", PoweredMinecart.class, 44), - MINECART_TNT("MinecartTNT", MinecartTNT.class, 45), - MINECART_HOPPER("MinecartHopper", MinecartHopper.class, 46), - MINECART_MOB_SPAWNER("MinecartMobSpawner", MinecartMobSpawner.class, 47), + /** + * @see ExplosiveMinecart + */ + MINECART_TNT("MinecartTNT", ExplosiveMinecart.class, 45), + /** + * @see HopperMinecart + */ + MINECART_HOPPER("MinecartHopper", HopperMinecart.class, 46), + /** + * @see SpawnerMinecart + */ + MINECART_MOB_SPAWNER("MinecartMobSpawner", SpawnerMinecart.class, 47), CREEPER("Creeper", Creeper.class, 50), SKELETON("Skeleton", Skeleton.class, 51), SPIDER("Spider", Spider.class, 52), diff --git a/src/main/java/org/bukkit/entity/MinecartHopper.java b/src/main/java/org/bukkit/entity/MinecartHopper.java deleted file mode 100644 index 6781afbc..00000000 --- a/src/main/java/org/bukkit/entity/MinecartHopper.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.bukkit.entity; - -/** - * Represents a Minecart with a Hopper inside it - */ -public interface MinecartHopper extends Minecart { -} diff --git a/src/main/java/org/bukkit/entity/MinecartMobSpawner.java b/src/main/java/org/bukkit/entity/MinecartMobSpawner.java deleted file mode 100644 index 4154ab27..00000000 --- a/src/main/java/org/bukkit/entity/MinecartMobSpawner.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.bukkit.entity; - -/** - * Represents a Minecart with a Mob Spawner inside it. - */ -public interface MinecartMobSpawner extends Minecart { -} diff --git a/src/main/java/org/bukkit/entity/MinecartTNT.java b/src/main/java/org/bukkit/entity/MinecartTNT.java deleted file mode 100644 index cf2b8475..00000000 --- a/src/main/java/org/bukkit/entity/MinecartTNT.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.bukkit.entity; - -/** - * Represents a Minecart with TNT inside it. - */ -public interface MinecartTNT extends Minecart { -} diff --git a/src/main/java/org/bukkit/entity/PoweredMinecart.java b/src/main/java/org/bukkit/entity/PoweredMinecart.java index d449939c..38240a90 100644 --- a/src/main/java/org/bukkit/entity/PoweredMinecart.java +++ b/src/main/java/org/bukkit/entity/PoweredMinecart.java @@ -1,6 +1,9 @@ package org.bukkit.entity; /** - * Represents a powered minecart. + * @deprecated This class has been moved into a sub package; {@link + * org.bukkit.entity.minecart.PoweredMinecart} should be used instead. + * @see org.bukkit.entity.minecart.PoweredMinecart */ -public interface PoweredMinecart extends Minecart {} +@Deprecated +public interface PoweredMinecart extends org.bukkit.entity.minecart.PoweredMinecart {} diff --git a/src/main/java/org/bukkit/entity/StorageMinecart.java b/src/main/java/org/bukkit/entity/StorageMinecart.java index c3fc263e..5436d708 100644 --- a/src/main/java/org/bukkit/entity/StorageMinecart.java +++ b/src/main/java/org/bukkit/entity/StorageMinecart.java @@ -1,8 +1,9 @@ package org.bukkit.entity; -import org.bukkit.inventory.InventoryHolder; - /** - * Represents a storage minecart. + * @deprecated This class has been moved into a sub package; {@link + * org.bukkit.entity.minecart.StorageMinecart} should be used instead. + * @see org.bukkit.entity.minecart.StorageMinecart */ -public interface StorageMinecart extends Minecart, InventoryHolder {} +@Deprecated +public interface StorageMinecart extends org.bukkit.entity.minecart.StorageMinecart {} diff --git a/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java b/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java new file mode 100644 index 00000000..a4411dac --- /dev/null +++ b/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java @@ -0,0 +1,9 @@ +package org.bukkit.entity.minecart; + +import org.bukkit.entity.Minecart; + +/** + * Represents a Minecart with TNT inside it that can explode when triggered. + */ +public interface ExplosiveMinecart extends Minecart { +} diff --git a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java new file mode 100644 index 00000000..14a26d62 --- /dev/null +++ b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java @@ -0,0 +1,9 @@ +package org.bukkit.entity.minecart; + +import org.bukkit.entity.Minecart; + +/** + * Represents a Minecart with a Hopper inside it + */ +public interface HopperMinecart extends Minecart { +} diff --git a/src/main/java/org/bukkit/entity/minecart/PoweredMinecart.java b/src/main/java/org/bukkit/entity/minecart/PoweredMinecart.java new file mode 100644 index 00000000..57e8b1d5 --- /dev/null +++ b/src/main/java/org/bukkit/entity/minecart/PoweredMinecart.java @@ -0,0 +1,10 @@ +package org.bukkit.entity.minecart; + +import org.bukkit.entity.Minecart; + +/** + * Represents a powered minecart. A powered minecart moves on its own when a + * player deposits {@link org.bukkit.Material#COAL fuel}. + */ +public interface PoweredMinecart extends Minecart { +} diff --git a/src/main/java/org/bukkit/entity/minecart/RideableMinecart.java b/src/main/java/org/bukkit/entity/minecart/RideableMinecart.java new file mode 100644 index 00000000..1b826457 --- /dev/null +++ b/src/main/java/org/bukkit/entity/minecart/RideableMinecart.java @@ -0,0 +1,14 @@ +package org.bukkit.entity.minecart; + +import org.bukkit.entity.Minecart; + +/** + * Represents a minecart that can have certain {@link + * org.bukkit.entity.Entity entities} as passengers. Normal passengers + * include all {@link org.bukkit.entity.LivingEntity living entities} with + * the exception of {@link org.bukkit.entity.IronGolem iron golems}. + * Non-player entities that meet normal passenger criteria automatically + * mount these minecarts when close enough. + */ +public interface RideableMinecart extends Minecart { +} diff --git a/src/main/java/org/bukkit/entity/minecart/SpawnerMinecart.java b/src/main/java/org/bukkit/entity/minecart/SpawnerMinecart.java new file mode 100644 index 00000000..0ce3592e --- /dev/null +++ b/src/main/java/org/bukkit/entity/minecart/SpawnerMinecart.java @@ -0,0 +1,10 @@ +package org.bukkit.entity.minecart; + +import org.bukkit.entity.Minecart; + +/** + * Represents a Minecart with an {@link org.bukkit.block.CreatureSpawner + * entity spawner} inside it. + */ +public interface SpawnerMinecart extends Minecart { +} diff --git a/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java new file mode 100644 index 00000000..4f04ab40 --- /dev/null +++ b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java @@ -0,0 +1,12 @@ +package org.bukkit.entity.minecart; + +import org.bukkit.entity.Minecart; +import org.bukkit.inventory.InventoryHolder; + +/** + * Represents a minecart with a chest. These types of {@link Minecart + * minecarts} have their own inventory that can be accessed using methods + * from the {@link InventoryHolder} interface. + */ +public interface StorageMinecart extends Minecart, InventoryHolder { +} diff --git a/src/main/javadoc/org/bukkit/entity/minecart/package-info.java b/src/main/javadoc/org/bukkit/entity/minecart/package-info.java new file mode 100644 index 00000000..9988caaf --- /dev/null +++ b/src/main/javadoc/org/bukkit/entity/minecart/package-info.java @@ -0,0 +1,6 @@ +/** + * Interfaces for various {@link org.bukkit.entity.Minecart} types. + *

+ */ +package org.bukkit.entity.minecart; + -- cgit v1.2.3