More schematic fixes

This commit is contained in:
CannibalVox 2015-03-05 15:52:15 -06:00
parent 43c606c687
commit a0cf769bda
3 changed files with 19 additions and 16 deletions

View file

@ -76,7 +76,6 @@ import StevenDimDoors.mod_pocketDim.world.LimboProvider;
import StevenDimDoors.mod_pocketDim.world.PersonalPocketProvider; import StevenDimDoors.mod_pocketDim.world.PersonalPocketProvider;
import StevenDimDoors.mod_pocketDim.world.PocketProvider; import StevenDimDoors.mod_pocketDim.world.PocketProvider;
import StevenDimDoors.mod_pocketDim.world.gateways.GatewayGenerator; import StevenDimDoors.mod_pocketDim.world.gateways.GatewayGenerator;
import StevenDimDoors.mod_pocketDimClient.ClientPacketHandler;
import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.Instance;

View file

@ -1,16 +1,18 @@
package StevenDimDoors.mod_pocketDim.schematic; package StevenDimDoors.mod_pocketDim.schematic;
import net.minecraft.block.Block;
public class ReplacementFilter extends SchematicFilter { public class ReplacementFilter extends SchematicFilter {
private short targetBlock; private Block targetBlock;
private byte targetMetadata; private byte targetMetadata;
private boolean matchMetadata; private boolean matchMetadata;
private short replacementBlock; private Block replacementBlock;
private byte replacementMetadata; private byte replacementMetadata;
private boolean changeMetadata; 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"); super("ReplacementFilter");
this.targetBlock = targetBlock; this.targetBlock = targetBlock;
@ -21,7 +23,7 @@ public class ReplacementFilter extends SchematicFilter {
this.changeMetadata = true; this.changeMetadata = true;
} }
public ReplacementFilter(short targetBlock, short replacementBlock, byte replacementMetadata) public ReplacementFilter(Block targetBlock, Block replacementBlock, byte replacementMetadata)
{ {
super("ReplacementFilter"); super("ReplacementFilter");
this.targetBlock = targetBlock; this.targetBlock = targetBlock;
@ -31,7 +33,7 @@ public class ReplacementFilter extends SchematicFilter {
this.changeMetadata = true; this.changeMetadata = true;
} }
public ReplacementFilter(short targetBlock, byte targetMetadata, short replacementBlock) public ReplacementFilter(Block targetBlock, byte targetMetadata, Block replacementBlock)
{ {
super("ReplacementFilter"); super("ReplacementFilter");
this.targetBlock = targetBlock; this.targetBlock = targetBlock;
@ -41,7 +43,7 @@ public class ReplacementFilter extends SchematicFilter {
this.changeMetadata = false; this.changeMetadata = false;
} }
public ReplacementFilter(short targetBlock, short replacementBlock) public ReplacementFilter(Block targetBlock, Block replacementBlock)
{ {
super("ReplacementFilter"); super("ReplacementFilter");
this.targetBlock = targetBlock; this.targetBlock = targetBlock;
@ -51,7 +53,7 @@ public class ReplacementFilter extends SchematicFilter {
} }
@Override @Override
protected boolean applyToBlock(int index, short[] blocks, byte[] metadata) protected boolean applyToBlock(int index, Block[] blocks, byte[] metadata)
{ {
if (blocks[index] == targetBlock) if (blocks[index] == targetBlock)
{ {

View file

@ -3,8 +3,10 @@ package StevenDimDoors.mod_pocketDim.world.gateways;
import java.util.ArrayList; import java.util.ArrayList;
import StevenDimDoors.mod_pocketDim.Point3D; import StevenDimDoors.mod_pocketDim.Point3D;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.schematic.Schematic; import StevenDimDoors.mod_pocketDim.schematic.Schematic;
import StevenDimDoors.mod_pocketDim.schematic.SchematicFilter; import StevenDimDoors.mod_pocketDim.schematic.SchematicFilter;
import net.minecraft.block.Block;
public class GatewayBlockFilter extends SchematicFilter { public class GatewayBlockFilter extends SchematicFilter {
@ -33,41 +35,41 @@ public class GatewayBlockFilter extends SchematicFilter {
} }
@Override @Override
protected boolean initialize(Schematic schematic, short[] blocks, byte[] metadata) protected boolean initialize(Schematic schematic, Block[] blocks, byte[] metadata)
{ {
this.schematic = schematic; this.schematic = schematic;
return true; return true;
} }
@Override @Override
protected boolean applyToBlock(int index, short[] blocks, byte[] metadata) protected boolean applyToBlock(int index, Block[] blocks, byte[] metadata)
{ {
int indexBelow; int indexBelow;
int indexDoubleBelow; int indexDoubleBelow;
if (blocks[index] == STANDARD_DIMENSIONAL_DOOR_ID) if (blocks[index] == mod_pocketDim.dimensionalDoor)
{ {
indexBelow = schematic.calculateIndexBelow(index); 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); entranceDoorLocation = schematic.calculatePoint(index);
entranceOrientation = (metadata[indexBelow] & 3); entranceOrientation = (metadata[indexBelow] & 3);
return true; return true;
} }
} }
if (blocks[index] == STANDARD_TRANSIENT_DOOR_ID) if (blocks[index] == mod_pocketDim.transientDoor)
{ {
indexBelow = schematic.calculateIndexBelow(index); 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); entranceDoorLocation = schematic.calculatePoint(index);
entranceOrientation = (metadata[indexBelow] & 3); entranceOrientation = (metadata[indexBelow] & 3);
return true; return true;
} }
} }
if (blocks[index] == STANDARD_WARP_DOOR_ID) if (blocks[index] == mod_pocketDim.warpDoor)
{ {
indexBelow = schematic.calculateIndexBelow(index); 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); entranceDoorLocation = schematic.calculatePoint(index);
entranceOrientation = (metadata[indexBelow] & 3); entranceOrientation = (metadata[indexBelow] & 3);