Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package melonslise.runicinscription.common.container;
- import java.util.Arrays;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.inventory.Container;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.inventory.InventoryCraftResult;
- import net.minecraft.inventory.Slot;
- import net.minecraft.item.ItemStack;
- import net.minecraft.world.World;
- public class ContainerRuneInscription extends Container
- {
- public boolean grid[][] = new boolean[5][7];
- public IInventory craftResult;
- private World worldObj;
- private int posX;
- private int posY;
- private int posZ;
- public ContainerRuneInscription(InventoryPlayer inventoryPlayer, World world, int x, int y, int z)
- {
- this.craftResult = new InventoryCraftResult();
- this.worldObj = world;
- this.posX = x;
- this.posY = y;
- this.posZ = z;
- this.addSlotToContainer(new Slot(inventoryPlayer, 36, 8, 47));
- for (int i = 0; i < 3; ++i)
- {
- for (int k = 0; k < 9; ++k)
- {
- this.addSlotToContainer(new Slot(inventoryPlayer, k + i * 9 + 9, 8 + k * 18, 124 + i * 18));
- }
- }
- for (int i = 0; i < 9; ++i)
- {
- this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 182));
- }
- }
- public void updateGrid(boolean[][] grid)
- {
- grid = this.grid;
- }
- public void checkRecipes()
- {
- }
- public static boolean compare2DArray(Object[][] array1, Object[][] array2)
- {
- for (int index = 0; index < array1.length; index ++)
- {
- if (!Arrays.equals(array1[index], array2[index]))
- {
- return false;
- }
- }
- return true;
- }
- @Override
- public ItemStack transferStackInSlot(EntityPlayer player, int fromSlot)
- {
- return null;
- //On shift-click
- }
- public void onContainerClosed(EntityPlayer player)
- {
- super.onContainerClosed(player);
- for(int x = 0; x < 5; ++x)
- {
- for(int y = 0; y < 7; ++y)
- {
- grid[x][y] = false;
- }
- }
- //On closed
- }
- @Override
- public boolean canInteractWith(EntityPlayer player)
- {
- return true;
- }
- }
Add Comment
Please, Sign In to add comment