Divertion transporter fixes, including name change

This commit is contained in:
pixlepix 2013-11-22 23:49:18 -05:00
parent 51225ba715
commit dc1743d517
10 changed files with 67 additions and 37 deletions

View file

@ -82,7 +82,7 @@ import mekanism.common.tileentity.TileEntityEnergyCube;
import mekanism.common.tileentity.TileEntityEnrichmentChamber; import mekanism.common.tileentity.TileEntityEnrichmentChamber;
import mekanism.common.tileentity.TileEntityFactory; import mekanism.common.tileentity.TileEntityFactory;
import mekanism.common.tileentity.TileEntityGasTank; import mekanism.common.tileentity.TileEntityGasTank;
import mekanism.common.tileentity.TileEntityLogisticalDiverter; import mekanism.common.tileentity.TileEntityDivertionTransporter;
import mekanism.common.tileentity.TileEntityLogisticalSorter; import mekanism.common.tileentity.TileEntityLogisticalSorter;
import mekanism.common.tileentity.TileEntityLogisticalTransporter; import mekanism.common.tileentity.TileEntityLogisticalTransporter;
import mekanism.common.tileentity.TileEntityMechanicalPipe; import mekanism.common.tileentity.TileEntityMechanicalPipe;
@ -251,7 +251,7 @@ public class ClientProxy extends CommonProxy
ClientRegistry.registerTileEntity(TileEntityChargepad.class, "Chargepad", new RenderChargepad()); ClientRegistry.registerTileEntity(TileEntityChargepad.class, "Chargepad", new RenderChargepad());
ClientRegistry.registerTileEntity(TileEntityLogisticalTransporter.class, "LogisticalTransporter", new RenderLogisticalTransporter()); ClientRegistry.registerTileEntity(TileEntityLogisticalTransporter.class, "LogisticalTransporter", new RenderLogisticalTransporter());
ClientRegistry.registerTileEntity(TileEntityLogisticalDiverter.class, "LogisticalDiverter", new RenderLogisticalTransporter()); ClientRegistry.registerTileEntity(TileEntityDivertionTransporter.class, "LogisticalDiverter", new RenderLogisticalTransporter());
ClientRegistry.registerTileEntity(TileEntityLogisticalSorter.class, "LogisticalSorter", new RenderLogisticalSorter()); ClientRegistry.registerTileEntity(TileEntityLogisticalSorter.class, "LogisticalSorter", new RenderLogisticalSorter());
ClientRegistry.registerTileEntity(TileEntityBin.class, "Bin", new RenderBin()); ClientRegistry.registerTileEntity(TileEntityBin.class, "Bin", new RenderBin());
ClientRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner", new RenderDigitalMiner()); ClientRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner", new RenderDigitalMiner());

View file

@ -48,9 +48,12 @@ public class TransmitterRenderingHandler implements ISimpleBlockRenderingHandler
case 4: case 4:
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "RestrictiveTransporter.png")); Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "RestrictiveTransporter.png"));
break; break;
case 5:
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalDiverter.png"));
break;
} }
if(metadata != 3 && metadata != 4) if(metadata != 3 && metadata != 4 && metadata != 5)
{ {
smallTransmitter.renderSide(ForgeDirection.UP, true); smallTransmitter.renderSide(ForgeDirection.UP, true);
smallTransmitter.renderSide(ForgeDirection.DOWN, true); smallTransmitter.renderSide(ForgeDirection.DOWN, true);

View file

@ -38,7 +38,7 @@ import mekanism.common.tileentity.TileEntityEnergyCube;
import mekanism.common.tileentity.TileEntityEnrichmentChamber; import mekanism.common.tileentity.TileEntityEnrichmentChamber;
import mekanism.common.tileentity.TileEntityFactory; import mekanism.common.tileentity.TileEntityFactory;
import mekanism.common.tileentity.TileEntityGasTank; import mekanism.common.tileentity.TileEntityGasTank;
import mekanism.common.tileentity.TileEntityLogisticalDiverter; import mekanism.common.tileentity.TileEntityDivertionTransporter;
import mekanism.common.tileentity.TileEntityLogisticalSorter; import mekanism.common.tileentity.TileEntityLogisticalSorter;
import mekanism.common.tileentity.TileEntityLogisticalTransporter; import mekanism.common.tileentity.TileEntityLogisticalTransporter;
import mekanism.common.tileentity.TileEntityMechanicalPipe; import mekanism.common.tileentity.TileEntityMechanicalPipe;
@ -92,7 +92,7 @@ public class CommonProxy
GameRegistry.registerTileEntity(TileEntityChargepad.class, "Chargepad"); GameRegistry.registerTileEntity(TileEntityChargepad.class, "Chargepad");
GameRegistry.registerTileEntity(TileEntityLogisticalTransporter.class, "LogisticalTransporter"); GameRegistry.registerTileEntity(TileEntityLogisticalTransporter.class, "LogisticalTransporter");
GameRegistry.registerTileEntity(TileEntityLogisticalDiverter.class, "LogisticalDiverter"); GameRegistry.registerTileEntity(TileEntityDivertionTransporter.class, "LogisticalDiverter");
GameRegistry.registerTileEntity(TileEntityLogisticalSorter.class, "LogisticalSorter"); GameRegistry.registerTileEntity(TileEntityLogisticalSorter.class, "LogisticalSorter");
GameRegistry.registerTileEntity(TileEntityBin.class, "Bin"); GameRegistry.registerTileEntity(TileEntityBin.class, "Bin");
GameRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner"); GameRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner");

View file

@ -9,7 +9,7 @@ import mekanism.api.transmitters.ITransmitter;
import mekanism.client.ClientProxy; import mekanism.client.ClientProxy;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.PipeUtils; import mekanism.common.PipeUtils;
import mekanism.common.tileentity.TileEntityLogisticalDiverter; import mekanism.common.tileentity.TileEntityDivertionTransporter;
import mekanism.common.tileentity.TileEntityLogisticalTransporter; import mekanism.common.tileentity.TileEntityLogisticalTransporter;
import mekanism.common.tileentity.TileEntityMechanicalPipe; import mekanism.common.tileentity.TileEntityMechanicalPipe;
import mekanism.common.tileentity.TileEntityPressurizedTube; import mekanism.common.tileentity.TileEntityPressurizedTube;
@ -42,7 +42,7 @@ import cpw.mods.fml.relauncher.SideOnly;
* 2: Mechanical Pipe * 2: Mechanical Pipe
* 3: Logistical Transporter * 3: Logistical Transporter
* 4: Restrictive Transporter * 4: Restrictive Transporter
* 5: Logistical Diverter * 5: Diversion Transporter
* @author AidanBrady * @author AidanBrady
* *
*/ */
@ -376,7 +376,7 @@ public class BlockTransmitter extends Block
return new TileEntityLogisticalTransporter(); return new TileEntityLogisticalTransporter();
case 5: case 5:
return new TileEntityLogisticalDiverter(); return new TileEntityDivertionTransporter();
default: default:
return null; return null;
} }

View file

@ -20,6 +20,8 @@ import net.minecraft.util.Icon;
* 1: Universal Cable * 1: Universal Cable
* 2: Mechanical Pipe * 2: Mechanical Pipe
* 3: Logistical Transporter * 3: Logistical Transporter
* 4: Restrictive Transporter
* 5: Diversion Transporter
* @author AidanBrady * @author AidanBrady
* *
*/ */
@ -75,6 +77,13 @@ public class ItemBlockTransmitter extends ItemBlock
list.add("- " + EnumColor.PURPLE + "Blocks (universal)"); list.add("- " + EnumColor.PURPLE + "Blocks (universal)");
list.add("- " + EnumColor.DARK_RED + "Only used if no other paths available"); list.add("- " + EnumColor.DARK_RED + "Only used if no other paths available");
} }
else if(itemstack.getItemDamage() == 5)
{
list.add(EnumColor.DARK_GREY + "Capable of transferring:");
list.add("- " + EnumColor.PURPLE + "Items (universal)");
list.add("- " + EnumColor.PURPLE + "Blocks (universal)");
list.add("- " + EnumColor.DARK_RED + "Controlable by redstone");
}
} }
} }
@ -112,6 +121,9 @@ public class ItemBlockTransmitter extends ItemBlock
case 4: case 4:
name = "RestrictiveTransporter"; name = "RestrictiveTransporter";
break; break;
case 5:
name = "DiversionTransporter";
break;
default: default:
name = "Unknown"; name = "Unknown";
break; break;

View file

@ -16,7 +16,7 @@ import mekanism.common.tileentity.TileEntityBin;
import mekanism.common.tileentity.TileEntityContainerBlock; import mekanism.common.tileentity.TileEntityContainerBlock;
import mekanism.common.tileentity.TileEntityElectricChest; import mekanism.common.tileentity.TileEntityElectricChest;
import mekanism.common.tileentity.TileEntityElectricPump; import mekanism.common.tileentity.TileEntityElectricPump;
import mekanism.common.tileentity.TileEntityLogisticalDiverter; import mekanism.common.tileentity.TileEntityDivertionTransporter;
import mekanism.common.tileentity.TileEntityLogisticalTransporter; import mekanism.common.tileentity.TileEntityLogisticalTransporter;
import mekanism.common.tileentity.TileEntityMechanicalPipe; import mekanism.common.tileentity.TileEntityMechanicalPipe;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
@ -73,8 +73,8 @@ public class ItemConfigurator extends ItemEnergized
else if(world.getBlockTileEntity(x, y, z) instanceof TileEntityLogisticalTransporter) else if(world.getBlockTileEntity(x, y, z) instanceof TileEntityLogisticalTransporter)
{ {
//Player can access color by sneaking //Player can access color by sneaking
if(world.getBlockTileEntity(x, y, z) instanceof TileEntityLogisticalDiverter){ if(world.getBlockTileEntity(x, y, z) instanceof TileEntityDivertionTransporter){
TileEntityLogisticalDiverter transporter = (TileEntityLogisticalDiverter)world.getBlockTileEntity(x, y, z); TileEntityDivertionTransporter transporter = (TileEntityDivertionTransporter)world.getBlockTileEntity(x, y, z);
int newMode=(transporter.modes[side]+1)%3; int newMode=(transporter.modes[side]+1)%3;
transporter.modes[side]=newMode; transporter.modes[side]=newMode;
String description="ERROR"; String description="ERROR";

View file

@ -9,7 +9,7 @@ import mekanism.common.util.TransporterUtils;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
public class TileEntityLogisticalDiverter extends TileEntityLogisticalTransporter { public class TileEntityDivertionTransporter extends TileEntityLogisticalTransporter {
public int[] modes={0,0,0,0,0,0}; public int[] modes={0,0,0,0,0,0};
@Override @Override
@ -25,19 +25,8 @@ public class TileEntityLogisticalDiverter extends TileEntityLogisticalTransporte
super.writeToNBT(nbtTags); super.writeToNBT(nbtTags);
nbtTags.setIntArray("modes", modes); nbtTags.setIntArray("modes", modes);
} }
@Override
public ArrayList getNetworkedData(ArrayList data)
{
data=super.getNetworkedData(data);
data.add(modes[0]);
data.add(modes[1]);
data.add(modes[2]);
data.add(modes[3]);
data.add(modes[4]);
data.add(modes[5]);
return data;
}
@Override @Override
public void handlePacketData(ByteArrayDataInput dataStream) public void handlePacketData(ByteArrayDataInput dataStream)
{ {
@ -50,4 +39,29 @@ public class TileEntityLogisticalDiverter extends TileEntityLogisticalTransporte
modes[5]=dataStream.readInt(); modes[5]=dataStream.readInt();
} }
@Override
public ArrayList getNetworkedData(ArrayList data)
{
data=super.getNetworkedData(data);
data.add(modes[0]);
data.add(modes[1]);
data.add(modes[2]);
data.add(modes[3]);
data.add(modes[4]);
data.add(modes[5]);
return data;
}
public ArrayList getSyncPacket(TransporterStack stack, boolean kill)
{
ArrayList data=super.getSyncPacket(stack, kill);
data.add(modes[0]);
data.add(modes[1]);
data.add(modes[2]);
data.add(modes[3]);
data.add(modes[4]);
data.add(modes[5]);
return data;
}
} }

View file

@ -9,7 +9,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import mekanism.api.Object3D; import mekanism.api.Object3D;
import mekanism.common.tileentity.TileEntityLogisticalDiverter; import mekanism.common.tileentity.TileEntityDivertionTransporter;
import mekanism.common.tileentity.TileEntityLogisticalSorter; import mekanism.common.tileentity.TileEntityLogisticalSorter;
import mekanism.common.tileentity.TileEntityLogisticalTransporter; import mekanism.common.tileentity.TileEntityLogisticalTransporter;
import mekanism.common.transporter.TransporterPathfinder.Pathfinder.DestChecker; import mekanism.common.transporter.TransporterPathfinder.Pathfinder.DestChecker;
@ -186,15 +186,15 @@ public final class TransporterPathfinder
{ {
//Check for logistical Diverter //Check for logistical Diverter
TileEntity currTile = pointer.getTileEntity(worldObj); TileEntity currTile = pointer.getTileEntity(worldObj);
if(currTile instanceof TileEntityLogisticalDiverter){ if(currTile instanceof TileEntityDivertionTransporter){
int mode=((TileEntityLogisticalDiverter) currTile).modes[side.ordinal()]; int mode=((TileEntityDivertionTransporter) currTile).modes[side.ordinal()];
boolean redstone=currTile.worldObj.isBlockIndirectlyGettingPowered(currTile.xCoord, currTile.yCoord,currTile.zCoord); boolean redstone=currTile.worldObj.isBlockIndirectlyGettingPowered(currTile.xCoord, currTile.yCoord,currTile.zCoord);
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){ if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
continue; continue;
} }
} }
if(tile instanceof TileEntityLogisticalDiverter){ if(tile instanceof TileEntityDivertionTransporter){
int mode=((TileEntityLogisticalDiverter) tile).modes[side.ordinal()]; int mode=((TileEntityDivertionTransporter) tile).modes[side.ordinal()];
boolean redstone=tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord,tile.zCoord); boolean redstone=tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord,tile.zCoord);
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){ if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
continue; continue;

View file

@ -8,7 +8,7 @@ import mekanism.api.IConfigurable;
import mekanism.api.Object3D; import mekanism.api.Object3D;
import mekanism.api.transmitters.ITransmitter; import mekanism.api.transmitters.ITransmitter;
import mekanism.common.tileentity.TileEntityBin; import mekanism.common.tileentity.TileEntityBin;
import mekanism.common.tileentity.TileEntityLogisticalDiverter; import mekanism.common.tileentity.TileEntityDivertionTransporter;
import mekanism.common.tileentity.TileEntityLogisticalSorter; import mekanism.common.tileentity.TileEntityLogisticalSorter;
import mekanism.common.tileentity.TileEntityLogisticalTransporter; import mekanism.common.tileentity.TileEntityLogisticalTransporter;
import mekanism.common.transporter.TransporterStack; import mekanism.common.transporter.TransporterStack;
@ -90,8 +90,8 @@ public final class TransporterUtils
{ {
int side = Arrays.asList(connectedInventories).indexOf(inventory); int side = Arrays.asList(connectedInventories).indexOf(inventory);
if(tileEntity instanceof TileEntityLogisticalDiverter){ if(tileEntity instanceof TileEntityDivertionTransporter){
int mode=((TileEntityLogisticalDiverter) tileEntity).modes[side]; int mode=((TileEntityDivertionTransporter) tileEntity).modes[side];
boolean redstone=tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); boolean redstone=tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){ if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
continue; continue;
@ -138,8 +138,8 @@ public final class TransporterUtils
int side = Arrays.asList(connectedTransporters).indexOf(tile); int side = Arrays.asList(connectedTransporters).indexOf(tile);
//Check for logistical Diverter //Check for logistical Diverter
if(tileEntity instanceof TileEntityLogisticalDiverter){ if(tileEntity instanceof TileEntityDivertionTransporter){
int mode=((TileEntityLogisticalDiverter) tileEntity).modes[side]; int mode=((TileEntityDivertionTransporter) tileEntity).modes[side];
boolean redstone=tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); boolean redstone=tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){ if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
continue; continue;
@ -147,8 +147,8 @@ public final class TransporterUtils
} }
//Check for logistical Diverter //Check for logistical Diverter
if(tile instanceof TileEntityLogisticalDiverter){ if(tile instanceof TileEntityDivertionTransporter){
int mode=((TileEntityLogisticalDiverter) tile).modes[ForgeDirection.VALID_DIRECTIONS[side].getOpposite().ordinal()]; int mode=((TileEntityDivertionTransporter) tile).modes[ForgeDirection.VALID_DIRECTIONS[side].getOpposite().ordinal()];
boolean redstone=tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord, tile.zCoord); boolean redstone=tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord, tile.zCoord);
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){ if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
continue; continue;

View file

@ -66,6 +66,7 @@ tile.Transmitter.UniversalCable.name=Universal Cable
tile.Transmitter.MechanicalPipe.name=Mechanical Pipe tile.Transmitter.MechanicalPipe.name=Mechanical Pipe
tile.Transmitter.LogisticalTransporter.name=Logistical Transporter tile.Transmitter.LogisticalTransporter.name=Logistical Transporter
tile.Transmitter.RestrictiveTransporter.name=Restrictive Transporter tile.Transmitter.RestrictiveTransporter.name=Restrictive Transporter
tile.Transmitter.DiversionTransporter.name=Diversion Transporter
//Energy Cubes //Energy Cubes
tile.EnergyCube.Basic.name=Basic Energy Cube tile.EnergyCube.Basic.name=Basic Energy Cube