IInventory > IItemHandler
Most things should work, but havent been tested Slot config will not work just yet
This commit is contained in:
parent
8cac9a9315
commit
3444c05c40
32 changed files with 241 additions and 213 deletions
|
@ -50,13 +50,13 @@ public class GuiDigitalChest extends GuiBase {
|
|||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!this.digitalChest.storedItem.isEmpty() && this.digitalChest.getStackInSlot(1) != null) {
|
||||
if (!this.digitalChest.storedItem.isEmpty() && !this.digitalChest.inventory.getStackInSlot(1).isEmpty()) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43,
|
||||
this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(),
|
||||
this.digitalChest.storedItem.getCount() + this.digitalChest.inventory.getStackInSlot(1).getCount(),
|
||||
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||
}
|
||||
if (this.digitalChest.storedItem.isEmpty() && this.digitalChest.getStackInSlot(1) != null) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.digitalChest.getStackInSlot(1).getCount(),
|
||||
if (this.digitalChest.storedItem.isEmpty() && !this.digitalChest.inventory.getStackInSlot(1).isEmpty()) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.digitalChest.inventory.getStackInSlot(1).getCount(),
|
||||
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,11 +50,11 @@ public class GuiQuantumChest extends GuiBase {
|
|||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!this.quantumChest.storedItem.isEmpty() && this.quantumChest.getStackInSlot(1) != null) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.storedItem.getCount() + this.quantumChest.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||
if (!this.quantumChest.storedItem.isEmpty() && !this.quantumChest.inventory.getStackInSlot(1).isEmpty()) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.storedItem.getCount() + this.quantumChest.inventory.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||
}
|
||||
if (this.quantumChest.storedItem.isEmpty() && this.quantumChest.getStackInSlot(1) != null) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||
if (this.quantumChest.storedItem.isEmpty() && !this.quantumChest.inventory.getStackInSlot(1).isEmpty()) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.inventory.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class GuiSlotConfiguration {
|
|||
if (guiBase.tile != slot.inventory) {
|
||||
continue;
|
||||
}
|
||||
ConfigSlotElement slotElement = new ConfigSlotElement(guiBase.getMachine(), slot.getSlotIndex(), SlotType.NORMAL, slot.xPos - guiBase.guiLeft + 50, slot.yPos - guiBase.guiTop - 25, guiBase);
|
||||
ConfigSlotElement slotElement = new ConfigSlotElement(guiBase.getMachine().getInventoryForTile().get(), slot.getSlotIndex(), SlotType.NORMAL, slot.xPos - guiBase.guiLeft + 50, slot.yPos - guiBase.guiTop - 25, guiBase);
|
||||
slotElementMap.put(slot.getSlotIndex(), slotElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import techreborn.client.gui.GuiBase;
|
||||
|
@ -41,13 +41,13 @@ import java.util.List;
|
|||
|
||||
public class ConfigSlotElement extends ElementBase {
|
||||
SlotType type;
|
||||
IInventory inventory;
|
||||
IItemHandler inventory;
|
||||
int id;
|
||||
public List<ElementBase> elements = new ArrayList<>();
|
||||
boolean filter = false;
|
||||
|
||||
|
||||
public ConfigSlotElement(IInventory slotInventory, int slotId, SlotType type, int x, int y, GuiBase gui) {
|
||||
public ConfigSlotElement(IItemHandler slotInventory, int slotId, SlotType type, int x, int y, GuiBase gui) {
|
||||
super(x, y, type.getButtonSprite());
|
||||
this.type = type;
|
||||
this.inventory = slotInventory;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue