From c862626c026a8c8b7b59eab2558fcab8839f1ca9 Mon Sep 17 00:00:00 2001 From: Andrew Ardill Date: Mon, 17 Jan 2011 16:26:47 +0800 Subject: [PATCH] Depreceated getCraftEntity() as it has been superceded by getBukkitEntity() --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 99e6f11f94..289300c49a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.entity.*; import org.bukkit.entity.*; + import java.util.HashMap; import java.util.Map; import java.util.Random; @@ -113,6 +114,8 @@ public class CraftWorld implements World { EntityItem entity = new EntityItem(world, loc.getX(), loc.getY(), loc.getZ(), stack); entity.c = 10; world.a(entity); + //TODO this is inconsistent with how Entity.getBukkitEntity() works. + // However, this entity is not at the moment backed by a server entity class so it may be left. return new CraftItemDrop(world.getServer(), entity); } @@ -132,7 +135,7 @@ public class CraftWorld implements World { arrow.c(loc.getX(), loc.getY(), loc.getZ(), 0, 0); world.a(arrow); arrow.a(velocity.getX(), velocity.getY(), velocity.getZ(), speed, spread); - return new CraftArrow(world.getServer(), arrow); + return (Arrow) arrow.getBukkitEntity(); } public Minecart spawnMinecart(Location loc) { @@ -168,13 +171,13 @@ public class CraftWorld implements World { CraftMinecart.Type.PoweredMinecart.getId() ); world.a(minecart); - return new CraftPoweredMinecart(world.getServer(), minecart); + return (PoweredMinecart) minecart.getBukkitEntity(); } public Boat spawnBoat(Location loc) { EntityBoat boat = new EntityBoat(world, loc.getX(), loc.getY(), loc.getZ()); world.a(boat); - return new CraftBoat(world.getServer(), boat); + return (Boat) boat.getBukkitEntity(); } public boolean generateTree(Location loc) { @@ -187,6 +190,7 @@ public class CraftWorld implements World { return treeGen.a(world, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); } + /**@deprecated*/ public CraftEntity toCraftEntity(net.minecraft.server.Entity entity) { if (entity instanceof CraftMappable) { return ((CraftMappable)entity).getCraftEntity();