Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.skcraft.creditvendor.tileentity.TileEntityVendingMachine;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.inventory.Container;
- import net.minecraft.inventory.Slot;
- import net.minecraft.item.ItemStack;
- public class ContainerVendingMachine extends Container {
- public static TileEntityVendingMachine vendingMachine;
- public ContainerVendingMachine( InventoryPlayer inventoryPlayer, TileEntityVendingMachine vendingMachine ) {
- this.vendingMachine = vendingMachine;
- for( int x = 0; x < 9; x++ ) {
- addSlotToContainer( new Slot( inventoryPlayer, x, 8 + ( 18 * x ), 134 ) );
- }
- for( int y = 0; y < 3; y++ ) {
- for( int x = 0; x < 9; x++ ) {
- addSlotToContainer( new Slot( inventoryPlayer, x + ( y * 9 ) + 9, 8 + ( 18 * x ), 76 + ( y * 18 ) ) );
- }
- }
- for( int y = 0; y < 3; y++ ) {
- for( int x = 0; x < 3; x ++ ) {
- addSlotToContainer( new SlotVendingMachine( vendingMachine, x + ( y * 3 ), 8 + ( 18 * x ), 18 + ( y * 18 ) ) );
- }
- }
- for( int y = 0; y < 3; y++ ) {
- for( int x = 0; x < 3; x ++ ) {
- addSlotToContainer( new SlotVendingMachine( vendingMachine, x + ( y * 3 ) + 9, 116 + ( 18 * x ), 18 + ( y * 18 ) ) );
- }
- }
- addSlotToContainer( new SlotVendingMachine( vendingMachine, 18, 66, 18 ) );
- addSlotToContainer( new SlotVendingMachine( vendingMachine, 19, 94, 54 ) );
- }
- @Override
- public boolean canInteractWith( EntityPlayer entityPlayer ) {
- return vendingMachine.isUseableByPlayer( entityPlayer );
- }
- @Override
- public ItemStack transferStackInSlot( EntityPlayer entityPlayer, int slot ) {
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement