77de6e6353
Starting down the long road of making my mod even more compatable with other mod's liquids. This will take some time, patience, and pain killers. Plan of action *Release Valve will not store any liquids but rather direction output to pipes from other TileEntities *Release Valve will have a gui to restrict it to outputing one or more types of Liquids that are predefined *Pipes will go from being fully liquid restricted to color based(0-15) and have a universal uncolor pipe that can accept all liquids *Once a pipe is place a tool can be used to change its color just like in other mods. *Some colors will be restricted to select liquids for example Blue is water, Red is Lava, Black is oil, Yellow Fuel, White Milk, *Steam will have its own pipe made out of bronze to fit the machines it goes too. *Tanks will go in the same direction *Pumps will still be liquid restricted but come with unique textures, models, and animation per liquid type Current issues to resolve that are broken with push *Release valve doesn't work at all due to changes in progress *back compatable must be added for pipes and old release valves
54 lines
1.7 KiB
Java
54 lines
1.7 KiB
Java
package liquidmechanics.common.tileentity;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
import net.minecraft.inventory.Container;
|
|
import net.minecraft.inventory.Slot;
|
|
import net.minecraft.inventory.SlotFurnace;
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
public class ContainerReleaseValve extends Container
|
|
{
|
|
private TileEntityReleaseValve valve;
|
|
private int lastCookTime = 0;
|
|
private int lastBurnTime = 0;
|
|
private int lastItemBurnTime = 0;
|
|
|
|
public ContainerReleaseValve(InventoryPlayer par1InventoryPlayer, TileEntityReleaseValve par2TileEntityFurnace)
|
|
{
|
|
this.valve = par2TileEntityFurnace;
|
|
int var3;
|
|
|
|
for (var3 = 0; var3 < 3; ++var3)
|
|
{
|
|
for (int var4 = 0; var4 < 9; ++var4)
|
|
{
|
|
this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
|
|
}
|
|
}
|
|
|
|
for (var3 = 0; var3 < 9; ++var3)
|
|
{
|
|
this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return this.valve.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
* Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
return var3;
|
|
}
|
|
}
|