diff options
Diffstat (limited to 'src/main/java/org/bukkit/entity')
-rw-r--r-- | src/main/java/org/bukkit/entity/Cod.java | 7 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Dolphin.java | 3 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Drowned.java | 6 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Enderman.java | 19 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/EntityType.java | 39 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/FallingBlock.java | 15 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Fish.java | 6 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Minecart.java | 17 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Phantom.java | 17 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Player.java | 24 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/PufferFish.java | 21 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Salmon.java | 7 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Trident.java | 6 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/TropicalFish.java | 72 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/Turtle.java | 6 |
15 files changed, 220 insertions, 45 deletions
diff --git a/src/main/java/org/bukkit/entity/Cod.java b/src/main/java/org/bukkit/entity/Cod.java new file mode 100644 index 00000000..191ce6c0 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Cod.java @@ -0,0 +1,7 @@ + +package org.bukkit.entity; + +/** + * Represents a cod fish. + */ +public interface Cod extends Fish { } diff --git a/src/main/java/org/bukkit/entity/Dolphin.java b/src/main/java/org/bukkit/entity/Dolphin.java new file mode 100644 index 00000000..3d6b9f32 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Dolphin.java @@ -0,0 +1,3 @@ +package org.bukkit.entity; + +public interface Dolphin extends Creature { } diff --git a/src/main/java/org/bukkit/entity/Drowned.java b/src/main/java/org/bukkit/entity/Drowned.java new file mode 100644 index 00000000..1dee177a --- /dev/null +++ b/src/main/java/org/bukkit/entity/Drowned.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Drowned zombie. + */ +public interface Drowned extends Zombie { } diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java index f537f697..ab827f83 100644 --- a/src/main/java/org/bukkit/entity/Enderman.java +++ b/src/main/java/org/bukkit/entity/Enderman.java @@ -1,5 +1,6 @@ package org.bukkit.entity; +import org.bukkit.block.data.BlockData; import org.bukkit.material.MaterialData; /** @@ -8,16 +9,30 @@ import org.bukkit.material.MaterialData; public interface Enderman extends Monster { /** - * Get the id and data of the block that the Enderman is carrying. + * Gets the id and data of the block that the Enderman is carrying. * * @return MaterialData containing the id and data of the block */ public MaterialData getCarriedMaterial(); /** - * Set the id and data of the block that the Enderman is carrying. + * Sets the id and data of the block that the Enderman is carrying. * * @param material data to set the carried block to */ public void setCarriedMaterial(MaterialData material); + + /** + * Gets the data of the block that the Enderman is carrying. + * + * @return BlockData containing the carried block + */ + public BlockData getCarriedBlock(); + + /** + * Sets the data of the block that the Enderman is carrying. + * + * @param blockData data to set the carried block to + */ + public void setCarriedBlock(BlockData blockData); } diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java index 588e6048..636bae8b 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java @@ -28,7 +28,7 @@ public enum EntityType { /** * An experience orb. */ - EXPERIENCE_ORB("xp_orb", ExperienceOrb.class, 2), + EXPERIENCE_ORB("experience_orb", ExperienceOrb.class, 2), /** * @see AreaEffectCloud */ @@ -80,7 +80,7 @@ public enum EntityType { /** * An ender eye signal. */ - ENDER_SIGNAL("eye_of_ender_signal", EnderSignal.class, 15), + ENDER_SIGNAL("eye_of_ender", EnderSignal.class, 15), /** * A flying splash potion. */ @@ -88,7 +88,7 @@ public enum EntityType { /** * A flying experience bottle. */ - THROWN_EXP_BOTTLE("xp_bottle", ThrownExpBottle.class, 17), + THROWN_EXP_BOTTLE("experience_bottle", ThrownExpBottle.class, 17), /** * An item frame on a wall. */ @@ -108,7 +108,7 @@ public enum EntityType { /** * Internal representation of a Firework once it has been launched. */ - FIREWORK("fireworks_rocket", Firework.class, 22, false), + FIREWORK("firework_rocket", Firework.class, 22, false), /** * @see Husk */ @@ -152,11 +152,11 @@ public enum EntityType { /** * @see EvokerFangs */ - EVOKER_FANGS("evocation_fangs", EvokerFangs.class, 33), + EVOKER_FANGS("evoker_fangs", EvokerFangs.class, 33), /** * @see Evoker */ - EVOKER("evocation_illager", Evoker.class, 34), + EVOKER("evoker", Evoker.class, 34), /** * @see Vex */ @@ -164,15 +164,15 @@ public enum EntityType { /** * @see Vindicator */ - VINDICATOR("vindication_illager", Vindicator.class, 36), + VINDICATOR("vindicator", Vindicator.class, 36), /** * @see Illusioner */ - ILLUSIONER("illusion_illager", Illusioner.class, 37), + ILLUSIONER("illusioner", Illusioner.class, 37), /** * @see CommandMinecart */ - MINECART_COMMAND("commandblock_minecart", CommandMinecart.class, 40), + MINECART_COMMAND("command_block_minecart", CommandMinecart.class, 40), /** * A placed boat. */ @@ -228,9 +228,9 @@ public enum EntityType { SQUID("squid", Squid.class, 94), WOLF("wolf", Wolf.class, 95), MUSHROOM_COW("mooshroom", MushroomCow.class, 96), - SNOWMAN("snowman", Snowman.class, 97), + SNOWMAN("snow_golem", Snowman.class, 97), OCELOT("ocelot", Ocelot.class, 98), - IRON_GOLEM("villager_golem", IronGolem.class, 99), + IRON_GOLEM("iron_golem", IronGolem.class, 99), HORSE("horse", Horse.class, 100), RABBIT("rabbit", Rabbit.class, 101), POLAR_BEAR("polar_bear", PolarBear.class, 102), @@ -238,7 +238,16 @@ public enum EntityType { LLAMA_SPIT("llama_spit", LlamaSpit.class, 104), PARROT("parrot", Parrot.class, 105), VILLAGER("villager", Villager.class, 120), - ENDER_CRYSTAL("ender_crystal", EnderCrystal.class, 200), + ENDER_CRYSTAL("end_crystal", EnderCrystal.class, 200), + TURTLE("turtle", Turtle.class, -1), + PHANTOM("phantom", Phantom.class, -1), + TRIDENT("trident", Trident.class, -1), + COD("cod", Cod.class, -1), + SALMON("salmon", Salmon.class, -1), + PUFFERFISH("pufferfish", PufferFish.class, -1), + TROPICAL_FISH("tropical_fish", TropicalFish.class, -1), + DROWNED("drowned", Drowned.class, -1), + DOLPHIN("dolphin", Dolphin.class, -1), // These don't have an entity ID in nms.EntityTypes. /** * A flying lingering potion @@ -247,15 +256,15 @@ public enum EntityType { /** * A fishing line and bobber. */ - FISHING_HOOK(null, FishHook.class, -1, false), + FISHING_HOOK("fishing_bobber", FishHook.class, -1, false), /** * A bolt of lightning. * <p> * Spawn with {@link World#strikeLightning(Location)}. */ - LIGHTNING(null, LightningStrike.class, -1, false), + LIGHTNING("lightning_bolt", LightningStrike.class, -1, false), WEATHER(null, Weather.class, -1, false), - PLAYER(null, Player.class, -1, false), + PLAYER("player", Player.class, -1, false), COMPLEX_PART(null, ComplexEntityPart.class, -1, false), /** * Like {@link #ARROW} but tipped with a specific potion which is applied on diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java index bc56fa22..9d34e691 100644 --- a/src/main/java/org/bukkit/entity/FallingBlock.java +++ b/src/main/java/org/bukkit/entity/FallingBlock.java @@ -1,6 +1,7 @@ package org.bukkit.entity; import org.bukkit.Material; +import org.bukkit.block.data.BlockData; /** * Represents a falling block @@ -11,26 +12,18 @@ public interface FallingBlock extends Entity { * Get the Material of the falling block * * @return Material of the block - */ - Material getMaterial(); - - /** - * Get the ID of the falling block - * - * @return ID type of the block - * @deprecated Magic value + * @deprecated use {@link #getBlockData()} */ @Deprecated - int getBlockId(); + Material getMaterial(); /** * Get the data for the falling block * * @return data of the block - * @deprecated Magic value */ @Deprecated - byte getBlockData(); + BlockData getBlockData(); /** * Get if the falling block will break into an item if it cannot be placed diff --git a/src/main/java/org/bukkit/entity/Fish.java b/src/main/java/org/bukkit/entity/Fish.java index 12ed1ed7..570b7bc1 100644 --- a/src/main/java/org/bukkit/entity/Fish.java +++ b/src/main/java/org/bukkit/entity/Fish.java @@ -1,8 +1,6 @@ package org.bukkit.entity; /** - * Represents a fishing hook. - * @deprecated in favor of {@link FishHook} + * Represents a fish entity. */ -public interface Fish extends FishHook { -} +public interface Fish extends Creature { } diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java index 904d84cb..65bd4bea 100644 --- a/src/main/java/org/bukkit/entity/Minecart.java +++ b/src/main/java/org/bukkit/entity/Minecart.java @@ -1,6 +1,7 @@ package org.bukkit.entity; import org.bukkit.Material; +import org.bukkit.block.data.BlockData; import org.bukkit.material.MaterialData; import org.bukkit.util.Vector; @@ -109,6 +110,22 @@ public interface Minecart extends Vehicle { public MaterialData getDisplayBlock(); /** + * Sets the display block for this minecart. + * Passing a null value will set the minecart to have no display block. + * + * @param blockData the material to set as display block. + */ + public void setDisplayBlockData(BlockData blockData); + + /** + * Gets the display block for this minecart. + * This function will return the type AIR if none is set. + * + * @return the block displayed by this minecart. + */ + public BlockData getDisplayBlockData(); + + /** * Sets the offset of the display block. * * @param offset the block offset to set for this minecart. diff --git a/src/main/java/org/bukkit/entity/Phantom.java b/src/main/java/org/bukkit/entity/Phantom.java new file mode 100644 index 00000000..1a1044ed --- /dev/null +++ b/src/main/java/org/bukkit/entity/Phantom.java @@ -0,0 +1,17 @@ +package org.bukkit.entity; + +/** + * Represents a phantom. + */ +public interface Phantom extends Flying { + + /** + * @return The size of the phantom + */ + public int getSize(); + + /** + * @param sz The new size of the phantom. + */ + public void setSize(int sz); +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 082302d1..2596a11d 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -18,6 +18,7 @@ import org.bukkit.Statistic; import org.bukkit.WeatherType; import org.bukkit.advancement.Advancement; import org.bukkit.advancement.AdvancementProgress; +import org.bukkit.block.data.BlockData; import org.bukkit.command.CommandSender; import org.bukkit.conversations.Conversable; import org.bukkit.event.player.PlayerResourcePackStatusEvent; @@ -338,6 +339,15 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline public void sendBlockChange(Location loc, Material material, byte data); /** + * Send a block change. This fakes a block change packet for a user at a + * certain location. This will not actually change the world in any way. + * + * @param loc The location of the changed block + * @param block The new block + */ + public void sendBlockChange(Location loc, BlockData block); + + /** * Send a chunk change. This fakes a chunk change packet for a user at a * certain location. The updated cuboid must be entirely within a single * chunk. This will not actually change the world in any way. @@ -358,22 +368,10 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data); /** - * Send a block change. This fakes a block change packet for a user at a - * certain location. This will not actually change the world in any way. - * - * @param loc The location of the changed block - * @param material The new block ID - * @param data The block data - * @deprecated Magic value - */ - @Deprecated - public void sendBlockChange(Location loc, int material, byte data); - - /** * Send a sign change. This fakes a sign change packet for a user at * a certain location. This will not actually change the world in any way. * This method will use a sign at the location's block or a faked sign - * sent via {@link #sendBlockChange(org.bukkit.Location, int, byte)} or + * sent via * {@link #sendBlockChange(org.bukkit.Location, org.bukkit.Material, byte)}. * <p> * If the client does not have a sign at the given location it will diff --git a/src/main/java/org/bukkit/entity/PufferFish.java b/src/main/java/org/bukkit/entity/PufferFish.java new file mode 100644 index 00000000..2d26c19b --- /dev/null +++ b/src/main/java/org/bukkit/entity/PufferFish.java @@ -0,0 +1,21 @@ +package org.bukkit.entity; + +/** + * Represents a puffer fish. + */ +public interface PufferFish extends Fish { + + /** + * Returns the current puff state of this fish (i.e. how inflated it is). + * + * @return current puff state + */ + int getPuffState(); + + /** + * Sets the current puff state of this fish (i.e. how inflated it is). + * + * @param state new puff state + */ + void setPuffState(int state); +} diff --git a/src/main/java/org/bukkit/entity/Salmon.java b/src/main/java/org/bukkit/entity/Salmon.java new file mode 100644 index 00000000..a52a7af2 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Salmon.java @@ -0,0 +1,7 @@ + +package org.bukkit.entity; + +/** + * Represents a salmon fish. + */ +public interface Salmon extends Fish { } diff --git a/src/main/java/org/bukkit/entity/Trident.java b/src/main/java/org/bukkit/entity/Trident.java new file mode 100644 index 00000000..7af949ea --- /dev/null +++ b/src/main/java/org/bukkit/entity/Trident.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a thrown trident. + */ +public interface Trident extends Arrow { } diff --git a/src/main/java/org/bukkit/entity/TropicalFish.java b/src/main/java/org/bukkit/entity/TropicalFish.java new file mode 100644 index 00000000..51142170 --- /dev/null +++ b/src/main/java/org/bukkit/entity/TropicalFish.java @@ -0,0 +1,72 @@ +package org.bukkit.entity; + +import org.bukkit.DyeColor; + +/** + * Tropical fish. + */ +public interface TropicalFish extends Fish { + + /** + * Gets the color of the fish's pattern. + * + * @return pattern color + */ + DyeColor getPatternColor(); + + /** + * Sets the color of the fish's pattern + * + * @param color pattern color + */ + void setPatternColor(DyeColor color); + + /** + * Gets the color of the fish's body. + * + * @return pattern color + */ + DyeColor getBodyColor(); + + /** + * Sets the color of the fish's body + * + * @param color body color + */ + void setBodyColor(DyeColor color); + + /** + * Gets the fish's pattern. + * + * @return pattern + */ + Pattern getPattern(); + + /** + * Sets the fish's pattern + * + * @param pattern new pattern + */ + void setPattern(Pattern pattern); + + /** + * Enumeration of all different fish patterns. Refer to the + * <a href="https://minecraft.gamepedia.com/Fish_(mob)">Minecraft Wiki</a> + * for pictures. + */ + public static enum Pattern { + + KOB, + SUNSTREAK, + SNOOPER, + DASHER, + BRINELY, + SPOTTY, + FLOPPER, + STRIPEY, + GLITTER, + BLOCKFISH, + BETTY, + CLAYFISH; + } +} diff --git a/src/main/java/org/bukkit/entity/Turtle.java b/src/main/java/org/bukkit/entity/Turtle.java new file mode 100644 index 00000000..0a4cd299 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Turtle.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a turtle. + */ +public interface Turtle extends Animals { } |