diff options
author | Andrew Ardill <andrew.ardill@gmail.com> | 2011-01-17 07:34:31 +0800 |
---|---|---|
committer | Dinner Bone <dinnerbone@dinnerbone.com> | 2011-01-18 00:13:32 +0800 |
commit | 3400eafaf1ba56b43dbdbb9e0aac3ebf5930538b (patch) | |
tree | f413b0452c10327c74ba5eddda7f622cde646ff0 /src/main/java/net/minecraft/server/EntityMinecart.java | |
parent | 2de3e2e7e406baaaddd5c71fa283d81dacabf815 (diff) | |
download | craftbukkit-3400eafaf1ba56b43dbdbb9e0aac3ebf5930538b.tar craftbukkit-3400eafaf1ba56b43dbdbb9e0aac3ebf5930538b.tar.gz craftbukkit-3400eafaf1ba56b43dbdbb9e0aac3ebf5930538b.tar.lz craftbukkit-3400eafaf1ba56b43dbdbb9e0aac3ebf5930538b.tar.xz craftbukkit-3400eafaf1ba56b43dbdbb9e0aac3ebf5930538b.zip |
added handling of powered and storage minecarts
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityMinecart.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityMinecart.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java index 59cf2d51..c555fd1f 100644 --- a/src/main/java/net/minecraft/server/EntityMinecart.java +++ b/src/main/java/net/minecraft/server/EntityMinecart.java @@ -7,6 +7,8 @@ import java.util.Random; import org.bukkit.Location; import org.bukkit.craftbukkit.entity.CraftEgg; import org.bukkit.craftbukkit.entity.CraftEntity; +import org.bukkit.craftbukkit.entity.CraftPoweredMinecart; +import org.bukkit.craftbukkit.entity.CraftStorageMinecart; import org.bukkit.craftbukkit.CraftMappable; import org.bukkit.craftbukkit.entity.CraftMinecart; import org.bukkit.craftbukkit.CraftServer; @@ -96,6 +98,8 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable private double at; // CraftBukkit start + protected org.bukkit.entity.Entity bukkitPoweredMinecart; //CraftBukkit + protected org.bukkit.entity.Entity bukkitStorageMinecart; //CraftBukkit private CraftMinecart minecart; private boolean slowWhenEmpty = true; @@ -128,9 +132,10 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable handleCreation(world); // CraftBukkit //CraftBukkit start - //TODO need to handle powered and storage minecarts CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftMinecart(server, this); + this.bukkitPoweredMinecart = new CraftPoweredMinecart(server, this); + this.bukkitStorageMinecart = new CraftStorageMinecart(server, this); //CraftBukkit end } @@ -802,4 +807,17 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable } return entityplayer.b(((Entity) (this))) <= 64D; } + + //CraftBukkit start + @Override + public org.bukkit.entity.Entity getBukkitEntity(){ + if (this.d == CraftMinecart.Type.StorageMinecart.getId()) { + return this.bukkitStorageMinecart; + } else if (this.d == CraftMinecart.Type.PoweredMinecart.getId()) { + return this.bukkitPoweredMinecart; + } else { + return this.bukkitEntity; + } + } + //CraftBukkit end } |