mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 20:42:35 +00:00
Add icons for liquid input and output slots
This commit is contained in:
1 parent
fd6958b637
commit
bf3e00c9e9
14 files changed
+61
-21
No files matched your search
@@ -15,14 +15,14 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import forestry.apiculture.inventory.InventoryHygroregulator;
|
||||
import forestry.apiculture.multiblock.TileAlvearyHygroregulator;
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
|
||||
public class ContainerAlvearyHygroregulator extends ContainerLiquidTanks<TileAlvearyHygroregulator> {
|
||||
|
||||
public ContainerAlvearyHygroregulator(InventoryPlayer playerInventory, TileAlvearyHygroregulator tile) {
|
||||
super(tile, playerInventory, 8, 84);
|
||||
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventoryHygroregulator.SLOT_INPUT, 56, 38));
|
||||
this.addSlotToContainer(new SlotLiquidIn(tile, InventoryHygroregulator.SLOT_INPUT, 56, 38));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,6 +13,7 @@ package forestry.core.gui;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
import forestry.core.gui.slots.SlotOutput;
|
||||
import forestry.core.gui.slots.SlotWorking;
|
||||
import forestry.core.inventory.InventoryAnalyzer;
|
||||
@@ -34,7 +35,7 @@ public class ContainerAnalyzer extends ContainerLiquidTanks<TileAnalyzer> {
|
||||
addSlotToContainer(new SlotWorking(tile, InventoryAnalyzer.SLOT_ANALYZE, 73, 59));
|
||||
|
||||
// Can slot
|
||||
addSlotToContainer(new SlotFiltered(tile, InventoryAnalyzer.SLOT_CAN, 143, 24));
|
||||
addSlotToContainer(new SlotLiquidIn(tile, InventoryAnalyzer.SLOT_CAN, 143, 24));
|
||||
|
||||
// Output buffer
|
||||
for (int i = 0; i < 2; i++) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package forestry.core.gui.slots;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import forestry.core.tiles.IFilterSlotDelegate;
|
||||
|
||||
public class SlotEmptyLiquidContainerIn extends SlotFiltered {
|
||||
public <T extends IInventory & IFilterSlotDelegate> SlotEmptyLiquidContainerIn(T inventory, int slotIndex, int xPos, int yPos) {
|
||||
super(inventory, slotIndex, xPos, yPos);
|
||||
setBackgroundTexture("slots/container");
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,9 @@ import forestry.core.tiles.IFilterSlotDelegate;
|
||||
* Slot which only takes specific items, specified by the IFilterSlotDelegate.
|
||||
*/
|
||||
public class SlotFiltered extends SlotWatched {
|
||||
private String blockedTexture = "slots/blocked";
|
||||
private final IFilterSlotDelegate filterSlotDelegate;
|
||||
private String backgroundTexture = null;
|
||||
private String blockedTexture = "slots/blocked";
|
||||
|
||||
public <T extends IInventory & IFilterSlotDelegate> SlotFiltered(T inventory, int slotIndex, int xPos, int yPos) {
|
||||
super(inventory, slotIndex, xPos, yPos);
|
||||
@@ -49,12 +50,19 @@ public class SlotFiltered extends SlotWatched {
|
||||
return this;
|
||||
}
|
||||
|
||||
public SlotFiltered setBackgroundTexture(String backgroundTexture) {
|
||||
this.backgroundTexture = backgroundTexture;
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public TextureAtlasSprite getBackgroundSprite() {
|
||||
ItemStack stack = getStack();
|
||||
if (!isItemValid(stack)) {
|
||||
return TextureManager.getInstance().getDefault(blockedTexture);
|
||||
} else if (backgroundTexture != null) {
|
||||
return TextureManager.getInstance().getDefault(backgroundTexture);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package forestry.core.gui.slots;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import forestry.core.tiles.IFilterSlotDelegate;
|
||||
|
||||
public class SlotLiquidIn extends SlotFiltered {
|
||||
public <T extends IInventory & IFilterSlotDelegate> SlotLiquidIn(T inventory, int slotIndex, int xPos, int yPos) {
|
||||
super(inventory, slotIndex, xPos, yPos);
|
||||
setBackgroundTexture("slots/liquid");
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
import forestry.energy.inventory.InventoryEngineBiogas;
|
||||
import forestry.energy.tiles.TileEngineBiogas;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ContainerEngineBiogas extends ContainerLiquidTanks<TileEngineBiogas
|
||||
public ContainerEngineBiogas(InventoryPlayer player, TileEngineBiogas engine) {
|
||||
super(engine, player, 8, 84);
|
||||
|
||||
this.addSlotToContainer(new SlotFiltered(engine, InventoryEngineBiogas.SLOT_CAN, 143, 40));
|
||||
this.addSlotToContainer(new SlotLiquidIn(engine, InventoryEngineBiogas.SLOT_CAN, 143, 40));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
import forestry.energy.inventory.InventoryGenerator;
|
||||
import forestry.energy.tiles.TileEuGenerator;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ContainerGenerator extends ContainerLiquidTanks<TileEuGenerator> {
|
||||
public ContainerGenerator(InventoryPlayer player, TileEuGenerator tile) {
|
||||
super(tile, player, 8, 84);
|
||||
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventoryGenerator.SLOT_CAN, 22, 38));
|
||||
this.addSlotToContainer(new SlotLiquidIn(tile, InventoryGenerator.SLOT_CAN, 22, 38));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,8 @@ package forestry.factory.gui;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotEmptyLiquidContainerIn;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
import forestry.core.gui.slots.SlotOutput;
|
||||
import forestry.factory.inventory.InventoryBottler;
|
||||
import forestry.factory.tiles.TileBottler;
|
||||
@@ -23,8 +24,8 @@ public class ContainerBottler extends ContainerLiquidTanks<TileBottler> {
|
||||
public ContainerBottler(InventoryPlayer player, TileBottler tile) {
|
||||
super(tile, player, 8, 84);
|
||||
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventoryBottler.SLOT_INPUT_EMPTY_CAN, 116, 19));
|
||||
this.addSlotToContainer(new SlotEmptyLiquidContainerIn(tile, InventoryBottler.SLOT_INPUT_EMPTY_CAN, 116, 19));
|
||||
this.addSlotToContainer(new SlotOutput(tile, InventoryBottler.SLOT_OUTPUT, 116, 55));
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventoryBottler.SLOT_INPUT_FULL_CAN, 26, 38));
|
||||
this.addSlotToContainer(new SlotLiquidIn(tile, InventoryBottler.SLOT_INPUT_FULL_CAN, 26, 38));
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.IContainerCrafting;
|
||||
import forestry.core.gui.slots.SlotCraftMatrix;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
import forestry.core.gui.slots.SlotLocked;
|
||||
import forestry.core.gui.slots.SlotOutput;
|
||||
import forestry.core.network.packets.PacketItemStackDisplay;
|
||||
@@ -38,7 +39,7 @@ public class ContainerCarpenter extends ContainerLiquidTanks<TileCarpenter> impl
|
||||
}
|
||||
|
||||
// Liquid Input
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventoryCarpenter.SLOT_CAN_INPUT, 120, 20));
|
||||
this.addSlotToContainer(new SlotLiquidIn(tile, InventoryCarpenter.SLOT_CAN_INPUT, 120, 20));
|
||||
// Boxes
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventoryCarpenter.SLOT_BOX, 83, 20));
|
||||
// Product
|
||||
|
||||
@@ -14,7 +14,9 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotEmptyLiquidContainerIn;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
import forestry.core.gui.slots.SlotOutput;
|
||||
import forestry.factory.inventory.InventoryFermenter;
|
||||
import forestry.factory.tiles.TileFermenter;
|
||||
@@ -27,8 +29,8 @@ public class ContainerFermenter extends ContainerLiquidTanks<TileFermenter> {
|
||||
this.addSlotToContainer(new SlotFiltered(fermenter, InventoryFermenter.SLOT_RESOURCE, 85, 23));
|
||||
this.addSlotToContainer(new SlotFiltered(fermenter, InventoryFermenter.SLOT_FUEL, 75, 57));
|
||||
this.addSlotToContainer(new SlotOutput(fermenter, InventoryFermenter.SLOT_CAN_OUTPUT, 150, 58));
|
||||
this.addSlotToContainer(new SlotFiltered(fermenter, InventoryFermenter.SLOT_CAN_INPUT, 150, 22));
|
||||
this.addSlotToContainer(new SlotFiltered(fermenter, InventoryFermenter.SLOT_INPUT, 10, 40));
|
||||
this.addSlotToContainer(new SlotEmptyLiquidContainerIn(fermenter, InventoryFermenter.SLOT_CAN_INPUT, 150, 22));
|
||||
this.addSlotToContainer(new SlotLiquidIn(fermenter, InventoryFermenter.SLOT_INPUT, 10, 40));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotEmptyLiquidContainerIn;
|
||||
import forestry.core.gui.slots.SlotOutput;
|
||||
import forestry.factory.inventory.InventoryRaintank;
|
||||
import forestry.factory.tiles.TileRaintank;
|
||||
@@ -24,7 +24,7 @@ public class ContainerRaintank extends ContainerLiquidTanks<TileRaintank> {
|
||||
public ContainerRaintank(InventoryPlayer player, TileRaintank tile) {
|
||||
super(tile, player, 8, 84);
|
||||
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventoryRaintank.SLOT_RESOURCE, 116, 19));
|
||||
this.addSlotToContainer(new SlotEmptyLiquidContainerIn(tile, InventoryRaintank.SLOT_RESOURCE, 116, 19));
|
||||
this.addSlotToContainer(new SlotOutput(tile, InventoryRaintank.SLOT_PRODUCT, 116, 55));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanksSocketed;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
import forestry.core.gui.slots.SlotOutput;
|
||||
import forestry.factory.inventory.InventorySqueezer;
|
||||
import forestry.factory.tiles.TileSqueezer;
|
||||
@@ -34,7 +35,7 @@ public class ContainerSqueezer extends ContainerLiquidTanksSocketed<TileSqueezer
|
||||
this.addSlotToContainer(new SlotOutput(tile, InventorySqueezer.SLOT_REMNANT, 97, 60));
|
||||
|
||||
// Can slot
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventorySqueezer.SLOT_CAN_INPUT, 147, 24));
|
||||
this.addSlotToContainer(new SlotLiquidIn(tile, InventorySqueezer.SLOT_CAN_INPUT, 147, 24));
|
||||
// Output slot
|
||||
this.addSlotToContainer(new SlotOutput(tile, InventorySqueezer.SLOT_CAN_OUTPUT, 147, 60));
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ package forestry.factory.gui;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import forestry.core.gui.ContainerLiquidTanks;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotEmptyLiquidContainerIn;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
import forestry.core.gui.slots.SlotOutput;
|
||||
import forestry.factory.inventory.InventoryStill;
|
||||
import forestry.factory.tiles.TileStill;
|
||||
@@ -24,7 +25,7 @@ public class ContainerStill extends ContainerLiquidTanks<TileStill> {
|
||||
super(tile, player, 8, 84);
|
||||
|
||||
this.addSlotToContainer(new SlotOutput(tile, InventoryStill.SLOT_PRODUCT, 150, 54));
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventoryStill.SLOT_RESOURCE, 150, 18));
|
||||
this.addSlotToContainer(new SlotFiltered(tile, InventoryStill.SLOT_CAN, 10, 36));
|
||||
this.addSlotToContainer(new SlotEmptyLiquidContainerIn(tile, InventoryStill.SLOT_RESOURCE, 150, 18));
|
||||
this.addSlotToContainer(new SlotLiquidIn(tile, InventoryStill.SLOT_CAN, 10, 36));
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
import forestry.core.gui.ContainerSocketed;
|
||||
import forestry.core.gui.slots.SlotFiltered;
|
||||
import forestry.core.gui.slots.SlotLiquidIn;
|
||||
import forestry.core.gui.slots.SlotOutput;
|
||||
import forestry.core.network.packets.PacketGuiUpdate;
|
||||
import forestry.farming.multiblock.InventoryFarm;
|
||||
@@ -57,7 +58,7 @@ public class ContainerFarm extends ContainerSocketed<TileFarm> {
|
||||
// Fertilizer
|
||||
addSlotToContainer(new SlotFiltered(tile, InventoryFarm.SLOT_FERTILIZER, 63, 95));
|
||||
// Can Slot
|
||||
addSlotToContainer(new SlotFiltered(tile, InventoryFarm.SLOT_CAN, 15, 95));
|
||||
addSlotToContainer(new SlotLiquidIn(tile, InventoryFarm.SLOT_CAN, 15, 95));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user