diff options
author | Tahg <tahgtahv@gmail.com> | 2011-09-26 03:07:06 -0400 |
---|---|---|
committer | Tahg <tahgtahv@gmail.com> | 2011-09-26 03:07:46 -0400 |
commit | d226e551ae7b77bc002e6686a36a6374ed515fbc (patch) | |
tree | 1b7e23dc7338b928e29cbd453bf0ef68fd7f125b /src/main/java/net/minecraft/server/ItemMobSpawner.java | |
parent | b7c43fbff1dffef1b4c9c4e57633d8c16606db58 (diff) | |
download | craftbukkit-d226e551ae7b77bc002e6686a36a6374ed515fbc.tar craftbukkit-d226e551ae7b77bc002e6686a36a6374ed515fbc.tar.gz craftbukkit-d226e551ae7b77bc002e6686a36a6374ed515fbc.tar.lz craftbukkit-d226e551ae7b77bc002e6686a36a6374ed515fbc.tar.xz craftbukkit-d226e551ae7b77bc002e6686a36a6374ed515fbc.zip |
data improvements
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemMobSpawner.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemMobSpawner.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ItemMobSpawner.java b/src/main/java/net/minecraft/server/ItemMobSpawner.java new file mode 100644 index 00000000..e0c0e805 --- /dev/null +++ b/src/main/java/net/minecraft/server/ItemMobSpawner.java @@ -0,0 +1,44 @@ +package net.minecraft.server; + +public class ItemMobSpawner extends ItemLog { + + public ItemMobSpawner(int i) { + super(i, Block.MOB_SPAWNER); + } + + public boolean a(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) { + if(!super.a(itemstack, entityhuman, world, i, j, k, l)) return false; + System.out.println("Placed the spawner, checking it's entity"); + if (l == 0) { + --j; + } + + if (l == 1) { + ++j; + } + + if (l == 2) { + --k; + } + + if (l == 3) { + ++k; + } + + if (l == 4) { + --i; + } + + if (l == 5) { + ++i; + } + TileEntity entity = world.getTileEntity(i, j, k); + System.out.println(entity); + if (entity instanceof TileEntityMobSpawner) { + System.out.println("Got a valid spawner, attempt to set its type"); + ((TileEntityMobSpawner)entity).setId(itemstack.getData()); + return true; + } + else return false; + } +} |