Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.scratchforfun.mod.gui;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- 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 net.minecraft.inventory.SlotFurnace;
- import net.minecraft.item.ItemStack;
- import net.scratchforfun.mod.tileentity.TileEntityQuartzFurnace;
- public class ContainerQuartzFurnace extends Container {
- private TileEntityQuartzFurnace quartzFurnace;
- public int lastBurnTime;
- public int lastItemBurnTime;
- public int lastCookTime;
- public ContainerQuartzFurnace(InventoryPlayer inventory, TileEntityQuartzFurnace tileentity){
- this.quartzFurnace = tileentity;
- this.addSlotToContainer(new Slot(tileentity, 0, 56, 17));
- this.addSlotToContainer(new Slot(tileentity, 1, 56, 53));
- this.addSlotToContainer(new SlotFurnace(inventory.player, tileentity, 2, 116, 35 ));
- for(int i = 0; i< 3; i++){
- for(int j = 0; j < 9; j++){
- this.addSlotToContainer(new Slot(inventory, j + i*9 + 9, 8 + j * 18, 84 + i * 18));
- }
- }
- for(int i = 0; i < 9; i++){
- this.addSlotToContainer(new Slot(inventory, i, 8 + i*18, 142));
- }
- }
- @Override
- public void addCraftingToCrafters(ICrafting icrafting){
- super.addCraftingToCrafters(icrafting);
- icrafting.sendProgressBarUpdate(this, 0, this.quartzFurnace.cookTime);
- icrafting.sendProgressBarUpdate(this, 1, this.quartzFurnace.burnTime);
- icrafting.sendProgressBarUpdate(this, 2, this.quartzFurnace.currentItemBurnTime);
- }
- public void detectAndSendChanges(){
- super.detectAndSendChanges();
- }
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int slot, int newValue){
- if(slot == 0) this.quartzFurnace.cookTime = newValue;
- if(slot == 1) this.quartzFurnace.burnTime = newValue;
- if(slot == 2) this.quartzFurnace.currentItemBurnTime = newValue;
- }
- public ItemStack transferStackInSlot(EntityPlayer player, int slot){
- return null;
- }
- @Override
- public boolean canInteractWith(EntityPlayer entityplayer) {
- return this.quartzFurnace.isUseableByPlayer(entityplayer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement