Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.arucraft.container;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.inventory.Container;
- import net.minecraft.inventory.ICrafting;
- import net.minecraft.inventory.Slot;
- import com.arucraft.slot.SlotAlloyOven;
- import com.arucraft.tileentity.TileEntityAlloyOven;
- public class ContainerAlloyOven extends Container {
- private TileEntityAlloyOven oven;
- private int tripCookTime;
- private int tripPower;
- private int lastItemBurnTime;
- public ContainerAlloyOven(InventoryPlayer invPlayer, TileEntityAlloyOven teAlloyOven) {
- tripCookTime = 0;
- tripPower = 0;
- lastItemBurnTime = 0;
- oven = teAlloyOven;
- this.addSlotToContainer(new Slot(teAlloyOven, 0, 44, 16));
- this.addSlotToContainer(new Slot(teAlloyOven, 1, 44, 35));
- this.addSlotToContainer(new Slot(teAlloyOven, 2, 44, 54));
- this.addSlotToContainer(new Slot(teAlloyOven, 3, 8, 55));
- this.addSlotToContainer(new SlotAlloyOven(invPlayer.player, teAlloyOven, 4, 124, 35));
- //Inventory
- for(int i = 0; i < 3; i++) {
- for(int j = 0; j < 9; j++) {
- this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
- }
- }
- //ActionBar
- for(int i = 0; i < 9; i++) {
- this.addSlotToContainer(new Slot(invPlayer, 8, 8 + i * 18, 142));
- }
- }
- public void addCraftingToCrafters (ICrafting icraft) {
- super.addCraftingToCrafters(icraft);
- icraft.sendProgressBarUpdate(this, 0, this.oven.tripCooktime);
- icraft.sendProgressBarUpdate(this, 1, this.oven.tripPower);
- }
- @Override
- public boolean canInteractWith(EntityPlayer player) {
- return oven.isUseableByPlayer(player);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment