From a0cf769bdac39ab6fb2b28d63688992363167fd2 Mon Sep 17 00:00:00 2001 From: CannibalVox Date: Thu, 5 Mar 2015 15:52:15 -0600 Subject: [PATCH] More schematic fixes --- .../mod_pocketDim/mod_pocketDim.java | 1 - .../schematic/ReplacementFilter.java | 16 +++++++++------- .../world/gateways/GatewayBlockFilter.java | 18 ++++++++++-------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/mod_pocketDim.java b/src/main/java/StevenDimDoors/mod_pocketDim/mod_pocketDim.java index 3e569418..8ee02a3a 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/mod_pocketDim.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/mod_pocketDim.java @@ -76,7 +76,6 @@ import StevenDimDoors.mod_pocketDim.world.LimboProvider; import StevenDimDoors.mod_pocketDim.world.PersonalPocketProvider; import StevenDimDoors.mod_pocketDim.world.PocketProvider; import StevenDimDoors.mod_pocketDim.world.gateways.GatewayGenerator; -import StevenDimDoors.mod_pocketDimClient.ClientPacketHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/schematic/ReplacementFilter.java b/src/main/java/StevenDimDoors/mod_pocketDim/schematic/ReplacementFilter.java index e55a7db3..461c6296 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/schematic/ReplacementFilter.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/schematic/ReplacementFilter.java @@ -1,16 +1,18 @@ package StevenDimDoors.mod_pocketDim.schematic; +import net.minecraft.block.Block; + public class ReplacementFilter extends SchematicFilter { - private short targetBlock; + private Block targetBlock; private byte targetMetadata; private boolean matchMetadata; - private short replacementBlock; + private Block replacementBlock; private byte replacementMetadata; private boolean changeMetadata; - public ReplacementFilter(short targetBlock, byte targetMetadata, short replacementBlock, byte replacementMetadata) + public ReplacementFilter(Block targetBlock, byte targetMetadata, Block replacementBlock, byte replacementMetadata) { super("ReplacementFilter"); this.targetBlock = targetBlock; @@ -21,7 +23,7 @@ public class ReplacementFilter extends SchematicFilter { this.changeMetadata = true; } - public ReplacementFilter(short targetBlock, short replacementBlock, byte replacementMetadata) + public ReplacementFilter(Block targetBlock, Block replacementBlock, byte replacementMetadata) { super("ReplacementFilter"); this.targetBlock = targetBlock; @@ -31,7 +33,7 @@ public class ReplacementFilter extends SchematicFilter { this.changeMetadata = true; } - public ReplacementFilter(short targetBlock, byte targetMetadata, short replacementBlock) + public ReplacementFilter(Block targetBlock, byte targetMetadata, Block replacementBlock) { super("ReplacementFilter"); this.targetBlock = targetBlock; @@ -41,7 +43,7 @@ public class ReplacementFilter extends SchematicFilter { this.changeMetadata = false; } - public ReplacementFilter(short targetBlock, short replacementBlock) + public ReplacementFilter(Block targetBlock, Block replacementBlock) { super("ReplacementFilter"); this.targetBlock = targetBlock; @@ -51,7 +53,7 @@ public class ReplacementFilter extends SchematicFilter { } @Override - protected boolean applyToBlock(int index, short[] blocks, byte[] metadata) + protected boolean applyToBlock(int index, Block[] blocks, byte[] metadata) { if (blocks[index] == targetBlock) { diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayBlockFilter.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayBlockFilter.java index 04ee966e..70c07ea9 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayBlockFilter.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayBlockFilter.java @@ -3,8 +3,10 @@ package StevenDimDoors.mod_pocketDim.world.gateways; import java.util.ArrayList; import StevenDimDoors.mod_pocketDim.Point3D; +import StevenDimDoors.mod_pocketDim.mod_pocketDim; import StevenDimDoors.mod_pocketDim.schematic.Schematic; import StevenDimDoors.mod_pocketDim.schematic.SchematicFilter; +import net.minecraft.block.Block; public class GatewayBlockFilter extends SchematicFilter { @@ -33,41 +35,41 @@ public class GatewayBlockFilter extends SchematicFilter { } @Override - protected boolean initialize(Schematic schematic, short[] blocks, byte[] metadata) + protected boolean initialize(Schematic schematic, Block[] blocks, byte[] metadata) { this.schematic = schematic; return true; } @Override - protected boolean applyToBlock(int index, short[] blocks, byte[] metadata) + protected boolean applyToBlock(int index, Block[] blocks, byte[] metadata) { int indexBelow; int indexDoubleBelow; - if (blocks[index] == STANDARD_DIMENSIONAL_DOOR_ID) + if (blocks[index] == mod_pocketDim.dimensionalDoor) { indexBelow = schematic.calculateIndexBelow(index); - if (indexBelow >= 0 && blocks[indexBelow] == STANDARD_DIMENSIONAL_DOOR_ID) + if (indexBelow >= 0 && blocks[indexBelow] == mod_pocketDim.dimensionalDoor) { entranceDoorLocation = schematic.calculatePoint(index); entranceOrientation = (metadata[indexBelow] & 3); return true; } } - if (blocks[index] == STANDARD_TRANSIENT_DOOR_ID) + if (blocks[index] == mod_pocketDim.transientDoor) { indexBelow = schematic.calculateIndexBelow(index); - if (indexBelow >= 0 && blocks[indexBelow] == STANDARD_TRANSIENT_DOOR_ID) + if (indexBelow >= 0 && blocks[indexBelow] == mod_pocketDim.transientDoor) { entranceDoorLocation = schematic.calculatePoint(index); entranceOrientation = (metadata[indexBelow] & 3); return true; } } - if (blocks[index] == STANDARD_WARP_DOOR_ID) + if (blocks[index] == mod_pocketDim.warpDoor) { indexBelow = schematic.calculateIndexBelow(index); - if (indexBelow >= 0 && blocks[indexBelow] == STANDARD_WARP_DOOR_ID) + if (indexBelow >= 0 && blocks[indexBelow] == mod_pocketDim.warpDoor) { entranceDoorLocation = schematic.calculatePoint(index); entranceOrientation = (metadata[indexBelow] & 3);