More dropper work

This commit is contained in:
Aidan C. Brady 2015-02-26 20:50:02 -05:00
parent 49d0a7fc4b
commit c39e3d1c1f
45 changed files with 260 additions and 77 deletions

View file

@ -18,7 +18,7 @@ public class GuiAmbientAccumulator extends GuiMekanism
public GuiAmbientAccumulator(EntityPlayer player, TileEntityAmbientAccumulator tile) public GuiAmbientAccumulator(EntityPlayer player, TileEntityAmbientAccumulator tile)
{ {
super(new ContainerNull(player, tile)); super(tile, new ContainerNull(player, tile));
tileEntity = tile; tileEntity = tile;
guiElements.add(new GuiGasGauge(new IGasInfoHandler() { guiElements.add(new GuiGasGauge(new IGasInfoHandler() {

View file

@ -40,7 +40,7 @@ public class GuiDigitalMiner extends GuiMekanism
public GuiDigitalMiner(InventoryPlayer inventory, TileEntityDigitalMiner tentity) public GuiDigitalMiner(InventoryPlayer inventory, TileEntityDigitalMiner tentity)
{ {
super(new ContainerDigitalMiner(inventory, tentity)); super(tentity, new ContainerDigitalMiner(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"))); guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));

View file

@ -58,7 +58,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
public GuiDigitalMinerConfig(EntityPlayer player, TileEntityDigitalMiner tentity) public GuiDigitalMinerConfig(EntityPlayer player, TileEntityDigitalMiner tentity)
{ {
super(new ContainerNull(player, tentity)); super(tentity, new ContainerNull(player, tentity));
tileEntity = tentity; tileEntity = tentity;
} }

View file

@ -22,7 +22,7 @@ public class GuiDynamicTank extends GuiMekanism
public GuiDynamicTank(InventoryPlayer inventory, TileEntityDynamicTank tentity) public GuiDynamicTank(InventoryPlayer inventory, TileEntityDynamicTank tentity)
{ {
super(new ContainerDynamicTank(inventory, tentity)); super(tentity, new ContainerDynamicTank(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiContainerEditMode(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDynamicTank.png"))); guiElements.add(new GuiContainerEditMode(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDynamicTank.png")));
} }

View file

@ -32,7 +32,7 @@ public class GuiElectricChest extends GuiMekanism
public GuiElectricChest(InventoryPlayer inventory, TileEntityElectricChest tentity) public GuiElectricChest(InventoryPlayer inventory, TileEntityElectricChest tentity)
{ {
super(new ContainerElectricChest(inventory, tentity, null, true)); super(tentity, new ContainerElectricChest(inventory, tentity, null, true));
xSize+=26; xSize+=26;
ySize+=64; ySize+=64;

View file

@ -25,7 +25,7 @@ public class GuiElectricPump extends GuiMekanism
public GuiElectricPump(InventoryPlayer inventory, TileEntityElectricPump tentity) public GuiElectricPump(InventoryPlayer inventory, TileEntityElectricPump tentity)
{ {
super(new ContainerElectricPump(inventory, tentity)); super(tentity, new ContainerElectricPump(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 19)); guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 19));

View file

@ -35,7 +35,7 @@ public class GuiElectrolyticSeparator extends GuiMekanism
public GuiElectrolyticSeparator(InventoryPlayer inventory, TileEntityElectrolyticSeparator tentity) public GuiElectrolyticSeparator(InventoryPlayer inventory, TileEntityElectrolyticSeparator tentity)
{ {
super(new ContainerElectrolyticSeparator(inventory, tentity)); super(tentity, new ContainerElectrolyticSeparator(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;

View file

@ -26,7 +26,7 @@ public class GuiEnergyCube extends GuiMekanism
public GuiEnergyCube(InventoryPlayer inventory, TileEntityEnergyCube tentity) public GuiEnergyCube(InventoryPlayer inventory, TileEntityEnergyCube tentity)
{ {
super(new ContainerEnergyCube(inventory, tentity)); super(tentity, new ContainerEnergyCube(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"))); guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png")));
guiElements.add(new GuiEnergyGauge(new IEnergyInfoHandler() guiElements.add(new GuiEnergyGauge(new IEnergyInfoHandler()

View file

@ -29,7 +29,7 @@ public class GuiEntangledBlock extends GuiMekanism
public GuiEntangledBlock(InventoryPlayer inventory, TileEntityEntangledBlock tentity) public GuiEntangledBlock(InventoryPlayer inventory, TileEntityEntangledBlock tentity)
{ {
super(new ContainerNull(inventory.player, tentity)); super(tentity, new ContainerNull(inventory.player, tentity));
tileEntity = tentity; tileEntity = tentity;
isCreative = inventory.player.capabilities.isCreativeMode; isCreative = inventory.player.capabilities.isCreativeMode;
} }

View file

@ -11,6 +11,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.FluidTank;
import scala.actors.threadpool.Arrays;
public class GuiFluidGauge extends GuiGauge<Fluid> public class GuiFluidGauge extends GuiGauge<Fluid>
{ {
@ -36,11 +37,11 @@ public class GuiFluidGauge extends GuiGauge<Fluid>
{ {
if(guiObj instanceof GuiMekanism) if(guiObj instanceof GuiMekanism)
{ {
TileEntity tile = ((GuiMekanism)guiObj).tileEntity; TileEntity tile = ((GuiMekanism)guiObj).getTileEntity();
if(tile instanceof IDropperHandler) if(tile instanceof IDropperHandler)
{ {
int index = ((IDropperHandler)tile).getTankId(infoHandler.getTank()); int index = Arrays.asList(((IDropperHandler)tile).getTanks()).indexOf(infoHandler.getTank());
if(index != -1) if(index != -1)
{ {

View file

@ -26,7 +26,7 @@ public class GuiFluidicPlenisher extends GuiMekanism
public GuiFluidicPlenisher(InventoryPlayer inventory, TileEntityFluidicPlenisher tentity) public GuiFluidicPlenisher(InventoryPlayer inventory, TileEntityFluidicPlenisher tentity)
{ {
super(new ContainerFluidicPlenisher(inventory, tentity)); super(tentity, new ContainerFluidicPlenisher(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 19)); guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 19));

View file

@ -5,12 +5,12 @@ import mekanism.api.gas.Gas;
import mekanism.api.gas.GasTank; import mekanism.api.gas.GasTank;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.base.IDropperHandler; import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IRedstoneControl.RedstoneControl;
import mekanism.common.network.PacketDropperUse.DropperUseMessage; import mekanism.common.network.PacketDropperUse.DropperUseMessage;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import scala.actors.threadpool.Arrays;
public class GuiGasGauge extends GuiGauge<Gas> public class GuiGasGauge extends GuiGauge<Gas>
{ {
@ -34,16 +34,20 @@ public class GuiGasGauge extends GuiGauge<Gas>
@Override @Override
public void mouseClicked(int xAxis, int yAxis, int button) public void mouseClicked(int xAxis, int yAxis, int button)
{ {
System.out.println("clicked");
if(guiObj instanceof GuiMekanism) if(guiObj instanceof GuiMekanism)
{ {
TileEntity tile = ((GuiMekanism)guiObj).tileEntity; System.out.println("mekanism");
TileEntity tile = ((GuiMekanism)guiObj).getTileEntity();
System.out.println(tile);
if(tile instanceof IDropperHandler) if(tile instanceof IDropperHandler)
{ {
int index = ((IDropperHandler)tile).getTankId(infoHandler.getTank()); System.out.println("handler");
int index = Arrays.asList(((IDropperHandler)tile).getTanks()).indexOf(infoHandler.getTank());
if(index != -1) if(index != -1)
{ {
System.out.println("sending " + index);
Mekanism.packetHandler.sendToServer(new DropperUseMessage(Coord4D.get(tile), button, index)); Mekanism.packetHandler.sendToServer(new DropperUseMessage(Coord4D.get(tile), button, index));
} }
} }

View file

@ -22,7 +22,7 @@ public class GuiGasTank extends GuiMekanism
public GuiGasTank(InventoryPlayer inventory, TileEntityGasTank tentity) public GuiGasTank(InventoryPlayer inventory, TileEntityGasTank tentity)
{ {
super(new ContainerGasTank(inventory, tentity)); super(tentity, new ContainerGasTank(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiGasTank.png"))); guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiGasTank.png")));
} }

View file

@ -33,7 +33,7 @@ public class GuiLaserAmplifier extends GuiMekanism
public GuiLaserAmplifier(InventoryPlayer inventory, TileEntityLaserAmplifier tentity) public GuiLaserAmplifier(InventoryPlayer inventory, TileEntityLaserAmplifier tentity)
{ {
super(new ContainerLaserAmplifier(inventory, tentity)); super(tentity, new ContainerLaserAmplifier(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiNumberGauge(new INumberInfoHandler() guiElements.add(new GuiNumberGauge(new INumberInfoHandler()

View file

@ -54,7 +54,7 @@ public class GuiLogisticalSorter extends GuiMekanism
public GuiLogisticalSorter(EntityPlayer player, TileEntityLogisticalSorter tentity) public GuiLogisticalSorter(EntityPlayer player, TileEntityLogisticalSorter tentity)
{ {
super(new ContainerNull(player, tentity)); super(tentity, new ContainerNull(player, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiLogisticalSorter.png"))); guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiLogisticalSorter.png")));
} }

View file

@ -24,7 +24,7 @@ public class GuiMFilterSelect extends GuiMekanism
public GuiMFilterSelect(EntityPlayer player, TileEntityDigitalMiner tentity) public GuiMFilterSelect(EntityPlayer player, TileEntityDigitalMiner tentity)
{ {
super(new ContainerNull(player, tentity)); super(tentity, new ContainerNull(player, tentity));
tileEntity = tentity; tileEntity = tentity;
} }

View file

@ -44,7 +44,7 @@ public class GuiMItemStackFilter extends GuiMekanism
public GuiMItemStackFilter(EntityPlayer player, TileEntityDigitalMiner tentity, int index) public GuiMItemStackFilter(EntityPlayer player, TileEntityDigitalMiner tentity, int index)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
origFilter = (MItemStackFilter)tileEntity.filters.get(index); origFilter = (MItemStackFilter)tileEntity.filters.get(index);
@ -53,7 +53,7 @@ public class GuiMItemStackFilter extends GuiMekanism
public GuiMItemStackFilter(EntityPlayer player, TileEntityDigitalMiner tentity) public GuiMItemStackFilter(EntityPlayer player, TileEntityDigitalMiner tentity)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
isNew = true; isNew = true;

View file

@ -44,7 +44,7 @@ public class GuiMMaterialFilter extends GuiMekanism
public GuiMMaterialFilter(EntityPlayer player, TileEntityDigitalMiner tentity, int index) public GuiMMaterialFilter(EntityPlayer player, TileEntityDigitalMiner tentity, int index)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
origFilter = (MMaterialFilter)tileEntity.filters.get(index); origFilter = (MMaterialFilter)tileEntity.filters.get(index);
@ -53,7 +53,7 @@ public class GuiMMaterialFilter extends GuiMekanism
public GuiMMaterialFilter(EntityPlayer player, TileEntityDigitalMiner tentity) public GuiMMaterialFilter(EntityPlayer player, TileEntityDigitalMiner tentity)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
isNew = true; isNew = true;

View file

@ -58,7 +58,7 @@ public class GuiMModIDFilter extends GuiMekanism
public GuiMModIDFilter(EntityPlayer player, TileEntityDigitalMiner tentity, int index) public GuiMModIDFilter(EntityPlayer player, TileEntityDigitalMiner tentity, int index)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
origFilter = (MModIDFilter)tileEntity.filters.get(index); origFilter = (MModIDFilter)tileEntity.filters.get(index);
@ -69,7 +69,7 @@ public class GuiMModIDFilter extends GuiMekanism
public GuiMModIDFilter(EntityPlayer player, TileEntityDigitalMiner tentity) public GuiMModIDFilter(EntityPlayer player, TileEntityDigitalMiner tentity)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
isNew = true; isNew = true;

View file

@ -58,7 +58,7 @@ public class GuiMOreDictFilter extends GuiMekanism
public GuiMOreDictFilter(EntityPlayer player, TileEntityDigitalMiner tentity, int index) public GuiMOreDictFilter(EntityPlayer player, TileEntityDigitalMiner tentity, int index)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
origFilter = (MOreDictFilter)tileEntity.filters.get(index); origFilter = (MOreDictFilter)tileEntity.filters.get(index);
@ -69,7 +69,7 @@ public class GuiMOreDictFilter extends GuiMekanism
public GuiMOreDictFilter(EntityPlayer player, TileEntityDigitalMiner tentity) public GuiMOreDictFilter(EntityPlayer player, TileEntityDigitalMiner tentity)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
isNew = true; isNew = true;

View file

@ -23,7 +23,7 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
{ {
public Set<GuiElement> guiElements = new HashSet<GuiElement>(); public Set<GuiElement> guiElements = new HashSet<GuiElement>();
public TileEntityContainerBlock tileEntity; private TileEntityContainerBlock tileEntity;
public GuiMekanism(Container container) public GuiMekanism(Container container)
{ {
@ -78,6 +78,11 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
} }
} }
public TileEntityContainerBlock getTileEntity()
{
return tileEntity;
}
private SideData getFromSlot(Slot slot) private SideData getFromSlot(Slot slot)
{ {
if(slot.slotNumber < tileEntity.getSizeInventory()) if(slot.slotNumber < tileEntity.getSizeInventory())

View file

@ -22,7 +22,7 @@ public class GuiPortableTank extends GuiMekanism
public GuiPortableTank(InventoryPlayer inventory, TileEntityPortableTank tentity) public GuiPortableTank(InventoryPlayer inventory, TileEntityPortableTank tentity)
{ {
super(new ContainerPortableTank(inventory, tentity)); super(tentity, new ContainerPortableTank(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiContainerEditMode(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"))); guiElements.add(new GuiContainerEditMode(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() guiElements.add(new GuiFluidGauge(new IFluidInfoHandler()

View file

@ -35,7 +35,7 @@ public class GuiRotaryCondensentrator extends GuiMekanism
public GuiRotaryCondensentrator(InventoryPlayer inventory, TileEntityRotaryCondensentrator tentity) public GuiRotaryCondensentrator(InventoryPlayer inventory, TileEntityRotaryCondensentrator tentity)
{ {
super(new ContainerRotaryCondensentrator(inventory, tentity)); super(tentity, new ContainerRotaryCondensentrator(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"))); guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png")));

View file

@ -24,7 +24,7 @@ public class GuiSolarNeutronActivator extends GuiMekanism
public GuiSolarNeutronActivator(InventoryPlayer inventory, TileEntitySolarNeutronActivator tentity) public GuiSolarNeutronActivator(InventoryPlayer inventory, TileEntitySolarNeutronActivator tentity)
{ {
super(new ContainerSolarNeutronActivator(inventory, tentity)); super(tentity, new ContainerSolarNeutronActivator(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"))); guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));

View file

@ -24,7 +24,7 @@ public class GuiTFilterSelect extends GuiMekanism
public GuiTFilterSelect(EntityPlayer player, TileEntityLogisticalSorter tentity) public GuiTFilterSelect(EntityPlayer player, TileEntityLogisticalSorter tentity)
{ {
super(new ContainerNull(player, tentity)); super(tentity, new ContainerNull(player, tentity));
tileEntity = tentity; tileEntity = tentity;
} }

View file

@ -47,7 +47,7 @@ public class GuiTItemStackFilter extends GuiMekanism
public GuiTItemStackFilter(EntityPlayer player, TileEntityLogisticalSorter tentity, int index) public GuiTItemStackFilter(EntityPlayer player, TileEntityLogisticalSorter tentity, int index)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
origFilter = (TItemStackFilter)tileEntity.filters.get(index); origFilter = (TItemStackFilter)tileEntity.filters.get(index);
@ -56,7 +56,7 @@ public class GuiTItemStackFilter extends GuiMekanism
public GuiTItemStackFilter(EntityPlayer player, TileEntityLogisticalSorter tentity) public GuiTItemStackFilter(EntityPlayer player, TileEntityLogisticalSorter tentity)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
isNew = true; isNew = true;

View file

@ -46,7 +46,7 @@ public class GuiTMaterialFilter extends GuiMekanism
public GuiTMaterialFilter(EntityPlayer player, TileEntityLogisticalSorter tentity, int index) public GuiTMaterialFilter(EntityPlayer player, TileEntityLogisticalSorter tentity, int index)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
origFilter = (TMaterialFilter)tileEntity.filters.get(index); origFilter = (TMaterialFilter)tileEntity.filters.get(index);
@ -55,7 +55,7 @@ public class GuiTMaterialFilter extends GuiMekanism
public GuiTMaterialFilter(EntityPlayer player, TileEntityLogisticalSorter tentity) public GuiTMaterialFilter(EntityPlayer player, TileEntityLogisticalSorter tentity)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
isNew = true; isNew = true;

View file

@ -57,7 +57,7 @@ public class GuiTModIDFilter extends GuiMekanism
public GuiTModIDFilter(EntityPlayer player, TileEntityLogisticalSorter tentity, int index) public GuiTModIDFilter(EntityPlayer player, TileEntityLogisticalSorter tentity, int index)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
origFilter = (TModIDFilter)tileEntity.filters.get(index); origFilter = (TModIDFilter)tileEntity.filters.get(index);
@ -68,7 +68,7 @@ public class GuiTModIDFilter extends GuiMekanism
public GuiTModIDFilter(EntityPlayer player, TileEntityLogisticalSorter tentity) public GuiTModIDFilter(EntityPlayer player, TileEntityLogisticalSorter tentity)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
isNew = true; isNew = true;

View file

@ -57,7 +57,7 @@ public class GuiTOreDictFilter extends GuiMekanism
public GuiTOreDictFilter(EntityPlayer player, TileEntityLogisticalSorter tentity, int index) public GuiTOreDictFilter(EntityPlayer player, TileEntityLogisticalSorter tentity, int index)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
origFilter = (TOreDictFilter)tileEntity.filters.get(index); origFilter = (TOreDictFilter)tileEntity.filters.get(index);
@ -68,7 +68,7 @@ public class GuiTOreDictFilter extends GuiMekanism
public GuiTOreDictFilter(EntityPlayer player, TileEntityLogisticalSorter tentity) public GuiTOreDictFilter(EntityPlayer player, TileEntityLogisticalSorter tentity)
{ {
super(new ContainerFilter(player.inventory, tentity)); super(tentity, new ContainerFilter(player.inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
isNew = true; isNew = true;

View file

@ -24,7 +24,7 @@ public class GuiTeleporter extends GuiMekanism
public GuiTeleporter(InventoryPlayer inventory, TileEntityTeleporter tentity) public GuiTeleporter(InventoryPlayer inventory, TileEntityTeleporter tentity)
{ {
super(new ContainerTeleporter(inventory, tentity)); super(tentity, new ContainerTeleporter(inventory, tentity));
tileEntity = tentity; tileEntity = tentity;
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiTeleporter.png"), 164, 15)); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiTeleporter.png"), 164, 15));

View file

@ -1,10 +1,92 @@
package mekanism.common.base; package mekanism.common.base;
import mekanism.api.gas.GasStack;
import mekanism.api.gas.GasTank;
import mekanism.common.item.ItemGaugeDropper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
public interface IDropperHandler public interface IDropperHandler
{ {
public int getTankId(Object tank); public Object[] getTanks();
public void useDropper(EntityPlayer player, int tankId); public static class DropperHandler
{
public static void useDropper(EntityPlayer player, Object tank, int button)
{
ItemStack stack = player.inventory.getItemStack();
ItemGaugeDropper dropper = (ItemGaugeDropper)stack.getItem();
System.out.println("use dropper " + player + " " + tank + " " + button + " " + stack);
if(stack != null)
{
if(tank instanceof GasTank)
{
GasTank gasTank = (GasTank)tank;
int dropperStored = dropper.getGas(stack) != null ? dropper.getGas(stack).amount : 0;
if(dropper.getGas(stack) != null && !dropper.getGas(stack).isGasEqual(gasTank.getGas()))
{
return;
}
if(button == 0) //Insert gas into dropper
{
if(dropper.getFluid(stack) != null || gasTank.getGas() == null)
{
return;
}
int toInsert = Math.min(gasTank.getStored(), ItemGaugeDropper.CAPACITY-dropperStored);
GasStack drawn = gasTank.draw(toInsert, true);
dropper.setGas(stack, new GasStack(gasTank.getGasType(), dropperStored+(drawn != null ? drawn.amount : 0)));
}
else { //Extract gas from dropper
if(dropper.getFluid(stack) != null || gasTank.getNeeded() == 0)
{
return;
}
int toExtract = Math.min(gasTank.getNeeded(), dropperStored);
toExtract = gasTank.receive(new GasStack(dropper.getGas(stack).getGas(), toExtract), true);
dropper.setGas(stack, new GasStack(dropper.getGas(stack).getGas(), dropperStored-toExtract));
}
}
else if(tank instanceof FluidTank)
{
FluidTank fluidTank = (FluidTank)tank;
int dropperStored = dropper.getFluid(stack) != null ? dropper.getFluid(stack).amount : 0;
if(dropper.getFluid(stack) != null && !dropper.getFluid(stack).isFluidEqual(fluidTank.getFluid()))
{
return;
}
if(button == 0) //Insert fluid into dropper
{
if(dropper.getGas(stack) != null || fluidTank.getFluid() == null)
{
return;
}
int toInsert = Math.min(fluidTank.getFluidAmount(), ItemGaugeDropper.CAPACITY-dropperStored);
FluidStack drawn = fluidTank.drain(toInsert, true);
dropper.setFluid(stack, new FluidStack(fluidTank.getFluid().getFluid(), dropperStored+(drawn != null ? drawn.amount : 0)));
}
else { //Extract fluid from dropper
if(dropper.getGas(stack) != null || fluidTank.getCapacity()-fluidTank.getFluidAmount() == 0)
{
return;
}
int toExtract = Math.min(fluidTank.getCapacity()-fluidTank.getFluidAmount(), dropperStored);
toExtract = fluidTank.fill(new FluidStack(dropper.getFluid(stack).getFluid(), toExtract), true);
dropper.setFluid(stack, new FluidStack(dropper.getFluid(stack).getFluid(), dropperStored-toExtract));
}
}
}
}
}
} }

View file

@ -4,6 +4,7 @@ import io.netty.buffer.ByteBuf;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.common.PacketHandler; import mekanism.common.PacketHandler;
import mekanism.common.base.IDropperHandler; import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IDropperHandler.DropperHandler;
import mekanism.common.network.PacketDropperUse.DropperUseMessage; import mekanism.common.network.PacketDropperUse.DropperUseMessage;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessage;
@ -20,7 +21,12 @@ public class PacketDropperUse implements IMessageHandler<DropperUseMessage, IMes
if(tileEntity instanceof IDropperHandler) if(tileEntity instanceof IDropperHandler)
{ {
try { try {
((IDropperHandler)tileEntity).useDropper(PacketHandler.getPlayer(context), message.tankId); Object tank = ((IDropperHandler)tileEntity).getTanks()[message.tankId];
if(tank != null)
{
DropperHandler.useDropper(PacketHandler.getPlayer(context), tank, message.mouseButton);
}
} catch(Exception e) { } catch(Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View file

@ -1,5 +1,7 @@
package mekanism.common.tile; package mekanism.common.tile;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
@ -17,6 +19,7 @@ import mekanism.api.gas.ITubeConnection;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.SideData; import mekanism.common.SideData;
import mekanism.common.Upgrade; import mekanism.common.Upgrade;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IEjector; import mekanism.common.base.IEjector;
import mekanism.common.base.IInvConfiguration; import mekanism.common.base.IInvConfiguration;
import mekanism.common.base.IRedstoneControl; import mekanism.common.base.IRedstoneControl;
@ -32,7 +35,6 @@ import mekanism.common.tile.component.TileComponentUpgrade;
import mekanism.common.util.ChargeUtils; import mekanism.common.util.ChargeUtils;
import mekanism.common.util.InventoryUtils; import mekanism.common.util.InventoryUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -41,9 +43,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidRegistry;
import io.netty.buffer.ByteBuf; public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, IInvConfiguration, IUpgradeTile, ISustainedData, IDropperHandler
public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, IInvConfiguration, IUpgradeTile, ISustainedData
{ {
public static final int MAX_GAS = 10000; public static final int MAX_GAS = 10000;
@ -507,4 +507,10 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY); maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY);
} }
} }
@Override
public Object[] getTanks()
{
return new Object[] {inputTank};
}
} }

View file

@ -1,5 +1,7 @@
package mekanism.common.tile; package mekanism.common.tile;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
@ -15,6 +17,7 @@ import mekanism.api.gas.IGasItem;
import mekanism.api.gas.ITubeConnection; import mekanism.api.gas.ITubeConnection;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.Upgrade; import mekanism.common.Upgrade;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IRedstoneControl; import mekanism.common.base.IRedstoneControl;
import mekanism.common.base.ISustainedData; import mekanism.common.base.ISustainedData;
import mekanism.common.base.IUpgradeTile; import mekanism.common.base.IUpgradeTile;
@ -32,9 +35,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import io.netty.buffer.ByteBuf;
public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IGasHandler, IUpgradeTile, ISustainedData public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IGasHandler, IUpgradeTile, ISustainedData, IDropperHandler
{ {
public GasTank injectTank = new GasTank(MAX_GAS); public GasTank injectTank = new GasTank(MAX_GAS);
public GasTank outputTank = new GasTank(MAX_GAS); public GasTank outputTank = new GasTank(MAX_GAS);
@ -468,4 +470,10 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY); maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY);
} }
} }
@Override
public Object[] getTanks()
{
return new Object[] {injectTank, outputTank};
}
} }

View file

@ -19,6 +19,7 @@ import mekanism.api.gas.ITubeConnection;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.Upgrade; import mekanism.common.Upgrade;
import mekanism.common.Upgrade.IUpgradeInfoHandler; import mekanism.common.Upgrade.IUpgradeInfoHandler;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IRedstoneControl; import mekanism.common.base.IRedstoneControl;
import mekanism.common.base.ISustainedData; import mekanism.common.base.ISustainedData;
import mekanism.common.base.IUpgradeTile; import mekanism.common.base.IUpgradeTile;
@ -38,7 +39,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISustainedData, IUpgradeTile, IUpgradeInfoHandler public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISustainedData, IUpgradeTile, IUpgradeInfoHandler, IDropperHandler
{ {
public GasTank leftTank = new GasTank(MAX_GAS); public GasTank leftTank = new GasTank(MAX_GAS);
public GasTank rightTank = new GasTank(MAX_GAS); public GasTank rightTank = new GasTank(MAX_GAS);
@ -540,4 +541,10 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
{ {
return upgrade == Upgrade.SPEED ? upgrade.getExpScaledInfo(this) : upgrade.getMultScaledInfo(this); return upgrade == Upgrade.SPEED ? upgrade.getExpScaledInfo(this) : upgrade.getMultScaledInfo(this);
} }
@Override
public Object[] getTanks()
{
return new Object[] {leftTank, rightTank, centerTank};
}
} }

View file

@ -1,5 +1,7 @@
package mekanism.common.tile; package mekanism.common.tile;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
@ -14,6 +16,7 @@ import mekanism.api.gas.IGasItem;
import mekanism.api.gas.ITubeConnection; import mekanism.api.gas.ITubeConnection;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.Upgrade; import mekanism.common.Upgrade;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IRedstoneControl; import mekanism.common.base.IRedstoneControl;
import mekanism.common.base.ISustainedData; import mekanism.common.base.ISustainedData;
import mekanism.common.base.IUpgradeTile; import mekanism.common.base.IUpgradeTile;
@ -26,15 +29,12 @@ import mekanism.common.tile.component.TileComponentUpgrade;
import mekanism.common.util.ChargeUtils; import mekanism.common.util.ChargeUtils;
import mekanism.common.util.InventoryUtils; import mekanism.common.util.InventoryUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import io.netty.buffer.ByteBuf; public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IUpgradeTile, ISustainedData, IDropperHandler
public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IUpgradeTile, ISustainedData
{ {
public GasTank gasTank = new GasTank(MAX_GAS); public GasTank gasTank = new GasTank(MAX_GAS);
@ -389,4 +389,10 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY); maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY);
} }
} }
@Override
public Object[] getTanks()
{
return new Object[] {gasTank};
}
} }

View file

@ -19,6 +19,7 @@ import mekanism.api.gas.ITubeConnection;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.Upgrade; import mekanism.common.Upgrade;
import mekanism.common.Upgrade.IUpgradeInfoHandler; import mekanism.common.Upgrade.IUpgradeInfoHandler;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IRedstoneControl; import mekanism.common.base.IRedstoneControl;
import mekanism.common.base.ISustainedData; import mekanism.common.base.ISustainedData;
import mekanism.common.base.IUpgradeTile; import mekanism.common.base.IUpgradeTile;
@ -48,7 +49,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler; import net.minecraftforge.fluids.IFluidHandler;
public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, IFluidHandler, IUpgradeTile, ISustainedData, IUpgradeInfoHandler public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, IFluidHandler, IUpgradeTile, ISustainedData, IUpgradeInfoHandler, IDropperHandler
{ {
public FluidTank fluidTank = new FluidTank(MAX_FLUID); public FluidTank fluidTank = new FluidTank(MAX_FLUID);
public GasTank inputTank = new GasTank(MAX_GAS); public GasTank inputTank = new GasTank(MAX_GAS);
@ -656,4 +657,10 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
{ {
return upgrade == Upgrade.SPEED ? upgrade.getExpScaledInfo(this) : upgrade.getMultScaledInfo(this); return upgrade == Upgrade.SPEED ? upgrade.getExpScaledInfo(this) : upgrade.getMultScaledInfo(this);
} }
@Override
public Object[] getTanks()
{
return new Object[] {fluidTank, inputTank, outputTank};
}
} }

View file

@ -1,5 +1,7 @@
package mekanism.common.tile; package mekanism.common.tile;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -11,20 +13,16 @@ import mekanism.common.base.IFluidContainerManager;
import mekanism.common.content.tank.SynchronizedTankData; import mekanism.common.content.tank.SynchronizedTankData;
import mekanism.common.content.tank.SynchronizedTankData.ValveData; import mekanism.common.content.tank.SynchronizedTankData.ValveData;
import mekanism.common.content.tank.TankUpdateProtocol; import mekanism.common.content.tank.TankUpdateProtocol;
import mekanism.common.multiblock.IMultiblock;
import mekanism.common.multiblock.MultiblockManager; import mekanism.common.multiblock.MultiblockManager;
import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.network.PacketTileEntity.TileEntityMessage;
import mekanism.common.util.FluidContainerUtils; import mekanism.common.util.FluidContainerUtils;
import mekanism.common.util.FluidContainerUtils.ContainerEditMode; import mekanism.common.util.FluidContainerUtils.ContainerEditMode;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidContainerItem;
import io.netty.buffer.ByteBuf;
public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTankData> implements IFluidContainerManager public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTankData> implements IFluidContainerManager
{ {
/** A client-sided and server-sided map of valves on this tank's structure, used on the client for rendering fluids. */ /** A client-sided and server-sided map of valves on this tank's structure, used on the client for rendering fluids. */

View file

@ -15,6 +15,7 @@ import mekanism.api.EnumColor;
import mekanism.api.IConfigurable; import mekanism.api.IConfigurable;
import mekanism.api.MekanismConfig.usage; import mekanism.api.MekanismConfig.usage;
import mekanism.common.Upgrade; import mekanism.common.Upgrade;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IRedstoneControl; import mekanism.common.base.IRedstoneControl;
import mekanism.common.base.ISustainedTank; import mekanism.common.base.ISustainedTank;
import mekanism.common.base.IUpgradeTile; import mekanism.common.base.IUpgradeTile;
@ -39,7 +40,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler; import net.minecraftforge.fluids.IFluidHandler;
public class TileEntityElectricPump extends TileEntityElectricBlock implements IFluidHandler, ISustainedTank, IConfigurable, IRedstoneControl, IUpgradeTile public class TileEntityElectricPump extends TileEntityElectricBlock implements IFluidHandler, ISustainedTank, IConfigurable, IRedstoneControl, IUpgradeTile, IDropperHandler
{ {
/** This pump's tank */ /** This pump's tank */
public FluidTank fluidTank = new FluidTank(10000); public FluidTank fluidTank = new FluidTank(10000);
@ -512,4 +513,10 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
{ {
return upgradeComponent; return upgradeComponent;
} }
@Override
public Object[] getTanks()
{
return new Object[] {fluidTank};
}
} }

View file

@ -3,6 +3,7 @@ package mekanism.common.tile;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.api.Range4D; import mekanism.api.Range4D;
@ -16,6 +17,8 @@ import mekanism.api.gas.IGasItem;
import mekanism.api.gas.ITubeConnection; import mekanism.api.gas.ITubeConnection;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.Upgrade; import mekanism.common.Upgrade;
import mekanism.common.Upgrade.IUpgradeInfoHandler;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.ISustainedData; import mekanism.common.base.ISustainedData;
import mekanism.common.base.IUpgradeTile; import mekanism.common.base.IUpgradeTile;
import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.block.BlockMachine.MachineType;
@ -50,7 +53,7 @@ import dan200.computercraft.api.peripheral.IComputerAccess;
import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.api.peripheral.IPeripheral;
@Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") @Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft")
public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock implements IFluidHandler, IPeripheral, ITubeConnection, ISustainedData, IGasHandler, IUpgradeTile public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock implements IFluidHandler, IPeripheral, ITubeConnection, ISustainedData, IGasHandler, IUpgradeTile, IUpgradeInfoHandler, IDropperHandler
{ {
/** This separator's water slot. */ /** This separator's water slot. */
public FluidTank fluidTank = new FluidTank(24000); public FluidTank fluidTank = new FluidTank(24000);
@ -710,4 +713,16 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY); maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY);
} }
} }
@Override
public List<String> getInfo(Upgrade upgrade)
{
return upgrade == Upgrade.SPEED ? upgrade.getExpScaledInfo(this) : upgrade.getMultScaledInfo(this);
}
@Override
public Object[] getTanks()
{
return new Object[] {fluidTank, leftTank, rightTank};
}
} }

View file

@ -1,5 +1,7 @@
package mekanism.common.tile; package mekanism.common.tile;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map; import java.util.Map;
@ -13,6 +15,7 @@ import mekanism.api.gas.GasTank;
import mekanism.api.gas.IGasHandler; import mekanism.api.gas.IGasHandler;
import mekanism.api.gas.ITubeConnection; import mekanism.api.gas.ITubeConnection;
import mekanism.common.SideData; import mekanism.common.SideData;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.ISustainedData; import mekanism.common.base.ISustainedData;
import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.item.ItemUpgrade; import mekanism.common.item.ItemUpgrade;
@ -26,7 +29,6 @@ import mekanism.common.util.ChargeUtils;
import mekanism.common.util.InventoryUtils; import mekanism.common.util.InventoryUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import mekanism.common.util.PipeUtils; import mekanism.common.util.PipeUtils;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -39,14 +41,11 @@ import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler; import net.minecraftforge.fluids.IFluidHandler;
import cpw.mods.fml.common.Optional.Method; import cpw.mods.fml.common.Optional.Method;
import io.netty.buffer.ByteBuf;
import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.ILuaContext;
import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.lua.LuaException;
import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IComputerAccess;
public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, PressurizedProducts, PressurizedRecipe> implements IFluidHandler, IGasHandler, ITubeConnection, ISustainedData public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, PressurizedProducts, PressurizedRecipe> implements IFluidHandler, IGasHandler, ITubeConnection, ISustainedData, IDropperHandler
{ {
public FluidTank inputFluidTank = new FluidTank(10000); public FluidTank inputFluidTank = new FluidTank(10000);
public GasTank inputGasTank = new GasTank(10000); public GasTank inputGasTank = new GasTank(10000);
@ -430,4 +429,10 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
inputGasTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("inputGasTank"))); inputGasTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("inputGasTank")));
outputGasTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("outputGasTank"))); outputGasTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("outputGasTank")));
} }
@Override
public Object[] getTanks()
{
return new Object[] {inputFluidTank, inputGasTank, outputGasTank};
}
} }

View file

@ -1,5 +1,7 @@
package mekanism.common.tile; package mekanism.common.tile;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
@ -9,6 +11,7 @@ import mekanism.api.Range4D;
import mekanism.api.gas.IGasItem; import mekanism.api.gas.IGasItem;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.base.IActiveState; import mekanism.common.base.IActiveState;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IFluidContainerManager; import mekanism.common.base.IFluidContainerManager;
import mekanism.common.base.ISustainedTank; import mekanism.common.base.ISustainedTank;
import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.network.PacketTileEntity.TileEntityMessage;
@ -16,7 +19,6 @@ import mekanism.common.util.FluidContainerUtils;
import mekanism.common.util.FluidContainerUtils.ContainerEditMode; import mekanism.common.util.FluidContainerUtils.ContainerEditMode;
import mekanism.common.util.InventoryUtils; import mekanism.common.util.InventoryUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -31,9 +33,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler; import net.minecraftforge.fluids.IFluidHandler;
import io.netty.buffer.ByteBuf; public class TileEntityPortableTank extends TileEntityContainerBlock implements IActiveState, IConfigurable, IFluidHandler, ISustainedTank, IFluidContainerManager, IDropperHandler
public class TileEntityPortableTank extends TileEntityContainerBlock implements IActiveState, IConfigurable, IFluidHandler, ISustainedTank, IFluidContainerManager
{ {
public boolean isActive; public boolean isActive;
@ -608,4 +608,10 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
{ {
editMode = mode; editMode = mode;
} }
@Override
public Object[] getTanks()
{
return new Object[] {fluidTank};
}
} }

View file

@ -19,6 +19,7 @@ import mekanism.common.Mekanism;
import mekanism.common.Upgrade; import mekanism.common.Upgrade;
import mekanism.common.Upgrade.IUpgradeInfoHandler; import mekanism.common.Upgrade.IUpgradeInfoHandler;
import mekanism.common.base.IActiveState; import mekanism.common.base.IActiveState;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IRedstoneControl; import mekanism.common.base.IRedstoneControl;
import mekanism.common.base.ISustainedData; import mekanism.common.base.ISustainedData;
import mekanism.common.base.IUpgradeTile; import mekanism.common.base.IUpgradeTile;
@ -43,7 +44,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler; import net.minecraftforge.fluids.IFluidHandler;
public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock implements IActiveState, ISustainedData, IFluidHandler, IGasHandler, ITubeConnection, IRedstoneControl, IUpgradeTile, IUpgradeInfoHandler public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock implements IActiveState, ISustainedData, IFluidHandler, IGasHandler, ITubeConnection, IRedstoneControl, IUpgradeTile, IUpgradeInfoHandler, IDropperHandler
{ {
public GasTank gasTank = new GasTank(MAX_FLUID); public GasTank gasTank = new GasTank(MAX_FLUID);
@ -651,4 +652,10 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
{ {
return upgrade == Upgrade.SPEED ? upgrade.getExpScaledInfo(this) : upgrade.getMultScaledInfo(this); return upgrade == Upgrade.SPEED ? upgrade.getExpScaledInfo(this) : upgrade.getMultScaledInfo(this);
} }
@Override
public Object[] getTanks()
{
return new Object[] {gasTank, fluidTank};
}
} }

View file

@ -8,10 +8,10 @@ import java.util.Set;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.api.ISalinationSolar; import mekanism.api.ISalinationSolar;
import mekanism.api.MekanismConfig.usage;
import mekanism.api.Range4D; import mekanism.api.Range4D;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.base.IActiveState; import mekanism.common.base.IActiveState;
import mekanism.common.base.IDropperHandler;
import mekanism.common.content.tank.TankUpdateProtocol; import mekanism.common.content.tank.TankUpdateProtocol;
import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.network.PacketTileEntity.TileEntityMessage;
import mekanism.common.recipe.RecipeHandler; import mekanism.common.recipe.RecipeHandler;
@ -33,7 +33,7 @@ import net.minecraftforge.fluids.FluidTank;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
public class TileEntitySolarEvaporationController extends TileEntitySolarEvaporationBlock implements IActiveState public class TileEntitySolarEvaporationController extends TileEntitySolarEvaporationBlock implements IActiveState, IDropperHandler
{ {
public static final int MAX_OUTPUT = 10000; public static final int MAX_OUTPUT = 10000;
public static final int MAX_SOLARS = 4; public static final int MAX_SOLARS = 4;
@ -802,4 +802,10 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
{ {
return false; return false;
} }
@Override
public Object[] getTanks()
{
return new Object[] {inputTank, outputTank};
}
} }

View file

@ -15,6 +15,7 @@ import mekanism.api.gas.ITubeConnection;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.base.IActiveState; import mekanism.common.base.IActiveState;
import mekanism.common.base.IBoundingBlock; import mekanism.common.base.IBoundingBlock;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.IRedstoneControl; import mekanism.common.base.IRedstoneControl;
import mekanism.common.base.ISustainedData; import mekanism.common.base.ISustainedData;
import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.network.PacketTileEntity.TileEntityMessage;
@ -23,7 +24,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock implements IRedstoneControl, IBoundingBlock, IGasHandler, ITubeConnection, IActiveState, ISustainedData public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock implements IRedstoneControl, IBoundingBlock, IGasHandler, ITubeConnection, IActiveState, ISustainedData, IDropperHandler
{ {
public GasTank inputTank = new GasTank(MAX_GAS); public GasTank inputTank = new GasTank(MAX_GAS);
public GasTank outputTank = new GasTank(MAX_GAS); public GasTank outputTank = new GasTank(MAX_GAS);
@ -251,4 +252,10 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
{ {
return true; return true;
} }
@Override
public Object[] getTanks()
{
return new Object[] {inputTank, outputTank};
}
} }