mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-21 20:42:26 +00:00
A new start. Clean out mantle and copy in stuff from tcon and whatever made sense from the old version
This commit is contained in:
1 parent
dd29c42654
commit
bf8988ec62
128 files changed
+3389
-5654
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package slimeknights.mantle.inventory;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import slimeknights.mantle.tileentity.TileInventory;
|
||||
|
||||
public class ContainerSimpleChest extends BaseContainer<TileInventory> {
|
||||
|
||||
public ContainerSimpleChest(TileInventory tile, int rows, int columns, InventoryPlayer playerInventory) {
|
||||
super(tile);
|
||||
|
||||
int index = 0;
|
||||
|
||||
// chest inventory
|
||||
for(int i = 0; i < rows; ++i) {
|
||||
for(int j = 0; j < columns; ++j) {
|
||||
// safety
|
||||
if(index > tile.getSizeInventory()) {
|
||||
break;
|
||||
}
|
||||
|
||||
this.addSlotToContainer(createSlot(tile, index, 8 + j * 18, 18 + i * 18));
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// player inventory
|
||||
addPlayerInventory(playerInventory, 17, 86);
|
||||
}
|
||||
|
||||
protected Slot createSlot(IInventory inventory, int index, int x, int y) {
|
||||
return new Slot(inventory, index, x, y);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user