SHOW:
|
|
- or go back to the newest paste.
1 | - | public class ProperContainer extends Container { |
1 | + | package net.minecraft.server; |
2 | ||
3 | - | public ProperContainer(InventoryPlayer playerinv, IInventory holder, int[] coords){ |
3 | + | public abstract class ContainerNormal extends Container { |
4 | - | assert(coords.length %2 == 0); |
4 | + | public ProperContainer(InventoryPlayer playerinv, IInventory holder, int[][] coords) { |
5 | - | bind(this, playerinv); |
5 | + | bindPlayerInventory(playerinv); |
6 | setupSlots(holder, coords); | |
7 | - | int x, y; |
7 | + | } |
8 | - | for(int i=0; i!=coords.length; i+=2){ |
8 | + | |
9 | - | x= coords[i]; |
9 | + | public ProperContainer(InventoryPlayer playerinv) { |
10 | - | y= coords[i+1]; |
10 | + | bindPlayerInventory(playerinv); |
11 | } | |
12 | - | addSlotToContainer(new Slot(holder, i, x, y)); |
12 | + | |
13 | - | } |
13 | + | public void bindPlayerInventory(InventoryPlayer playerinv) { |
14 | - | } |
14 | + | for (int x = 0; x < 9; x++) { |
15 | - | @Override |
15 | + | addSlotToContainer(new Slot(playerinv, x, 8+x*18, 126)); |
16 | - | public boolean canInteractWith(EntityPlayer var1) {return true; } |
16 | + | } |
17 | ||
18 | - | public static void bind(ProperContainer cont, InventoryPlayer playerinv){ |
18 | + | for (int y = 0; y < 3; y++) { |
19 | - | for (int x = 0; x < 9; x++) { |
19 | + | for (int x = 0; x < 9; x++) { |
20 | - | cont.addSlotToContainer(new Slot(playerinv, x, 8+x*18, 126)); } |
20 | + | addSlotToContainer(new Slot(playerinv, y*9+x+9, 8+x*18, 68+y*18)); |
21 | } | |
22 | - | for (int y = 0; y < 3; y++) { |
22 | + | } |
23 | - | for (int x = 0; x < 9; x++) { |
23 | + | } |
24 | - | cont.addSlotToContainer(new Slot(playerinv, y*9+x+9, 8+x*18, 68+y*18)); } |
24 | + | |
25 | - | } |
25 | + | public void setupSlots(IInventory holder, int[][] coords) { |
26 | - | } |
26 | + | for(int i = 0; i < coords.length; i++) { |
27 | addSlotToContainer(new Slot(holder, i, coords[i][0], coords[i][1])); | |
28 | } | |
29 | } | |
30 | } |