From d4397d48947f5ecc76a487ebd0281cc25fe66139 Mon Sep 17 00:00:00 2001 From: Krapht Date: Sat, 11 Aug 2012 22:35:55 +0200 Subject: [PATCH] changed onBlockPlaced to updateBlockMetadata --- common/buildcraft/builders/BlockMarker.java | 22 +++++++++---------- common/buildcraft/energy/BlockEngine.java | 6 ++--- common/buildcraft/silicon/BlockLaser.java | 15 +++++++------ .../transport/BlockGenericPipe.java | 9 ++++---- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/common/buildcraft/builders/BlockMarker.java b/common/buildcraft/builders/BlockMarker.java index 8f1fe97e..9fa48049 100644 --- a/common/buildcraft/builders/BlockMarker.java +++ b/common/buildcraft/builders/BlockMarker.java @@ -163,30 +163,30 @@ public class BlockMarker extends BlockContainer { } @Override - public void onBlockPlaced(World world, int i, int j, int k, int l) { - super.onBlockPlaced(world, i, j, k, l); - int i1 = world.getBlockMetadata(i, j, k); - if (l == 1 && BuildersProxy.canPlaceTorch(world, i, j - 1, k)) { + public void updateBlockMetadata(World world, int x, int y, int z, int par5, float par6, float par7, float par8) { + super.updateBlockMetadata(world, x, y, z, par5, par6, par7, par8); + int i1 = world.getBlockMetadata(x, y, z); + if (par5 == 1 && BuildersProxy.canPlaceTorch(world, x, y - 1, z)) { i1 = 5; } - if (l == 2 && BuildersProxy.canPlaceTorch(world, i, j, k + 1)) { + if (par5 == 2 && BuildersProxy.canPlaceTorch(world, x, y, z + 1)) { i1 = 4; } - if (l == 3 && BuildersProxy.canPlaceTorch(world, i, j, k - 1)) { + if (par5 == 3 && BuildersProxy.canPlaceTorch(world, x, y, z - 1)) { i1 = 3; } - if (l == 4 && BuildersProxy.canPlaceTorch(world, i + 1, j, k)) { + if (par5 == 4 && BuildersProxy.canPlaceTorch(world, x + 1, y, z)) { i1 = 2; } - if (l == 5 && BuildersProxy.canPlaceTorch(world, i - 1, j, k)) { + if (par5 == 5 && BuildersProxy.canPlaceTorch(world, x - 1, y, z)) { i1 = 1; } - if (l == 0 && BuildersProxy.canPlaceTorch(world, i, j + 1, k)) { + if (par5 == 0 && BuildersProxy.canPlaceTorch(world, x, y + 1, z)) { i1 = 0; } - world.setBlockMetadataWithNotify(i, j, k, i1); + world.setBlockMetadataWithNotify(x, y, z, i1); } - + @Override public void onBlockAdded(World world, int i, int j, int k) { super.onBlockAdded(world, i, j, k); diff --git a/common/buildcraft/energy/BlockEngine.java b/common/buildcraft/energy/BlockEngine.java index 54d000a4..66506bb4 100644 --- a/common/buildcraft/energy/BlockEngine.java +++ b/common/buildcraft/energy/BlockEngine.java @@ -105,10 +105,10 @@ public class BlockEngine extends BlockContainer { return false; } - + @Override - public void onBlockPlaced(World world, int i, int j, int k, int l) { - TileEngine tile = (TileEngine) world.getBlockTileEntity(i, j, k); + public void updateBlockMetadata(World world, int x, int y, int z, int par5, float par6, float par7, float par8) { + TileEngine tile = (TileEngine) world.getBlockTileEntity(x, y, z); tile.orientation = Orientations.YPos.ordinal(); tile.switchOrientation(); } diff --git a/common/buildcraft/silicon/BlockLaser.java b/common/buildcraft/silicon/BlockLaser.java index 76a8f3d1..c47e324f 100644 --- a/common/buildcraft/silicon/BlockLaser.java +++ b/common/buildcraft/silicon/BlockLaser.java @@ -70,16 +70,17 @@ public class BlockLaser extends BlockContainer { } + @Override - public void onBlockPlaced(World world, int i, int j, int k, int l) { - super.onBlockPlaced(world, i, j, k, l); - int i1 = world.getBlockMetadata(i, j, k); - if (l <= 6) { - i1 = l; + public void updateBlockMetadata(World world, int x, int y, int z, int par5, float par6, float par7, float par8) { + super.updateBlockMetadata(world, x, y, z, par5, par6, par7, par8); + int i1 = world.getBlockMetadata(x, y, z); + if (par5 <= 6) { + i1 = par5; } - world.setBlockMetadataWithNotify(i, j, k, i1); + world.setBlockMetadataWithNotify(x, y, z, i1); } - + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void addCreativeItems(ArrayList itemList) { diff --git a/common/buildcraft/transport/BlockGenericPipe.java b/common/buildcraft/transport/BlockGenericPipe.java index e0b787da..dd91278d 100644 --- a/common/buildcraft/transport/BlockGenericPipe.java +++ b/common/buildcraft/transport/BlockGenericPipe.java @@ -258,14 +258,15 @@ public class BlockGenericPipe extends BlockContainer { pipe.container.scheduleNeighborChange(); } - @Override - public void onBlockPlaced(World world, int i, int j, int k, int l) { - super.onBlockPlaced(world, i, j, k, l); - Pipe pipe = getPipe(world, i, j, k); + @Override + public void updateBlockMetadata(World world, int x, int y, int z, int par5, float par6, float par7, float par8) { + super.updateBlockMetadata(world, x, y, z, par5, par6, par7, par8); + Pipe pipe = getPipe(world, x, y, z); if (isValid(pipe)) pipe.onBlockPlaced(); + } @Override