Change all containers init to IContainerProvider + Add Enum for gui ids handling
This commit is contained in:
parent
b93fe6c5ad
commit
eb220643fc
114 changed files with 2155 additions and 2025 deletions
|
@ -1,41 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotFake;
|
||||
import reborncore.client.gui.slots.SlotFluid;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileQuantumTank;
|
||||
|
||||
public class ContainerQuantumTank extends RebornContainer {
|
||||
public TileQuantumTank tileQuantumTank;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerQuantumTank(TileQuantumTank tileQuantumTank, EntityPlayer player) {
|
||||
super();
|
||||
this.tileQuantumTank = tileQuantumTank;
|
||||
this.player = player;
|
||||
|
||||
this.addSlotToContainer(new SlotFluid(tileQuantumTank.inventory, 0, 80, 17));
|
||||
this.addSlotToContainer(new SlotOutput(tileQuantumTank.inventory, 1, 80, 53));
|
||||
this.addSlotToContainer(new SlotFake(tileQuantumTank.inventory, 2, 59, 42, false, false, 1));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
|
||||
public interface IContainerProvider {
|
||||
BuiltContainer createContainer(EntityPlayer player);
|
||||
}
|
|
@ -2,24 +2,26 @@ package techreborn.client.container.builder.slot;
|
|||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
public class SpriteSlot extends FilteredSlot {
|
||||
|
||||
int stacksize;
|
||||
|
||||
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, String sprite, int stacksize) {
|
||||
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, final String sprite, final int stacksize) {
|
||||
super(inventory, index, xPosition, yPosition);
|
||||
this.setBackgroundLocation(new ResourceLocation(ModInfo.MOD_ID.toLowerCase() + ":textures/gui/slot_sprites/" + sprite + ".png"));
|
||||
this.setBackgroundLocation(
|
||||
new ResourceLocation(ModInfo.MOD_ID + ":textures/gui/slot_sprites/" + sprite + ".png"));
|
||||
this.stacksize = stacksize;
|
||||
}
|
||||
|
||||
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, String sprite) {
|
||||
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, final String sprite) {
|
||||
this(inventory, index, xPosition, yPosition, sprite, 64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return stacksize;
|
||||
return this.stacksize;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue