summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockCommand.java')
-rw-r--r--src/main/java/net/minecraft/server/BlockCommand.java41
1 files changed, 31 insertions, 10 deletions
diff --git a/src/main/java/net/minecraft/server/BlockCommand.java b/src/main/java/net/minecraft/server/BlockCommand.java
index 34f50ca4..c464beb9 100644
--- a/src/main/java/net/minecraft/server/BlockCommand.java
+++ b/src/main/java/net/minecraft/server/BlockCommand.java
@@ -7,10 +7,10 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
public class BlockCommand extends BlockContainer {
public BlockCommand(int i) {
- super(i, 184, Material.ORE);
+ super(i, Material.ORE);
}
- public TileEntity a(World world) {
+ public TileEntity b(World world) {
return new TileEntityCommand();
}
@@ -22,31 +22,34 @@ public class BlockCommand extends BlockContainer {
// CraftBukkit start
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
- int old = flag1 ? 1 : 0;
- int current = flag ? 1 : 0;
+ int old = flag1 ? 15 : 0;
+ int current = flag ? 15 : 0;
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current);
world.getServer().getPluginManager().callEvent(eventRedstone);
// CraftBukkit end
if (eventRedstone.getNewCurrent() > 0 && !(eventRedstone.getOldCurrent() > 0)) { // CraftBukkit
- world.setRawData(i, j, k, i1 | 1);
- world.a(i, j, k, this.id, this.r_());
+ world.setData(i, j, k, i1 | 1, 4);
+ world.a(i, j, k, this.id, this.a(world));
} else if (!(eventRedstone.getNewCurrent() > 0) && eventRedstone.getOldCurrent() > 0) { // CraftBukkit
- world.setRawData(i, j, k, i1 & -2);
+ world.setData(i, j, k, i1 & -2, 4);
}
}
}
- public void b(World world, int i, int j, int k, Random random) {
+ public void a(World world, int i, int j, int k, Random random) {
TileEntity tileentity = world.getTileEntity(i, j, k);
if (tileentity != null && tileentity instanceof TileEntityCommand) {
- ((TileEntityCommand) tileentity).a(world);
+ TileEntityCommand tileentitycommand = (TileEntityCommand) tileentity;
+
+ tileentitycommand.a(tileentitycommand.a(world));
+ world.m(i, j, k, this.id);
}
}
- public int r_() {
+ public int a(World world) {
return 1;
}
@@ -59,4 +62,22 @@ public class BlockCommand extends BlockContainer {
return true;
}
+
+ public boolean q_() {
+ return true;
+ }
+
+ public int b_(World world, int i, int j, int k, int l) {
+ TileEntity tileentity = world.getTileEntity(i, j, k);
+
+ return tileentity != null && tileentity instanceof TileEntityCommand ? ((TileEntityCommand) tileentity).d() : 0;
+ }
+
+ public void postPlace(World world, int i, int j, int k, EntityLiving entityliving, ItemStack itemstack) {
+ TileEntityCommand tileentitycommand = (TileEntityCommand) world.getTileEntity(i, j, k);
+
+ if (itemstack.hasName()) {
+ tileentitycommand.c(itemstack.getName());
+ }
+ }
}