commit
5b690e9bfb
15 changed files with 334 additions and 16 deletions
|
@ -82,6 +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.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;
|
||||||
|
@ -107,6 +108,7 @@ import cpw.mods.fml.client.registry.ClientRegistry;
|
||||||
import cpw.mods.fml.client.registry.KeyBindingRegistry;
|
import cpw.mods.fml.client.registry.KeyBindingRegistry;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.common.registry.TickRegistry;
|
import cpw.mods.fml.common.registry.TickRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
@ -248,6 +250,8 @@ 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(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());
|
||||||
|
|
|
@ -16,7 +16,6 @@ import mekanism.common.miner.MOreDictFilter;
|
||||||
import mekanism.common.miner.MinerFilter;
|
import mekanism.common.miner.MinerFilter;
|
||||||
import mekanism.common.network.PacketDigitalMinerGui;
|
import mekanism.common.network.PacketDigitalMinerGui;
|
||||||
import mekanism.common.network.PacketDigitalMinerGui.MinerGuiPacket;
|
import mekanism.common.network.PacketDigitalMinerGui.MinerGuiPacket;
|
||||||
import mekanism.common.network.PacketSimpleGui;
|
|
||||||
import mekanism.common.network.PacketTileEntity;
|
import mekanism.common.network.PacketTileEntity;
|
||||||
import mekanism.common.tileentity.TileEntityDigitalMiner;
|
import mekanism.common.tileentity.TileEntityDigitalMiner;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -49,6 +49,10 @@ public class RenderLogisticalTransporter extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "RestrictiveTransporter.png"));
|
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "RestrictiveTransporter.png"));
|
||||||
}
|
}
|
||||||
|
else if(meta == 5)
|
||||||
|
{
|
||||||
|
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalDiverter.png"));
|
||||||
|
}
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||||
|
|
|
@ -38,6 +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.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;
|
||||||
|
@ -90,6 +91,8 @@ 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(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,6 +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.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;
|
||||||
|
@ -41,6 +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: Diversion Transporter
|
||||||
* @author AidanBrady
|
* @author AidanBrady
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -99,6 +101,7 @@ public class BlockTransmitter extends Block
|
||||||
list.add(new ItemStack(i, 1, 2));
|
list.add(new ItemStack(i, 1, 2));
|
||||||
list.add(new ItemStack(i, 1, 3));
|
list.add(new ItemStack(i, 1, 3));
|
||||||
list.add(new ItemStack(i, 1, 4));
|
list.add(new ItemStack(i, 1, 4));
|
||||||
|
list.add(new ItemStack(i, 1, 5));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -239,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)
|
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);
|
||||||
}
|
}
|
||||||
|
@ -371,6 +374,9 @@ public class BlockTransmitter extends Block
|
||||||
return new TileEntityLogisticalTransporter();
|
return new TileEntityLogisticalTransporter();
|
||||||
case 4:
|
case 4:
|
||||||
return new TileEntityLogisticalTransporter();
|
return new TileEntityLogisticalTransporter();
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
return new TileEntityDivertionTransporter();
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -16,6 +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.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;
|
||||||
|
@ -71,12 +72,35 @@ 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 TileEntityDivertionTransporter){
|
||||||
|
TileEntityDivertionTransporter transporter = (TileEntityDivertionTransporter)world.getBlockTileEntity(x, y, z);
|
||||||
|
int newMode=(transporter.modes[side]+1)%3;
|
||||||
|
transporter.modes[side]=newMode;
|
||||||
|
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;
|
||||||
|
}else{
|
||||||
TileEntityLogisticalTransporter transporter = (TileEntityLogisticalTransporter)world.getBlockTileEntity(x, y, z);
|
TileEntityLogisticalTransporter transporter = (TileEntityLogisticalTransporter)world.getBlockTileEntity(x, y, z);
|
||||||
TransporterUtils.incrementColor(transporter);
|
TransporterUtils.incrementColor(transporter);
|
||||||
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Object3D.get(transporter), transporter.getNetworkedData(new ArrayList())), Object3D.get(transporter), 50D);
|
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")));
|
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Color bumped to: " + (transporter.color != null ? transporter.color.getName() : EnumColor.BLACK + "None")));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if(world.getBlockTileEntity(x, y, z) instanceof TileEntityBin)
|
else if(world.getBlockTileEntity(x, y, z) instanceof TileEntityBin)
|
||||||
{
|
{
|
||||||
TileEntityBin bin = (TileEntityBin)world.getBlockTileEntity(x, y, z);
|
TileEntityBin bin = (TileEntityBin)world.getBlockTileEntity(x, y, z);
|
||||||
|
|
|
@ -10,7 +10,13 @@ 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();
|
||||||
|
this.itemType=item;
|
||||||
|
}
|
||||||
|
public MItemStackFilter(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean canFilter(ItemStack itemStack)
|
public boolean canFilter(ItemStack itemStack)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,7 @@ import ic2.api.energy.tile.IEnergySink;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -21,6 +22,8 @@ import mekanism.common.TileComponentUpgrade;
|
||||||
import mekanism.common.block.BlockMachine.MachineType;
|
import mekanism.common.block.BlockMachine.MachineType;
|
||||||
import mekanism.common.inventory.container.ContainerFilter;
|
import mekanism.common.inventory.container.ContainerFilter;
|
||||||
import mekanism.common.inventory.container.ContainerNull;
|
import mekanism.common.inventory.container.ContainerNull;
|
||||||
|
import mekanism.common.miner.MItemStackFilter;
|
||||||
|
import mekanism.common.miner.MOreDictFilter;
|
||||||
import mekanism.common.miner.MinerFilter;
|
import mekanism.common.miner.MinerFilter;
|
||||||
import mekanism.common.miner.ThreadMinerSearch;
|
import mekanism.common.miner.ThreadMinerSearch;
|
||||||
import mekanism.common.miner.ThreadMinerSearch.State;
|
import mekanism.common.miner.ThreadMinerSearch.State;
|
||||||
|
@ -44,8 +47,11 @@ import com.google.common.io.ByteArrayDataInput;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import dan200.computer.api.IComputerAccess;
|
||||||
|
import dan200.computer.api.ILuaContext;
|
||||||
|
import dan200.computer.api.IPeripheral;
|
||||||
|
|
||||||
public class TileEntityDigitalMiner extends TileEntityElectricBlock implements IEnergySink, IStrictEnergyAcceptor, IUpgradeTile, IRedstoneControl, IActiveState, IAdvancedBoundingBlock
|
public class TileEntityDigitalMiner extends TileEntityElectricBlock implements IPeripheral, IEnergySink, IStrictEnergyAcceptor, IUpgradeTile, IRedstoneControl, IActiveState, IAdvancedBoundingBlock
|
||||||
{
|
{
|
||||||
public List<Object3D> oresToMine = new ArrayList<Object3D>();
|
public List<Object3D> oresToMine = new ArrayList<Object3D>();
|
||||||
|
|
||||||
|
@ -1070,4 +1076,140 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return "Digital Miner";
|
||||||
|
}
|
||||||
|
public String[] names =
|
||||||
|
{
|
||||||
|
"setRadius",
|
||||||
|
"setMin",
|
||||||
|
"setMax",
|
||||||
|
"setReplace",
|
||||||
|
"addFilter",
|
||||||
|
"removeFilter",
|
||||||
|
"addOreFilter",
|
||||||
|
"removeOreFilter"
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
public String[] getMethodNames() {
|
||||||
|
return names;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] callMethod(IComputerAccess computer, ILuaContext context,
|
||||||
|
int method, Object[] arguments) throws Exception {
|
||||||
|
if(arguments.length>0)
|
||||||
|
{
|
||||||
|
int num = 0;
|
||||||
|
|
||||||
|
if(arguments[0] instanceof Double)
|
||||||
|
{
|
||||||
|
num = ((Double)arguments[0]).intValue();
|
||||||
|
}
|
||||||
|
if(arguments[0] instanceof String&&(method!=6&&method!=7))
|
||||||
|
{
|
||||||
|
num = Integer.parseInt((String)arguments[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(num!=0)
|
||||||
|
{
|
||||||
|
if(method==0)
|
||||||
|
{
|
||||||
|
this.radius=num;
|
||||||
|
}
|
||||||
|
if(method==1)
|
||||||
|
{
|
||||||
|
this.minY=num;
|
||||||
|
}
|
||||||
|
if(method==2)
|
||||||
|
{
|
||||||
|
this.maxY=num;
|
||||||
|
}
|
||||||
|
if(method==3){
|
||||||
|
//replace
|
||||||
|
int meta=0;
|
||||||
|
if(arguments.length>1){
|
||||||
|
if(arguments[1] instanceof Double)
|
||||||
|
{
|
||||||
|
num = ((Double)arguments[1]).intValue();
|
||||||
|
}
|
||||||
|
if(arguments[1] instanceof String)
|
||||||
|
{
|
||||||
|
meta = Integer.parseInt((String)arguments[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.replaceStack=new ItemStack(num,1,meta);
|
||||||
|
}
|
||||||
|
if(method==4){
|
||||||
|
int meta=0;
|
||||||
|
|
||||||
|
if(arguments.length>1){
|
||||||
|
if(arguments[1] instanceof Double)
|
||||||
|
{
|
||||||
|
meta = ((Double)arguments[1]).intValue();
|
||||||
|
}
|
||||||
|
if(arguments[1] instanceof String)
|
||||||
|
{
|
||||||
|
meta = Integer.parseInt((String)arguments[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.filters.add(new MItemStackFilter(new ItemStack(num,1,meta)));
|
||||||
|
}
|
||||||
|
if(method==5){
|
||||||
|
Iterator<MinerFilter> iter=this.filters.iterator();
|
||||||
|
while(iter.hasNext()){
|
||||||
|
MinerFilter filter=iter.next();
|
||||||
|
if(filter instanceof MItemStackFilter){
|
||||||
|
if(((MItemStackFilter) filter).itemType.itemID==num){
|
||||||
|
iter.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(method==6){
|
||||||
|
String ore=(String) arguments[0];
|
||||||
|
MOreDictFilter filter=new MOreDictFilter();
|
||||||
|
filter.oreDictName=ore;
|
||||||
|
filters.add(filter);
|
||||||
|
}
|
||||||
|
if(method==7){
|
||||||
|
|
||||||
|
String ore=(String) arguments[0];
|
||||||
|
Iterator<MinerFilter> iter=this.filters.iterator();
|
||||||
|
while(iter.hasNext()){
|
||||||
|
MinerFilter filter=iter.next();
|
||||||
|
if(filter instanceof MOreDictFilter){
|
||||||
|
if(((MOreDictFilter) filter).oreDictName==ore){
|
||||||
|
iter.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(EntityPlayer player : playersUsing)
|
||||||
|
{
|
||||||
|
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketTileEntity().setParams(Object3D.get(this), getGenericPacket(new ArrayList())), player);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canAttachToSide(int side) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void attach(IComputerAccess computer) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detach(IComputerAccess computer) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
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,6 +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.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;
|
||||||
|
@ -183,6 +184,23 @@ public final class TransporterPathfinder
|
||||||
|
|
||||||
if(tile != null)
|
if(tile != null)
|
||||||
{
|
{
|
||||||
|
//Check for logistical Diverter
|
||||||
|
TileEntity currTile = pointer.getTileEntity(worldObj);
|
||||||
|
if(currTile instanceof TileEntityDivertionTransporter){
|
||||||
|
int mode=((TileEntityDivertionTransporter) 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tile instanceof TileEntityDivertionTransporter){
|
||||||
|
int mode=((TileEntityDivertionTransporter) 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(Object3D.get(tile).equals(transportStack.originalLocation))
|
if(Object3D.get(tile).equals(transportStack.originalLocation))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -8,6 +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.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;
|
||||||
|
@ -84,9 +85,18 @@ 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];
|
||||||
|
boolean redstone=tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||||
|
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
ForgeDirection forgeSide = ForgeDirection.getOrientation(side).getOpposite();
|
ForgeDirection forgeSide = ForgeDirection.getOrientation(side).getOpposite();
|
||||||
|
|
||||||
//Immature BuildCraft inv check
|
//Immature BuildCraft inv check
|
||||||
|
@ -124,7 +134,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){
|
||||||
|
int mode=((TileEntityDivertionTransporter) tileEntity).modes[side];
|
||||||
|
boolean redstone=tileEntity.worldObj.isBlockIndirectlyGettingPowered(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||||
|
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check for logistical Diverter
|
||||||
|
if(tile instanceof TileEntityDivertionTransporter){
|
||||||
|
int mode=((TileEntityDivertionTransporter) tile).modes[ForgeDirection.VALID_DIRECTIONS[side].getOpposite().ordinal()];
|
||||||
|
boolean redstone=tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
|
if((mode==2&&redstone==true)||(mode==1&&redstone==false)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
connectable[side] = true;
|
connectable[side] = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
BIN
resources/assets/mekanism/render/LogisticalDiverter.png
Normal file
BIN
resources/assets/mekanism/render/LogisticalDiverter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
Loading…
Add table
Reference in a new issue