From aa11d8cac3afce6c8ff4764e0a02a2c4aa3d8088 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 13 Jul 2014 14:43:23 -0500 Subject: [PATCH] Color Applicator now works on carpet, harden clay, and glass panes. --- items/tools/powered/ToolColorApplicator.java | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/items/tools/powered/ToolColorApplicator.java b/items/tools/powered/ToolColorApplicator.java index 4082b1ad..6d32e815 100644 --- a/items/tools/powered/ToolColorApplicator.java +++ b/items/tools/powered/ToolColorApplicator.java @@ -195,6 +195,14 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe private boolean recolourBlock(Block blk, ForgeDirection side, World w, int x, int y, int z, ForgeDirection orientation, AEColor newColor) { + if ( blk == Blocks.carpet ) + { + int meta = w.getBlockMetadata( x, y, z ); + if ( newColor.ordinal() == meta ) + return false; + return w.setBlock( x, y, z, Blocks.carpet, newColor.ordinal(), 3 ); + } + if ( blk == Blocks.glass ) { return w.setBlock( x, y, z, Blocks.stained_glass, newColor.ordinal(), 3 ); @@ -208,6 +216,32 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe return w.setBlock( x, y, z, Blocks.stained_glass, newColor.ordinal(), 3 ); } + if ( blk == Blocks.glass_pane ) + { + return w.setBlock( x, y, z, Blocks.stained_glass_pane, newColor.ordinal(), 3 ); + } + + if ( blk == Blocks.stained_glass_pane ) + { + int meta = w.getBlockMetadata( x, y, z ); + if ( newColor.ordinal() == meta ) + return false; + return w.setBlock( x, y, z, Blocks.stained_glass_pane, newColor.ordinal(), 3 ); + } + + if ( blk == Blocks.hardened_clay ) + { + return w.setBlock( x, y, z, Blocks.stained_hardened_clay, newColor.ordinal(), 3 ); + } + + if ( blk == Blocks.stained_hardened_clay ) + { + int meta = w.getBlockMetadata( x, y, z ); + if ( newColor.ordinal() == meta ) + return false; + return w.setBlock( x, y, z, Blocks.stained_hardened_clay, newColor.ordinal(), 3 ); + } + return blk.recolourBlock( w, x, y, z, side, newColor.ordinal() ); }