diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-13 17:33:27 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-15 13:28:59 -0500 |
commit | 83d29e461c85733f0113b6eb19db6e3b42da2949 (patch) | |
tree | b3063a1c28f478ab368d5ba3413a842def68c28f /src/main/java/net/minecraft/server/ItemMinecart.java | |
parent | ba6e4c38cfa98ad291974195cc46d70a4f138ac1 (diff) | |
download | craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.gz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.lz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.xz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.zip |
Update CraftBukkit to Minecraft 1.5
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemMinecart.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemMinecart.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/ItemMinecart.java b/src/main/java/net/minecraft/server/ItemMinecart.java index cd06b9b7..b4320456 100644 --- a/src/main/java/net/minecraft/server/ItemMinecart.java +++ b/src/main/java/net/minecraft/server/ItemMinecart.java @@ -2,6 +2,7 @@ package net.minecraft.server; public class ItemMinecart extends Item { + private static final IDispenseBehavior b = new DispenseBehaviorMinecart(); public int a; public ItemMinecart(int i, int j) { @@ -9,12 +10,13 @@ public class ItemMinecart extends Item { this.maxStackSize = 1; this.a = j; this.a(CreativeModeTab.e); + BlockDispenser.a.a(this, b); } public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) { int i1 = world.getTypeId(i, j, k); - if (BlockMinecartTrack.e(i1)) { + if (BlockMinecartTrack.d_(i1)) { if (!world.isStatic) { // CraftBukkit start - Minecarts org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, i, j, k, l, itemstack); @@ -24,7 +26,13 @@ public class ItemMinecart extends Item { } // CraftBukkit end - world.addEntity(new EntityMinecart(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.a)); + EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.a(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.a); + + if (itemstack.hasName()) { + entityminecartabstract.a(itemstack.getName()); + } + + world.addEntity(entityminecartabstract); } --itemstack.count; |