Neatened up Diversion Transporter code
This commit is contained in:
parent
a848b11582
commit
a27582971b
14 changed files with 294 additions and 261 deletions
|
@ -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.TileEntityDivertionTransporter;
|
import mekanism.common.tileentity.TileEntityDiversionTransporter;
|
||||||
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;
|
||||||
|
@ -250,8 +250,7 @@ public class ClientProxy extends CommonProxy
|
||||||
ClientRegistry.registerTileEntity(TileEntityDynamicValve.class, "DynamicValve", new RenderDynamicTank());
|
ClientRegistry.registerTileEntity(TileEntityDynamicValve.class, "DynamicValve", new RenderDynamicTank());
|
||||||
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(TileEntityDiversionTransporter.class, "DiversionTransporter", 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());
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class TransmitterRenderingHandler implements ISimpleBlockRenderingHandler
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "RestrictiveTransporter.png"));
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "RestrictiveTransporter.png"));
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalDiverter.png"));
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "DiversionTransporter.png"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class RenderLogisticalTransporter extends TileEntitySpecialRenderer
|
||||||
}
|
}
|
||||||
else if(meta == 5)
|
else if(meta == 5)
|
||||||
{
|
{
|
||||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalDiverter.png"));
|
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "DiversionTransporter.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
|
|
@ -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.TileEntityDivertionTransporter;
|
import mekanism.common.tileentity.TileEntityDiversionTransporter;
|
||||||
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;
|
||||||
|
@ -91,8 +91,7 @@ public class CommonProxy
|
||||||
GameRegistry.registerTileEntity(TileEntityDynamicValve.class, "DynamicValve");
|
GameRegistry.registerTileEntity(TileEntityDynamicValve.class, "DynamicValve");
|
||||||
GameRegistry.registerTileEntity(TileEntityChargepad.class, "Chargepad");
|
GameRegistry.registerTileEntity(TileEntityChargepad.class, "Chargepad");
|
||||||
GameRegistry.registerTileEntity(TileEntityLogisticalTransporter.class, "LogisticalTransporter");
|
GameRegistry.registerTileEntity(TileEntityLogisticalTransporter.class, "LogisticalTransporter");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityDiversionTransporter.class, "DiversionTransporter");
|
||||||
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");
|
||||||
|
|
|
@ -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.TileEntityDivertionTransporter;
|
import mekanism.common.tileentity.TileEntityDiversionTransporter;
|
||||||
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;
|
||||||
|
@ -242,7 +242,7 @@ public class BlockTransmitter extends Block
|
||||||
{
|
{
|
||||||
connectable = PipeUtils.getConnections(tileEntity);
|
connectable = PipeUtils.getConnections(tileEntity);
|
||||||
}
|
}
|
||||||
else if(world.getBlockMetadata(x, y, z) == 3 || world.getBlockMetadata(x, y, z) == 4||world.getBlockMetadata(x, y, z) == 5)
|
else if(world.getBlockMetadata(x, y, z) == 3 || world.getBlockMetadata(x, y, z) == 4 || world.getBlockMetadata(x, y, z) == 5)
|
||||||
{
|
{
|
||||||
connectable = TransporterUtils.getConnections((TileEntityLogisticalTransporter)tileEntity);
|
connectable = TransporterUtils.getConnections((TileEntityLogisticalTransporter)tileEntity);
|
||||||
}
|
}
|
||||||
|
@ -376,7 +376,7 @@ public class BlockTransmitter extends Block
|
||||||
return new TileEntityLogisticalTransporter();
|
return new TileEntityLogisticalTransporter();
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
return new TileEntityDivertionTransporter();
|
return new TileEntityDiversionTransporter();
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class ItemBlockTransmitter extends ItemBlock
|
||||||
list.add(EnumColor.DARK_GREY + "Capable of transferring:");
|
list.add(EnumColor.DARK_GREY + "Capable of transferring:");
|
||||||
list.add("- " + EnumColor.PURPLE + "Items (universal)");
|
list.add("- " + EnumColor.PURPLE + "Items (universal)");
|
||||||
list.add("- " + EnumColor.PURPLE + "Blocks (universal)");
|
list.add("- " + EnumColor.PURPLE + "Blocks (universal)");
|
||||||
list.add("- " + EnumColor.DARK_RED + "Controlable by redstone");
|
list.add("- " + EnumColor.DARK_RED + "Controllable by redstone");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.TileEntityDivertionTransporter;
|
import mekanism.common.tileentity.TileEntityDiversionTransporter;
|
||||||
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;
|
||||||
|
@ -72,34 +72,38 @@ 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
|
if(world.getBlockTileEntity(x, y, z) instanceof TileEntityDiversionTransporter)
|
||||||
if(world.getBlockTileEntity(x, y, z) instanceof TileEntityDivertionTransporter){
|
{
|
||||||
TileEntityDivertionTransporter transporter = (TileEntityDivertionTransporter)world.getBlockTileEntity(x, y, z);
|
TileEntityDiversionTransporter transporter = (TileEntityDiversionTransporter)world.getBlockTileEntity(x, y, z);
|
||||||
int newMode=(transporter.modes[side]+1)%3;
|
int newMode = (transporter.modes[side] + 1) % 3;
|
||||||
transporter.modes[side]=newMode;
|
String description = "ERROR";
|
||||||
String description="ERROR";
|
|
||||||
switch(newMode){
|
|
||||||
case 0:
|
|
||||||
description="Always active";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
description="Active with signal";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
description="Active without signal";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + "Diverter mode changed to: "+EnumColor.RED+description));
|
|
||||||
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Object3D.get(transporter), transporter.getNetworkedData(new ArrayList())), Object3D.get(transporter), 50D);
|
|
||||||
|
|
||||||
return true;
|
transporter.modes[side] = newMode;
|
||||||
}else{
|
|
||||||
TileEntityLogisticalTransporter transporter = (TileEntityLogisticalTransporter)world.getBlockTileEntity(x, y, z);
|
switch(newMode)
|
||||||
TransporterUtils.incrementColor(transporter);
|
{
|
||||||
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Object3D.get(transporter), transporter.getNetworkedData(new ArrayList())), Object3D.get(transporter), 50D);
|
case 0:
|
||||||
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Color bumped to: " + (transporter.color != null ? transporter.color.getName() : EnumColor.BLACK + "None")));
|
description = "Always active";
|
||||||
return true;
|
break;
|
||||||
}
|
case 1:
|
||||||
|
description = "Active with signal";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
description = "Active without signal";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Diverter mode changed to: " + EnumColor.RED + description));
|
||||||
|
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Object3D.get(transporter), transporter.getNetworkedData(new ArrayList())), Object3D.get(transporter), 50D);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TileEntityLogisticalTransporter transporter = (TileEntityLogisticalTransporter)world.getBlockTileEntity(x, y, z);
|
||||||
|
TransporterUtils.incrementColor(transporter);
|
||||||
|
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Object3D.get(transporter), transporter.getNetworkedData(new ArrayList())), Object3D.get(transporter), 50D);
|
||||||
|
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Color bumped to: " + (transporter.color != null ? transporter.color.getName() : EnumColor.BLACK + "None")));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(world.getBlockTileEntity(x, y, z) instanceof TileEntityBin)
|
else if(world.getBlockTileEntity(x, y, z) instanceof TileEntityBin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,13 +10,14 @@ import com.google.common.io.ByteArrayDataInput;
|
||||||
public class MItemStackFilter extends MinerFilter
|
public class MItemStackFilter extends MinerFilter
|
||||||
{
|
{
|
||||||
public ItemStack itemType;
|
public ItemStack itemType;
|
||||||
public MItemStackFilter(ItemStack item){
|
|
||||||
super();
|
public MItemStackFilter(ItemStack item)
|
||||||
this.itemType=item;
|
{
|
||||||
}
|
itemType = item;
|
||||||
public MItemStackFilter(){
|
|
||||||
super();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MItemStackFilter() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canFilter(ItemStack itemStack)
|
public boolean canFilter(ItemStack itemStack)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1078,138 +1078,148 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getType() {
|
public String getType()
|
||||||
|
{
|
||||||
return "Digital Miner";
|
return "Digital Miner";
|
||||||
}
|
}
|
||||||
public String[] names =
|
|
||||||
{
|
public String[] names = {"setRadius", "setMin", "setMax", "setReplace", "addFilter", "removeFilter", "addOreFilter", "removeOreFilter"};
|
||||||
"setRadius",
|
|
||||||
"setMin",
|
|
||||||
"setMax",
|
|
||||||
"setReplace",
|
|
||||||
"addFilter",
|
|
||||||
"removeFilter",
|
|
||||||
"addOreFilter",
|
|
||||||
"removeOreFilter"
|
|
||||||
};
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getMethodNames() {
|
public String[] getMethodNames()
|
||||||
|
{
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object[] callMethod(IComputerAccess computer, ILuaContext context,
|
public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws Exception
|
||||||
int method, Object[] arguments) throws Exception {
|
{
|
||||||
if(arguments.length>0)
|
if(arguments.length > 0)
|
||||||
{
|
{
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
|
||||||
if(arguments[0] instanceof Double)
|
if(arguments[0] instanceof Double)
|
||||||
{
|
{
|
||||||
num = ((Double)arguments[0]).intValue();
|
num = ((Double)arguments[0]).intValue();
|
||||||
}
|
}
|
||||||
if(arguments[0] instanceof String&&(method!=6&&method!=7))
|
else if(arguments[0] instanceof String && (method != 6 && method != 7))
|
||||||
{
|
{
|
||||||
num = Integer.parseInt((String)arguments[0]);
|
num = Integer.parseInt((String)arguments[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(num!=0)
|
if(num != 0)
|
||||||
{
|
{
|
||||||
if(method==0)
|
if(method == 0)
|
||||||
{
|
{
|
||||||
this.radius=num;
|
radius = num;
|
||||||
}
|
}
|
||||||
if(method==1)
|
else if(method == 1)
|
||||||
{
|
{
|
||||||
this.minY=num;
|
minY = num;
|
||||||
}
|
}
|
||||||
if(method==2)
|
else if(method == 2)
|
||||||
{
|
{
|
||||||
this.maxY=num;
|
maxY = num;
|
||||||
}
|
}
|
||||||
if(method==3){
|
else if(method == 3)
|
||||||
//replace
|
{
|
||||||
int meta=0;
|
int meta = 0;
|
||||||
if(arguments.length>1){
|
|
||||||
if(arguments[1] instanceof Double)
|
if(arguments.length > 1)
|
||||||
{
|
{
|
||||||
num = ((Double)arguments[1]).intValue();
|
if(arguments[1] instanceof Double)
|
||||||
}
|
{
|
||||||
if(arguments[1] instanceof String)
|
num = ((Double)arguments[1]).intValue();
|
||||||
{
|
}
|
||||||
meta = Integer.parseInt((String)arguments[1]);
|
else if(arguments[1] instanceof String)
|
||||||
}
|
{
|
||||||
}
|
meta = Integer.parseInt((String)arguments[1]);
|
||||||
this.replaceStack=new ItemStack(num,1,meta);
|
}
|
||||||
}
|
}
|
||||||
if(method==4){
|
|
||||||
int meta=0;
|
replaceStack = new ItemStack(num, 1, meta);
|
||||||
|
}
|
||||||
if(arguments.length>1){
|
else if(method == 4)
|
||||||
if(arguments[1] instanceof Double)
|
{
|
||||||
{
|
int meta = 0;
|
||||||
meta = ((Double)arguments[1]).intValue();
|
|
||||||
}
|
if(arguments.length > 1)
|
||||||
if(arguments[1] instanceof String)
|
{
|
||||||
{
|
if(arguments[1] instanceof Double)
|
||||||
meta = Integer.parseInt((String)arguments[1]);
|
{
|
||||||
}
|
meta = ((Double)arguments[1]).intValue();
|
||||||
}
|
}
|
||||||
this.filters.add(new MItemStackFilter(new ItemStack(num,1,meta)));
|
else if(arguments[1] instanceof String)
|
||||||
}
|
{
|
||||||
if(method==5){
|
meta = Integer.parseInt((String)arguments[1]);
|
||||||
Iterator<MinerFilter> iter=this.filters.iterator();
|
}
|
||||||
while(iter.hasNext()){
|
}
|
||||||
MinerFilter filter=iter.next();
|
|
||||||
if(filter instanceof MItemStackFilter){
|
filters.add(new MItemStackFilter(new ItemStack(num, 1, meta)));
|
||||||
if(((MItemStackFilter) filter).itemType.itemID==num){
|
}
|
||||||
iter.remove();
|
else if(method == 5)
|
||||||
}
|
{
|
||||||
}
|
Iterator<MinerFilter> iter = filters.iterator();
|
||||||
}
|
|
||||||
}
|
while(iter.hasNext())
|
||||||
if(method==6){
|
{
|
||||||
String ore=(String) arguments[0];
|
MinerFilter filter = iter.next();
|
||||||
MOreDictFilter filter=new MOreDictFilter();
|
|
||||||
filter.oreDictName=ore;
|
if(filter instanceof MItemStackFilter)
|
||||||
filters.add(filter);
|
{
|
||||||
}
|
if(((MItemStackFilter)filter).itemType.itemID == num)
|
||||||
if(method==7){
|
{
|
||||||
|
iter.remove();
|
||||||
String ore=(String) arguments[0];
|
}
|
||||||
Iterator<MinerFilter> iter=this.filters.iterator();
|
}
|
||||||
while(iter.hasNext()){
|
}
|
||||||
MinerFilter filter=iter.next();
|
}
|
||||||
if(filter instanceof MOreDictFilter){
|
else if(method == 6)
|
||||||
if(((MOreDictFilter) filter).oreDictName==ore){
|
{
|
||||||
iter.remove();
|
String ore = (String)arguments[0];
|
||||||
}
|
MOreDictFilter filter = new MOreDictFilter();
|
||||||
}
|
|
||||||
}
|
filter.oreDictName = ore;
|
||||||
}
|
filters.add(filter);
|
||||||
}
|
}
|
||||||
}
|
else if(method == 7)
|
||||||
|
{
|
||||||
|
String ore = (String)arguments[0];
|
||||||
|
Iterator<MinerFilter> iter = filters.iterator();
|
||||||
|
|
||||||
|
while(iter.hasNext())
|
||||||
|
{
|
||||||
|
MinerFilter filter = iter.next();
|
||||||
|
|
||||||
|
if(filter instanceof MOreDictFilter)
|
||||||
|
{
|
||||||
|
if(((MOreDictFilter)filter).oreDictName == ore)
|
||||||
|
{
|
||||||
|
iter.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(EntityPlayer player : playersUsing)
|
for(EntityPlayer player : playersUsing)
|
||||||
{
|
{
|
||||||
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketTileEntity().setParams(Object3D.get(this), getGenericPacket(new ArrayList())), player);
|
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketTileEntity().setParams(Object3D.get(this), getGenericPacket(new ArrayList())), player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canAttachToSide(int side) {
|
public boolean canAttachToSide(int side)
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attach(IComputerAccess computer) {
|
public void attach(IComputerAccess computer) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void detach(IComputerAccess computer) {
|
public void detach(IComputerAccess computer) {}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
package mekanism.common.tileentity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import com.google.common.io.ByteArrayDataInput;
|
||||||
|
|
||||||
|
import mekanism.common.transporter.TransporterStack;
|
||||||
|
import mekanism.common.util.TransporterUtils;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
|
||||||
|
public class TileEntityDiversionTransporter extends TileEntityLogisticalTransporter
|
||||||
|
{
|
||||||
|
public int[] modes = {0, 0, 0, 0, 0, 0};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromNBT(NBTTagCompound nbtTags)
|
||||||
|
{
|
||||||
|
super.readFromNBT(nbtTags);
|
||||||
|
|
||||||
|
modes = nbtTags.getIntArray("modes");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToNBT(NBTTagCompound nbtTags)
|
||||||
|
{
|
||||||
|
super.writeToNBT(nbtTags);
|
||||||
|
|
||||||
|
nbtTags.setIntArray("modes", modes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handlePacketData(ByteArrayDataInput dataStream)
|
||||||
|
{
|
||||||
|
super.handlePacketData(dataStream);
|
||||||
|
|
||||||
|
modes[0] = dataStream.readInt();
|
||||||
|
modes[1] = dataStream.readInt();
|
||||||
|
modes[2] = dataStream.readInt();
|
||||||
|
modes[3] = dataStream.readInt();
|
||||||
|
modes[4] = 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,67 +0,0 @@
|
||||||
package mekanism.common.tileentity;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
|
||||||
|
|
||||||
import mekanism.common.transporter.TransporterStack;
|
|
||||||
import mekanism.common.util.TransporterUtils;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
|
|
||||||
public class TileEntityDivertionTransporter extends TileEntityLogisticalTransporter {
|
|
||||||
|
|
||||||
public int[] modes={0,0,0,0,0,0};
|
|
||||||
@Override
|
|
||||||
public void readFromNBT(NBTTagCompound nbtTags)
|
|
||||||
{
|
|
||||||
super.readFromNBT(nbtTags);
|
|
||||||
modes=nbtTags.getIntArray("modes");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToNBT(NBTTagCompound nbtTags)
|
|
||||||
{
|
|
||||||
super.writeToNBT(nbtTags);
|
|
||||||
nbtTags.setIntArray("modes", modes);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handlePacketData(ByteArrayDataInput dataStream)
|
|
||||||
{
|
|
||||||
super.handlePacketData(dataStream);
|
|
||||||
modes[0]=dataStream.readInt();
|
|
||||||
modes[1]=dataStream.readInt();
|
|
||||||
modes[2]=dataStream.readInt();
|
|
||||||
modes[3]=dataStream.readInt();
|
|
||||||
modes[4]=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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -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.TileEntityDivertionTransporter;
|
import mekanism.common.tileentity.TileEntityDiversionTransporter;
|
||||||
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;
|
||||||
|
@ -184,19 +184,26 @@ public final class TransporterPathfinder
|
||||||
|
|
||||||
if(tile != null)
|
if(tile != null)
|
||||||
{
|
{
|
||||||
//Check for logistical Diverter
|
|
||||||
TileEntity currTile = pointer.getTileEntity(worldObj);
|
TileEntity currTile = pointer.getTileEntity(worldObj);
|
||||||
if(currTile instanceof TileEntityDivertionTransporter){
|
|
||||||
int mode=((TileEntityDivertionTransporter) currTile).modes[side.ordinal()];
|
if(currTile instanceof TileEntityDiversionTransporter)
|
||||||
boolean redstone=currTile.worldObj.isBlockIndirectlyGettingPowered(currTile.xCoord, currTile.yCoord,currTile.zCoord);
|
{
|
||||||
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
|
int mode = ((TileEntityDiversionTransporter)currTile).modes[side.ordinal()];
|
||||||
|
boolean redstone = currTile.worldObj.isBlockIndirectlyGettingPowered(currTile.xCoord, currTile.yCoord, currTile.zCoord);
|
||||||
|
|
||||||
|
if((mode == 2 && redstone == true) || (mode == 1 && redstone == false))
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tile instanceof TileEntityDivertionTransporter){
|
|
||||||
int mode=((TileEntityDivertionTransporter) tile).modes[side.ordinal()];
|
if(tile instanceof TileEntityDiversionTransporter)
|
||||||
boolean redstone=tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord,tile.zCoord);
|
{
|
||||||
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
|
int mode = ((TileEntityDiversionTransporter)tile).modes[side.ordinal()];
|
||||||
|
boolean redstone = tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
|
|
||||||
|
if((mode == 2 && redstone == true) || (mode == 1 && redstone == false))
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.TileEntityDivertionTransporter;
|
import mekanism.common.tileentity.TileEntityDiversionTransporter;
|
||||||
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;
|
||||||
|
@ -85,18 +85,21 @@ public final class TransporterUtils
|
||||||
|
|
||||||
for(IInventory inventory : connectedInventories)
|
for(IInventory inventory : connectedInventories)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(inventory != null)
|
if(inventory != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
int side = Arrays.asList(connectedInventories).indexOf(inventory);
|
int side = Arrays.asList(connectedInventories).indexOf(inventory);
|
||||||
if(tileEntity instanceof TileEntityDivertionTransporter){
|
|
||||||
int mode=((TileEntityDivertionTransporter) tileEntity).modes[side];
|
if(tileEntity instanceof TileEntityDiversionTransporter)
|
||||||
boolean redstone=tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
{
|
||||||
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
|
int mode = ((TileEntityDiversionTransporter)tileEntity).modes[side];
|
||||||
|
boolean redstone = tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||||
|
|
||||||
|
if((mode == 2 && redstone == true) || (mode == 1 && redstone == false))
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ForgeDirection forgeSide = ForgeDirection.getOrientation(side).getOpposite();
|
ForgeDirection forgeSide = ForgeDirection.getOrientation(side).getOpposite();
|
||||||
|
|
||||||
//Immature BuildCraft inv check
|
//Immature BuildCraft inv check
|
||||||
|
@ -134,23 +137,26 @@ public final class TransporterUtils
|
||||||
{
|
{
|
||||||
if(tile != null)
|
if(tile != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
int side = Arrays.asList(connectedTransporters).indexOf(tile);
|
int side = Arrays.asList(connectedTransporters).indexOf(tile);
|
||||||
//Check for logistical Diverter
|
|
||||||
if(tileEntity instanceof TileEntityDivertionTransporter){
|
if(tileEntity instanceof TileEntityDiversionTransporter)
|
||||||
int mode=((TileEntityDivertionTransporter) tileEntity).modes[side];
|
{
|
||||||
boolean redstone=tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
int mode = ((TileEntityDiversionTransporter)tileEntity).modes[side];
|
||||||
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
|
boolean redstone = tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||||
|
|
||||||
|
if((mode == 2 && redstone == true) || (mode == 1 && redstone == false))
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check for logistical Diverter
|
if(tile instanceof TileEntityDiversionTransporter)
|
||||||
if(tile instanceof TileEntityDivertionTransporter){
|
{
|
||||||
int mode=((TileEntityDivertionTransporter) tile).modes[ForgeDirection.VALID_DIRECTIONS[side].getOpposite().ordinal()];
|
int mode = ((TileEntityDiversionTransporter)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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Loading…
Reference in a new issue