From b1e18b564ee0c459434556245cfd152e1c3723e3 Mon Sep 17 00:00:00 2001 From: StevenRS11 Date: Wed, 26 Jun 2013 22:28:57 -0400 Subject: [PATCH] Made it prettier --- .../helpers/BlockRotationHelper.java | 84 ++++++------------- 1 file changed, 24 insertions(+), 60 deletions(-) diff --git a/StevenDimDoors/mod_pocketDim/helpers/BlockRotationHelper.java b/StevenDimDoors/mod_pocketDim/helpers/BlockRotationHelper.java index 672c64b..728b724 100644 --- a/StevenDimDoors/mod_pocketDim/helpers/BlockRotationHelper.java +++ b/StevenDimDoors/mod_pocketDim/helpers/BlockRotationHelper.java @@ -13,8 +13,6 @@ public class BlockRotationHelper this.InitializeRotationMap(); } - - public void InitializeRotationMap() { HashMap> orientation0 = new HashMap>(); @@ -29,29 +27,22 @@ public class BlockRotationHelper stairs0.put(6, 5); stairs0.put(5, 7); stairs0.put(4, 6); - - - - HashMap chestsLadders0 = new HashMap(); + HashMap chestsLadders0 = new HashMap(); chestsLadders0.put(2, 5); chestsLadders0.put(3, 4); chestsLadders0.put(4, 2); chestsLadders0.put(5, 3); - - - - HashMap vine0 = new HashMap(); + + HashMap vine0 = new HashMap(); vine0.put(1, 2); vine0.put(2, 4); vine0.put(4, 8); vine0.put(8, 1); - orientation0.put(Block.vine.blockID, vine0); - - HashMap leverButtonTorch0 = new HashMap(); + HashMap leverButtonTorch0 = new HashMap(); leverButtonTorch0.put(12, 9); leverButtonTorch0.put(11, 10); @@ -62,9 +53,7 @@ public class BlockRotationHelper leverButtonTorch0.put(1, 3); leverButtonTorch0.put(4, 1); - - - HashMap pistonDropperDispenser0 = new HashMap(); + HashMap pistonDropperDispenser0 = new HashMap(); pistonDropperDispenser0.put(4, 2); pistonDropperDispenser0.put(5, 3); @@ -74,11 +63,8 @@ public class BlockRotationHelper pistonDropperDispenser0.put(11, 12); pistonDropperDispenser0.put(10, 13); pistonDropperDispenser0.put(12, 10); - - - - - HashMap repeaterComparatorDoorTripwire0 = new HashMap(); + + HashMap repeaterComparatorDoorTripwire0 = new HashMap(); repeaterComparatorDoorTripwire0.put(0, 1); repeaterComparatorDoorTripwire0.put(1, 2); @@ -97,11 +83,9 @@ public class BlockRotationHelper repeaterComparatorDoorTripwire0.put(14, 15); repeaterComparatorDoorTripwire0.put(15, 12); - - HashMap> orientation1 = new HashMap>(); - HashMap stairs1 = new HashMap(); + HashMap stairs1 = new HashMap(); stairs1.put(0, 1); stairs1.put(1, 0); @@ -112,21 +96,21 @@ public class BlockRotationHelper stairs1.put(5, 4); stairs1.put(4, 5); - HashMap chestsLadders1 = new HashMap(); + HashMap chestsLadders1 = new HashMap(); chestsLadders1.put(2, 3); chestsLadders1.put(3, 2); chestsLadders1.put(4, 5); chestsLadders1.put(5, 4); - HashMap vine1 = new HashMap(); + HashMap vine1 = new HashMap(); vine1.put(1, 4); vine1.put(2, 8); vine1.put(4, 1); vine1.put(8, 2); - HashMap leverButtonTorch1 = new HashMap(); + HashMap leverButtonTorch1 = new HashMap(); leverButtonTorch1.put(12, 9); leverButtonTorch1.put(11, 10); @@ -137,7 +121,7 @@ public class BlockRotationHelper leverButtonTorch1.put(1, 3); leverButtonTorch1.put(4, 1); - HashMap pistonDropperDispenser1 = new HashMap(); + HashMap pistonDropperDispenser1 = new HashMap(); pistonDropperDispenser1.put(12, 11); pistonDropperDispenser1.put(11, 12); @@ -149,7 +133,7 @@ public class BlockRotationHelper pistonDropperDispenser1.put(4,3); - HashMap repeaterComparatorDoorTripwire1 = new HashMap(); + HashMap repeaterComparatorDoorTripwire1 = new HashMap(); repeaterComparatorDoorTripwire1.put(0, 2); repeaterComparatorDoorTripwire1.put(1, 3); @@ -170,7 +154,7 @@ public class BlockRotationHelper HashMap> orientation2 = new HashMap>(); - HashMap stairs2 = new HashMap(); + HashMap stairs2 = new HashMap(); stairs2.put(2, 0); stairs2.put(3, 1); @@ -181,21 +165,21 @@ public class BlockRotationHelper stairs2.put(7, 5); stairs2.put(6, 4); - HashMap chestsLadders2 = new HashMap(); + HashMap chestsLadders2 = new HashMap(); chestsLadders2.put(2, 4); chestsLadders2.put(3, 5); chestsLadders2.put(4, 3); chestsLadders2.put(5, 2); - HashMap vine2 = new HashMap(); + HashMap vine2 = new HashMap(); vine2.put(1, 8); vine2.put(2, 1); vine2.put(4, 2); vine2.put(8, 4); - HashMap leverButtonTorch2 = new HashMap(); + HashMap leverButtonTorch2 = new HashMap(); leverButtonTorch2.put(9, 12); leverButtonTorch2.put(10, 11); @@ -206,7 +190,7 @@ public class BlockRotationHelper leverButtonTorch2.put(3, 1); leverButtonTorch2.put(1, 4); - HashMap pistonDropperDispenser2 = new HashMap(); + HashMap pistonDropperDispenser2 = new HashMap(); pistonDropperDispenser2.put(2, 4); pistonDropperDispenser2.put(3, 5); @@ -218,7 +202,7 @@ public class BlockRotationHelper pistonDropperDispenser2.put(13,10); - HashMap repeaterComparatorDoorTripwire2 = new HashMap(); + HashMap repeaterComparatorDoorTripwire2 = new HashMap(); repeaterComparatorDoorTripwire2.put(1, 0); repeaterComparatorDoorTripwire2.put(2, 1); @@ -251,25 +235,22 @@ public class BlockRotationHelper orientation0.put(Block.stairsWoodOak.blockID, stairs0); orientation0.put(Block.stairsWoodSpruce.blockID, stairs0); orientation0.put(Block.stairsBrick.blockID, stairs0); - + orientation0.put(Block.vine.blockID, vine0); orientation0.put(Block.chest.blockID, chestsLadders0); orientation0.put(Block.chestTrapped.blockID, chestsLadders0); orientation0.put(Block.ladder.blockID, chestsLadders0); - orientation0.put(Block.lever.blockID, leverButtonTorch0); orientation0.put(Block.stoneButton.blockID, leverButtonTorch0); orientation0.put(Block.woodenButton.blockID, leverButtonTorch0); orientation0.put(Block.torchRedstoneActive.blockID, leverButtonTorch0); orientation0.put(Block.torchRedstoneIdle.blockID, leverButtonTorch0); orientation0.put(Block.torchWood.blockID, leverButtonTorch0); - orientation0.put(Block.pistonBase.blockID,pistonDropperDispenser0); orientation0.put(Block.pistonExtension.blockID,pistonDropperDispenser0); orientation0.put(Block.pistonMoving.blockID,pistonDropperDispenser0); orientation0.put(Block.pistonStickyBase.blockID,pistonDropperDispenser0); orientation0.put(Block.dropper.blockID,pistonDropperDispenser0); orientation0.put(Block.dispenser.blockID,pistonDropperDispenser0); - orientation0.put(Block.redstoneComparatorActive.blockID,pistonDropperDispenser0); orientation0.put(Block.redstoneComparatorIdle.blockID,pistonDropperDispenser0); orientation0.put(Block.redstoneRepeaterActive.blockID,pistonDropperDispenser0); @@ -278,10 +259,6 @@ public class BlockRotationHelper orientation0.put(Block.doorIron.blockID,pistonDropperDispenser0); orientation0.put(Block.tripWireSource.blockID,pistonDropperDispenser0); - - - - orientation1.put(Block.stairsBrick.blockID, stairs1); orientation1.put(Block.stairsCobblestone.blockID, stairs1); orientation1.put(Block.stairsNetherBrick.blockID, stairs1); @@ -293,25 +270,22 @@ public class BlockRotationHelper orientation1.put(Block.stairsWoodOak.blockID, stairs1); orientation1.put(Block.stairsWoodSpruce.blockID, stairs1); orientation1.put(Block.stairsBrick.blockID, stairs1); - + orientation1.put(Block.vine.blockID, vine1); orientation1.put(Block.chest.blockID, chestsLadders1); orientation1.put(Block.chestTrapped.blockID, chestsLadders1); orientation1.put(Block.ladder.blockID, chestsLadders1); - orientation1.put(Block.lever.blockID, leverButtonTorch1); orientation1.put(Block.stoneButton.blockID, leverButtonTorch1); orientation1.put(Block.woodenButton.blockID, leverButtonTorch1); orientation1.put(Block.torchRedstoneActive.blockID, leverButtonTorch1); orientation1.put(Block.torchRedstoneIdle.blockID, leverButtonTorch1); orientation1.put(Block.torchWood.blockID, leverButtonTorch1); - orientation1.put(Block.pistonBase.blockID,pistonDropperDispenser1); orientation1.put(Block.pistonExtension.blockID,pistonDropperDispenser1); orientation1.put(Block.pistonMoving.blockID,pistonDropperDispenser1); orientation1.put(Block.pistonStickyBase.blockID,pistonDropperDispenser1); orientation1.put(Block.dropper.blockID,pistonDropperDispenser1); orientation1.put(Block.dispenser.blockID,pistonDropperDispenser1); - orientation1.put(Block.redstoneComparatorActive.blockID,pistonDropperDispenser1); orientation1.put(Block.redstoneComparatorIdle.blockID,pistonDropperDispenser1); orientation1.put(Block.redstoneRepeaterActive.blockID,pistonDropperDispenser1); @@ -320,11 +294,7 @@ public class BlockRotationHelper orientation1.put(Block.doorIron.blockID,pistonDropperDispenser1); orientation1.put(Block.tripWireSource.blockID,pistonDropperDispenser1); - - - - - + orientation2.put(Block.stairsBrick.blockID, stairs2); orientation2.put(Block.stairsCobblestone.blockID, stairs2); orientation2.put(Block.stairsNetherBrick.blockID, stairs2); @@ -336,25 +306,22 @@ public class BlockRotationHelper orientation2.put(Block.stairsWoodOak.blockID, stairs2); orientation2.put(Block.stairsWoodSpruce.blockID, stairs2); orientation2.put(Block.stairsBrick.blockID, stairs2); - + orientation2.put(Block.vine.blockID, vine2); orientation2.put(Block.chest.blockID, chestsLadders2); orientation2.put(Block.chestTrapped.blockID, chestsLadders2); orientation2.put(Block.ladder.blockID, chestsLadders2); - orientation2.put(Block.lever.blockID, leverButtonTorch2); orientation2.put(Block.stoneButton.blockID, leverButtonTorch2); orientation2.put(Block.woodenButton.blockID, leverButtonTorch2); orientation2.put(Block.torchRedstoneActive.blockID, leverButtonTorch2); orientation2.put(Block.torchRedstoneIdle.blockID, leverButtonTorch2); orientation2.put(Block.torchWood.blockID, leverButtonTorch2); - orientation2.put(Block.pistonBase.blockID,pistonDropperDispenser2); orientation2.put(Block.pistonExtension.blockID,pistonDropperDispenser2); orientation2.put(Block.pistonMoving.blockID,pistonDropperDispenser2); orientation2.put(Block.pistonStickyBase.blockID,pistonDropperDispenser2); orientation2.put(Block.dropper.blockID,pistonDropperDispenser2); orientation2.put(Block.dispenser.blockID,pistonDropperDispenser2); - orientation2.put(Block.redstoneComparatorActive.blockID,pistonDropperDispenser2); orientation2.put(Block.redstoneComparatorIdle.blockID,pistonDropperDispenser2); orientation2.put(Block.redstoneRepeaterActive.blockID,pistonDropperDispenser2); @@ -366,8 +333,6 @@ public class BlockRotationHelper this.rotationMappings.put(2, orientation2); this.rotationMappings.put(1, orientation1); this.rotationMappings.put(0, orientation0); - - } public int getRotatedBlock(int metaData, int desiredOrientation, int blockID) @@ -382,8 +347,7 @@ public class BlockRotationHelper } } } - - return 0 ; + return 0 ; }