Posted June 19, 201510 yr Hi, I have a problem with my custom GUI. Here is my TileNuclearBoiler: package com.mod.gui.boiler; import java.util.Arrays; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagIntArray; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.IChatComponent; import net.minecraft.util.MathHelper; import net.minecraft.world.EnumSkyBlock; import com.mod.block.NCBlock; import com.mod.main.NuclearCraft; /** * User: brandon3055 Date: 06/01/2015 * * TileInventorySmelting is an advanced sided inventory that works like a * vanilla furnace except that it has 5 input and output slots, 4 fuel slots and * cooks at up to four times the speed. The input slots are used sequentially * rather than in parallel, i.e. the first slot cooks, then the second, then the * third, etc The fuel slots are used in parallel. The more slots burning in * parallel, the faster the cook time. The code is heavily based on * TileEntityFurnace. */ public class TileNuclearBoiler extends TileEntity implements IInventory, IUpdatePlayerListBox { // Create and initialize the itemStacks variable that will store store the // itemStacks public static final Item[] itemList = { NuclearCraft.uraniumIngot, Item.getItemFromBlock(NuclearCraft.uraniumBlock) }; public static final Item[] validFuels = { Items.lava_bucket }; public static final int FUEL_SLOTS_COUNT = 1; public static final int INPUT_SLOTS_COUNT = 1; public static final int OUTPUT_SLOTS_COUNT = 1; public static final int TOTAL_SLOTS_COUNT = FUEL_SLOTS_COUNT + INPUT_SLOTS_COUNT + OUTPUT_SLOTS_COUNT; public static final int FIRST_FUEL_SLOT = 0; public static final int FIRST_INPUT_SLOT = FIRST_FUEL_SLOT + FUEL_SLOTS_COUNT; public static final int FIRST_OUTPUT_SLOT = FIRST_INPUT_SLOT + INPUT_SLOTS_COUNT; private ItemStack[] itemStacks = new ItemStack[TOTAL_SLOTS_COUNT]; /** The number of burn ticks remaining on the current piece of fuel */ private int[] burnTimeRemaining = new int[FUEL_SLOTS_COUNT]; /** * The initial fuel value of the currently burning fuel (in ticks of burn * duration) */ private int[] burnTimeInitialValue = new int[FUEL_SLOTS_COUNT]; /** The number of ticks the current item has been cooking */ private short cookTime; /** The number of ticks required to cook an item */ private static final short COOK_TIME_FOR_COMPLETION = 800; // vanilla value // is 200 = 10 // seconds private int cachedNumberOfBurningSlots = -1; /** * Returns the amount of fuel remaining on the currently burning item in the * given fuel slot. * * @fuelSlot the number of the fuel slot (0..3) * @return fraction remaining, between 0 - 1 */ public double fractionOfFuelRemaining(int fuelSlot) { if (burnTimeInitialValue[fuelSlot] <= 0) return 0; double fraction = burnTimeRemaining[fuelSlot] / (double) burnTimeInitialValue[fuelSlot]; return MathHelper.clamp_double(fraction, 0.0, 1.0); } /** * return the remaining burn time of the fuel in the given slot * * @param fuelSlot * the number of the fuel slot (0..3) * @return seconds remaining */ public int secondsOfFuelRemaining(int fuelSlot) { if (burnTimeRemaining[fuelSlot] <= 0) return 0; return burnTimeRemaining[fuelSlot] / 20; // 20 ticks per second } /** * Get the number of slots which have fuel burning in them. * * @return number of slots with burning fuel, 0 - FUEL_SLOTS_COUNT */ public int numberOfBurningFuelSlots() { int burningCount = 0; for (int burnTime : burnTimeRemaining) { if (burnTime > 0) ++burningCount; } return burningCount; } /** * Returns the amount of cook time completed on the currently cooking item. * * @return fraction remaining, between 0 - 1 */ public double fractionOfCookTimeComplete() { double fraction = cookTime / (double) COOK_TIME_FOR_COMPLETION; return MathHelper.clamp_double(fraction, 0.0, 1.0); } // This method is called every tick to update the tile entity, i.e. // - see if the fuel has run out, and if so turn the furnace "off" and // slowly uncook the current item (if any) // - see if any of the items have finished smelting // It runs both on the server and the client. @Override public void update() { // If there is nothing to smelt or there is no room in the output, reset // cookTime and return if (canSmelt()) { int numberOfFuelBurning = burnFuel(); // If fuel is available, keep cooking the item, otherwise start // "uncooking" it at double speed if (numberOfFuelBurning > 0) { cookTime += numberOfFuelBurning; } else { cookTime -= 2; } if (cookTime < 0) cookTime = 0; // If cookTime has reached maxCookTime smelt the item and reset // cookTime if (cookTime >= COOK_TIME_FOR_COMPLETION) { smeltItem(); cookTime = 0; } } else { cookTime = 0; } // when the number of burning slots changes, we need to force the block // to re-render, otherwise the change in // state will not be visible. Likewise, we need to force a lighting // recalculation. // The block update (for renderer) is only required on client side, but // the lighting is required on both, since // the client needs it for rendering and the server needs it for crop // growth etc int numberBurning = numberOfBurningFuelSlots(); if (cachedNumberOfBurningSlots != numberBurning) { cachedNumberOfBurningSlots = numberBurning; if (worldObj.isRemote) { worldObj.markBlockForUpdate(pos); } worldObj.checkLightFor(EnumSkyBlock.BLOCK, pos); } } /** * for each fuel slot: decreases the burn time, checks if burnTimeRemaining * = 0 and tries to consume a new piece of fuel if one is available * * @return the number of fuel slots which are burning */ private int burnFuel() { int burningCount = 0; boolean inventoryChanged = false; // Iterate over all the fuel slots for (int i = 0; i < FUEL_SLOTS_COUNT; i++) { int fuelSlotNumber = i + FIRST_FUEL_SLOT; if (burnTimeRemaining[i] > 0) { --burnTimeRemaining[i]; ++burningCount; } if (burnTimeRemaining[i] == 0) { if (itemStacks[fuelSlotNumber] != null && getItemBurnTime(itemStacks[fuelSlotNumber]) > 0) { // If the stack in this slot is not null and is fuel, set // burnTimeRemaining & burnTimeInitialValue to the // item's burn time and decrease the stack size burnTimeRemaining[i] = burnTimeInitialValue[i] = getItemBurnTime(itemStacks[fuelSlotNumber]); --itemStacks[fuelSlotNumber].stackSize; ++burningCount; inventoryChanged = true; // If the stack size now equals 0 set the slot contents to // the items container item. This is for fuel // items such as lava buckets so that the bucket is not // consumed. If the item dose not have // a container item getContainerItem returns null which sets // the slot contents to null if (itemStacks[fuelSlotNumber].stackSize == 0) { itemStacks[fuelSlotNumber] = itemStacks[fuelSlotNumber] .getItem().getContainerItem( itemStacks[fuelSlotNumber]); } } } } if (inventoryChanged) markDirty(); return burningCount; } /** * Check if any of the input items are smeltable and there is sufficient * space in the output slots * * @return true if smelting is possible */ private boolean canSmelt() { return smeltItem(false); } /** * Smelt an input item into an output slot, if possible */ private void smeltItem() { smeltItem(true); } /** * checks that there is an item to be smelted in one of the input slots and * that there is room for the result in the output slots If desired, * performs the smelt * * @param performSmelt * if true, perform the smelt. if false, check whether smelting * is possible, but don't change the inventory * @return false if no items can be smelted, true otherwise */ private boolean smeltItem(boolean performSmelt) { Integer firstSuitableInputSlot = null; Integer firstSuitableOutputSlot = null; ItemStack result = null; // finds the first input slot which is smeltable and whose result fits // into an output slot (stacking if possible) for (int inputSlot = FIRST_INPUT_SLOT; inputSlot < FIRST_INPUT_SLOT + INPUT_SLOTS_COUNT; inputSlot++) { if (itemStacks[inputSlot] != null) { result = getSmeltingResultForItem(itemStacks[inputSlot]); if (result != null) { // find the first suitable output slot- either empty, or // with identical item that has enough space for (int outputSlot = FIRST_OUTPUT_SLOT; outputSlot < FIRST_OUTPUT_SLOT + OUTPUT_SLOTS_COUNT; outputSlot++) { ItemStack outputStack = itemStacks[outputSlot]; if (outputStack == null) { firstSuitableInputSlot = inputSlot; firstSuitableOutputSlot = outputSlot; break; } if (outputStack.getItem() == result.getItem() && (!outputStack.getHasSubtypes() || outputStack .getMetadata() == outputStack .getMetadata()) && ItemStack.areItemStackTagsEqual(outputStack, result)) { int combinedSize = itemStacks[outputSlot].stackSize + result.stackSize; if (combinedSize <= getInventoryStackLimit() && combinedSize <= itemStacks[outputSlot] .getMaxStackSize()) { firstSuitableInputSlot = inputSlot; firstSuitableOutputSlot = outputSlot; break; } } } if (firstSuitableInputSlot != null) break; } } } if (firstSuitableInputSlot == null) return false; if (!performSmelt) return true; // alter input and output itemStacks[firstSuitableInputSlot].stackSize--; if (itemStacks[firstSuitableInputSlot].stackSize <= 0) itemStacks[firstSuitableInputSlot] = null; if (itemStacks[firstSuitableOutputSlot] == null) { itemStacks[firstSuitableOutputSlot] = result.copy(); // Use deep // .copy() // to avoid // altering // the // recipe } else { itemStacks[firstSuitableOutputSlot].stackSize += result.stackSize; } markDirty(); return true; } // returns the smelting result for the given stack. Returns null if the // given stack can not be smelted public static ItemStack getSmeltingResultForItem(ItemStack stack) { Item input = stack.getItem(); if (input == Item.getItemFromBlock(NuclearCraft.uraniumOre)) { return new ItemStack(NuclearCraft.plutoniumIngot); } return null; } // returns the number of ticks the given item will burn. Returns 0 if the // given item is not a valid fuel public static short getItemBurnTime(ItemStack stack) { int burntime; Item inputFuel = stack.getItem(); if (inputFuel == NuclearCraft.plutoniumExtraction) { return 1600; } return 0; } // Gets the number of slots in the inventory @Override public int getSizeInventory() { return itemStacks.length; } // Gets the stack in the given slot @Override public ItemStack getStackInSlot(int i) { return itemStacks[i]; } /** * Removes some of the units from itemstack in the given slot, and returns * as a separate itemstack * * @param slotIndex * the slot number to remove the items from * @param count * the number of units to remove * @return a new itemstack containing the units removed from the slot */ @Override public ItemStack decrStackSize(int slotIndex, int count) { ItemStack itemStackInSlot = getStackInSlot(slotIndex); if (itemStackInSlot == null) return null; ItemStack itemStackRemoved; if (itemStackInSlot.stackSize <= count) { itemStackRemoved = itemStackInSlot; setInventorySlotContents(slotIndex, null); } else { itemStackRemoved = itemStackInSlot.splitStack(count); if (itemStackInSlot.stackSize == 0) { setInventorySlotContents(slotIndex, null); } } markDirty(); return itemStackRemoved; } // overwrites the stack in the given slotIndex with the given stack @Override public void setInventorySlotContents(int slotIndex, ItemStack itemstack) { itemStacks[slotIndex] = itemstack; if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) { itemstack.stackSize = getInventoryStackLimit(); } markDirty(); } // This is the maximum number if items allowed in each slot // This only affects things such as hoppers trying to insert items you need // to use the container to enforce this for players // inserting items via the gui @Override public int getInventoryStackLimit() { return 64; } // Return true if the given player is able to use this block. In this case // it checks that // 1) the world tileentity hasn't been replaced in the meantime, and // 2) the player isn't too far away from the centre of the block @Override public boolean isUseableByPlayer(EntityPlayer player) { if (this.worldObj.getTileEntity(this.pos) != this) return false; final double X_CENTRE_OFFSET = 0.5; final double Y_CENTRE_OFFSET = 0.5; final double Z_CENTRE_OFFSET = 0.5; final double MAXIMUM_DISTANCE_SQ = 8.0 * 8.0; return player.getDistanceSq(pos.getX() + X_CENTRE_OFFSET, pos.getY() + Y_CENTRE_OFFSET, pos.getZ() + Z_CENTRE_OFFSET) < MAXIMUM_DISTANCE_SQ; } // Return true if the given stack is allowed to be inserted in the given // slot // Unlike the vanilla furnace, we allow anything to be placed in the fuel // slots static public boolean isItemValidForFuelSlot(ItemStack itemStack) { return true; } // Return true if the given stack is allowed to be inserted in the given // slot // Unlike the vanilla furnace, we allow anything to be placed in the fuel // slots static public boolean isItemValidForInputSlot(ItemStack itemStack) { return true; } // Return true if the given stack is allowed to be inserted in the given // slot // Unlike the vanilla furnace, we allow anything to be placed in the fuel // slots static public boolean isItemValidForOutputSlot(ItemStack itemStack) { return false; } // ------------------------------ // This is where you save any data that you don't want to lose when the tile // entity unloads // In this case, it saves the state of the furnace (burn time etc) and the // itemstacks stored in the fuel, input, and output slots @Override public void writeToNBT(NBTTagCompound parentNBTTagCompound) { super.writeToNBT(parentNBTTagCompound); // The super call is required to // save and load the tiles // location // // Save the stored item stacks // to use an analogy with Java, this code generates an array of hashmaps // The itemStack in each slot is converted to an NBTTagCompound, which // is effectively a hashmap of key->value pairs such // as slot=1, id=2353, count=1, etc // Each of these NBTTagCompound are then inserted into NBTTagList, which // is similar to an array. NBTTagList dataForAllSlots = new NBTTagList(); for (int i = 0; i < this.itemStacks.length; ++i) { if (this.itemStacks[i] != null) { NBTTagCompound dataForThisSlot = new NBTTagCompound(); dataForThisSlot.setByte("Slot", (byte) i); this.itemStacks[i].writeToNBT(dataForThisSlot); dataForAllSlots.appendTag(dataForThisSlot); } } // the array of hashmaps is then inserted into the parent hashmap for // the container parentNBTTagCompound.setTag("Items", dataForAllSlots); // Save everything else parentNBTTagCompound.setShort("CookTime", cookTime); parentNBTTagCompound.setTag("burnTimeRemaining", new NBTTagIntArray( burnTimeRemaining)); parentNBTTagCompound.setTag("burnTimeInitial", new NBTTagIntArray( burnTimeInitialValue)); } // This is where you load the data that you saved in writeToNBT @Override public void readFromNBT(NBTTagCompound nbtTagCompound) { super.readFromNBT(nbtTagCompound); // The super call is required to save // and load the tiles location final byte NBT_TYPE_COMPOUND = 10; // See NBTBase.createNewByType() for // a listing NBTTagList dataForAllSlots = nbtTagCompound.getTagList("Items", NBT_TYPE_COMPOUND); Arrays.fill(itemStacks, null); // set all slots to empty for (int i = 0; i < dataForAllSlots.tagCount(); ++i) { NBTTagCompound dataForOneSlot = dataForAllSlots.getCompoundTagAt(i); byte slotNumber = dataForOneSlot.getByte("Slot"); if (slotNumber >= 0 && slotNumber < this.itemStacks.length) { this.itemStacks[slotNumber] = ItemStack .loadItemStackFromNBT(dataForOneSlot); } } // Load everything else. Trim the arrays (or pad with 0) to make sure // they have the correct number of elements cookTime = nbtTagCompound.getShort("CookTime"); burnTimeRemaining = Arrays.copyOf( nbtTagCompound.getIntArray("burnTimeRemaining"), FUEL_SLOTS_COUNT); burnTimeInitialValue = Arrays .copyOf(nbtTagCompound.getIntArray("burnTimeInitial"), FUEL_SLOTS_COUNT); cachedNumberOfBurningSlots = -1; } // When the world loads from disk, the server needs to send the TileEntity // information to the client // it uses getDescriptionPacket() and onDataPacket() to do this @Override public Packet getDescriptionPacket() { NBTTagCompound nbtTagCompound = new NBTTagCompound(); writeToNBT(nbtTagCompound); final int METADATA = 0; return new S35PacketUpdateTileEntity(this.pos, METADATA, nbtTagCompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.getNbtCompound()); } // ------------------------ // set all slots to empty @Override public void clear() { Arrays.fill(itemStacks, null); } // will add a key for this container to the lang file so we can name it in // the GUI @Override public String getName() { return "Nuclear Boiler"; } @Override public boolean hasCustomName() { return false; } // standard code to look up what the human-readable name is @Override public IChatComponent getDisplayName() { return this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName()); } // Fields are used to send non-inventory information from the server to // interested clients // The container code caches the fields and sends the client any fields // which have changed. // The field ID is limited to byte, and the field value is limited to short. // (if you use more than this, they get cast down // in the network packets) // If you need more than this, or shorts are too small, use a custom packet // in your container instead. private static final byte COOK_FIELD_ID = 0; private static final byte FIRST_BURN_TIME_REMAINING_FIELD_ID = 1; private static final byte FIRST_BURN_TIME_INITIAL_FIELD_ID = FIRST_BURN_TIME_REMAINING_FIELD_ID + (byte) FUEL_SLOTS_COUNT; private static final byte NUMBER_OF_FIELDS = FIRST_BURN_TIME_INITIAL_FIELD_ID + (byte) FUEL_SLOTS_COUNT; @Override public int getField(int id) { if (id == COOK_FIELD_ID) return cookTime; if (id >= FIRST_BURN_TIME_REMAINING_FIELD_ID && id < FIRST_BURN_TIME_REMAINING_FIELD_ID + FUEL_SLOTS_COUNT) { return burnTimeRemaining[id - FIRST_BURN_TIME_REMAINING_FIELD_ID]; } if (id >= FIRST_BURN_TIME_INITIAL_FIELD_ID && id < FIRST_BURN_TIME_INITIAL_FIELD_ID + FUEL_SLOTS_COUNT) { return burnTimeInitialValue[id - FIRST_BURN_TIME_INITIAL_FIELD_ID]; } throw new IllegalArgumentException( "Invalid field ID in TileNuclearBoiler.getField:" + id); } @Override public void setField(int id, int value) { if (id == COOK_FIELD_ID) { cookTime = (short) value; } else if (id >= FIRST_BURN_TIME_REMAINING_FIELD_ID && id < FIRST_BURN_TIME_REMAINING_FIELD_ID + FUEL_SLOTS_COUNT) { burnTimeRemaining[id - FIRST_BURN_TIME_REMAINING_FIELD_ID] = value; } else if (id >= FIRST_BURN_TIME_INITIAL_FIELD_ID && id < FIRST_BURN_TIME_INITIAL_FIELD_ID + FUEL_SLOTS_COUNT) { burnTimeInitialValue[id - FIRST_BURN_TIME_INITIAL_FIELD_ID] = value; } else { System.err .println("Invalid field ID in TileInventorySmelting.setField:" + id); } } @Override public int getFieldCount() { return NUMBER_OF_FIELDS; } // ----------------------------------------------------------------------------------------------------------- // The following methods are not needed for this example but are part of // IInventory so they must be implemented // Unused unless your container specifically uses it. // Return true if the given stack is allowed to go in the given slot @Override public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) { return false; } /** * This method removes the entire contents of the given slot and returns it. * Used by containers such as crafting tables which return any items in * their slots when you close the GUI * * @param slotIndex * @return */ @Override public ItemStack getStackInSlotOnClosing(int slotIndex) { ItemStack itemStack = getStackInSlot(slotIndex); if (itemStack != null) setInventorySlotContents(slotIndex, null); return itemStack; } @Override public void openInventory(EntityPlayer player) { } @Override public void closeInventory(EntityPlayer player) { } } Here is my NuclearBoilrt class: package com.mod.gui.boiler; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryHelper; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import com.mod.main.GuiHandler; import com.mod.main.NuclearCraft; public class NuclearBoiler extends BlockContainer { public NuclearBoiler() { super(Material.rock); setCreativeTab(NuclearCraft.nuclearTab); setUnlocalizedName("NuclearBoiler"); } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileNuclearBoiler(); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote) return true; playerIn.openGui(NuclearCraft.instance, GuiHandler.getGuiID(), worldIn, pos.getX(), pos.getY(), pos.getZ()); return true; } @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { TileEntity tileEntity = worldIn.getTileEntity(pos); if (tileEntity instanceof IInventory) { InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory) tileEntity); } super.breakBlock(worldIn, pos, state); } @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { TileEntity tileEntity = worldIn.getTileEntity(pos); if (tileEntity instanceof TileNuclearBoiler) { TileNuclearBoiler tileInventoryFurnace = (TileNuclearBoiler) tileEntity; int burningSlots = tileInventoryFurnace.numberOfBurningFuelSlots(); burningSlots = MathHelper.clamp_int(burningSlots, 0, 4); return getDefaultState().withProperty(BURNING_SIDES_COUNT, burningSlots); } return state; } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState(); // return this.getDefaultState().withProperty(BURNING_SIDES_COUNT, // Integer.valueOf(meta)); } @Override public int getMetaFromState(IBlockState state) { return 0; } @Override protected BlockState createBlockState() { return new BlockState(this, new IProperty[] { BURNING_SIDES_COUNT }); } public static final PropertyInteger BURNING_SIDES_COUNT = PropertyInteger .create("burnbving_sides_count", 0, 4); private static final int LIGHT_VALUE = 15; // light value for a // single side burning public int getLightValue(IBlockAccess world, BlockPos pos) { int lightValue = 0; IBlockState blockState = getActualState(getDefaultState(), world, pos); int burningSides = (Integer) blockState.getValue(BURNING_SIDES_COUNT); if (burningSides == 0) { lightValue = 0; } else { lightValue = 15; } lightValue = MathHelper.clamp_int(lightValue, 0, LIGHT_VALUE); return lightValue; } @SideOnly(Side.CLIENT) public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.SOLID; } @Override public boolean isOpaqueCube() { return false; } @Override public boolean isFullCube() { return false; } @Override public int getRenderType() { return 3; } } Here is my GuiNuclearBoiler class: package com.mod.gui.boiler; import java.awt.Color; import java.util.ArrayList; import java.util.List; import com.mod.gui.refinery.TileRefinery; import com.mod.main.NuclearCraft; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; public class GuiNuclearBoiler extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation( NuclearCraft.MODID, "textures/gui/NuclearBoiler.png"); private TileNuclearBoiler tileEntity; final int COOK_BAR_XPOS = 42; final int COOK_BAR_YPOS = 34; final int COOK_BAR_ICON_U = 177; // texture position of white arrow icon on // GUI background image final int COOK_BAR_ICON_V = 14; final int COOK_BAR_WIDTH = 66; final int COOK_BAR_HEIGHT = 19; final int FLAME_XPOS = 64; final int FLAME_YPOS = 21; final int FLAME_ICON_U = 176; final int FLAME_ICON_V = 0; final int FLAME_WIDTH = 14; final int FLAME_HEIGHT = 14; final int FLAME_X_SPACING = 18; public GuiNuclearBoiler(InventoryPlayer invPlayer, TileNuclearBoiler tile) { super(new ContainerNuclearBoiler(invPlayer, tile)); this.tileEntity = tile; // width and height xSize = 176; ySize = 207; } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { // Bind the image texture Minecraft.getMinecraft().getTextureManager().bindTexture(texture); // Draw the image GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); // get cook progress as a double between 0 and 1 double cookProgress = tileEntity.fractionOfCookTimeComplete(); // draw the cook progress bar drawTexturedModalRect(guiLeft + COOK_BAR_XPOS, guiTop + COOK_BAR_YPOS, COOK_BAR_ICON_U, COOK_BAR_ICON_V, (int) (cookProgress * COOK_BAR_WIDTH), COOK_BAR_HEIGHT); // draw the fuel remaining bar for each fuel slot flame drawTexturedModalRect(guiLeft + (FLAME_XPOS - 1), guiTop + FLAME_YPOS, FLAME_ICON_U, FLAME_ICON_V, FLAME_WIDTH, FLAME_HEIGHT); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { super.drawGuiContainerForegroundLayer(mouseX, mouseY); final int LABEL_XPOS = 65; final int LABEL_YPOS = 5; fontRendererObj.drawString(tileEntity.getDisplayName() .getUnformattedText(), LABEL_XPOS, LABEL_YPOS, Color.darkGray .getRGB()); List<String> hoveringText = new ArrayList<String>(); // If the mouse is over the progress bar add the progress bar hovering // text if (isInRect(guiLeft + COOK_BAR_XPOS, guiTop + COOK_BAR_YPOS, COOK_BAR_WIDTH, COOK_BAR_HEIGHT, mouseX, mouseY)) { int cookPercentage = (int) (tileEntity.fractionOfCookTimeComplete() * 100); hoveringText.add("Progress: " + cookPercentage + "%"); } // If the mouse is over one of the burn time indicator add the burn time // indicator hovering text if (isInRect(guiLeft + (FLAME_XPOS - 1), guiTop + FLAME_YPOS, FLAME_WIDTH, FLAME_HEIGHT, mouseX, mouseY)) { hoveringText.add("Fuel time: " + tileEntity.secondsOfFuelRemaining(0) + "s"); } // If hoveringText is not empty draw the hovering text if (!hoveringText.isEmpty()) { drawHoveringText(hoveringText, mouseX - guiLeft, mouseY - guiTop, fontRendererObj); } } // Returns true if the given x,y coordinates are within the given rectangle public static boolean isInRect(int x, int y, int xSize, int ySize, int mouseX, int mouseY) { return ((mouseX >= x && mouseX <= x + xSize) && (mouseY >= y && mouseY <= y + ySize)); } } And my ContainerNuclearBoiler class: package com.mod.gui.boiler; import com.mod.gui.refinery.TileRefinery; import com.mod.gui.refinery.ContainerRefinery.SlotFuel; import com.mod.gui.refinery.ContainerRefinery.SlotOutput; import com.mod.gui.refinery.ContainerRefinery.SlotSmeltableInput; 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.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ContainerNuclearBoiler extends Container { // Stores the tile entity instance for later use private TileNuclearBoiler tile; private int[] cachedFields; private final int HOTBAR_SLOT_COUNT = 9; private final int PLAYER_INVENTORY_ROW_COUNT = 3; private final int PLAYER_INVENTORY_COLUMN_COUNT = 9; private final int PLAYER_INVENTORY_SLOT_COUNT = PLAYER_INVENTORY_COLUMN_COUNT * PLAYER_INVENTORY_ROW_COUNT; private final int VANILLA_SLOT_COUNT = HOTBAR_SLOT_COUNT + PLAYER_INVENTORY_SLOT_COUNT; public final int FUEL_SLOTS_COUNT = TileNuclearBoiler.FUEL_SLOTS_COUNT; public final int INPUT_SLOTS_COUNT = TileNuclearBoiler.INPUT_SLOTS_COUNT; public final int OUTPUT_SLOTS_COUNT = TileNuclearBoiler.OUTPUT_SLOTS_COUNT; public final int FURNACE_SLOTS_COUNT = FUEL_SLOTS_COUNT + INPUT_SLOTS_COUNT + OUTPUT_SLOTS_COUNT; // slot index is the unique index for all slots in this container i.e. 0 - // 35 for invPlayer then 36 - 49 for tileInventoryFurnace private final int VANILLA_FIRST_SLOT_INDEX = 0; private final int FIRST_FUEL_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; private final int FIRST_INPUT_SLOT_INDEX = FIRST_FUEL_SLOT_INDEX + FUEL_SLOTS_COUNT; private final int FIRST_OUTPUT_SLOT_INDEX = FIRST_INPUT_SLOT_INDEX + INPUT_SLOTS_COUNT; // slot number is the slot number within each component; i.e. invPlayer // slots 0 - 35, and tileInventoryFurnace slots 0 - 14 private final int FIRST_FUEL_SLOT_NUMBER = 0; private final int FIRST_INPUT_SLOT_NUMBER = FIRST_FUEL_SLOT_NUMBER + FUEL_SLOTS_COUNT; private final int FIRST_OUTPUT_SLOT_NUMBER = FIRST_INPUT_SLOT_NUMBER + INPUT_SLOTS_COUNT; public ContainerNuclearBoiler(InventoryPlayer invPlayer, TileNuclearBoiler tile) { this.tile = tile; final int SLOT_X_SPACING = 18; final int SLOT_Y_SPACING = 18; final int HOTBAR_XPOS = 8; final int HOTBAR_YPOS = 142; // Add the players hotbar to the gui - the [xpos, ypos] location of each // item for (int x = 0; x < HOTBAR_SLOT_COUNT; x++) { int slotNumber = x; addSlotToContainer(new Slot(invPlayer, slotNumber, HOTBAR_XPOS + SLOT_X_SPACING * x, HOTBAR_YPOS)); } final int PLAYER_INVENTORY_XPOS = 8; final int PLAYER_INVENTORY_YPOS = 84; // Add the rest of the players inventory to the gui for (int y = 0; y < PLAYER_INVENTORY_ROW_COUNT; y++) { for (int x = 0; x < PLAYER_INVENTORY_COLUMN_COUNT; x++) { int slotNumber = HOTBAR_SLOT_COUNT + y * PLAYER_INVENTORY_COLUMN_COUNT + x; int xpos = PLAYER_INVENTORY_XPOS + x * SLOT_X_SPACING; int ypos = PLAYER_INVENTORY_YPOS + y * SLOT_Y_SPACING; addSlotToContainer(new Slot(invPlayer, slotNumber, xpos, ypos)); } } // FUEL SLOTS addSlotToContainer(new SlotFuel(tile, 0, 44, 18)); //addSlotToContainer(new SlotFuel(tile, 1, 79, 18)); // INPUT SLOTS addSlotToContainer(new SlotSmeltableInput(tile, 2, 21, 35)); // OUTPUT SLOT addSlotToContainer(new SlotOutput(tile, 3, 114, 35)); } // Checks each tick to make sure the player is still able to access the // inventory and if not closes the gui @Override public boolean canInteractWith(EntityPlayer player) { return tile.isUseableByPlayer(player); } // This is where you specify what happens when a player shift clicks a slot // in the gui // (when you shift click a slot in the TileEntity Inventory, it moves it to // the first available position in the hotbar and/or // player inventory. When you you shift-click a hotbar or player inventory // item, it moves it to the first available // position in the TileEntity inventory - either input or fuel as // appropriate for the item you clicked) // At the very least you must override this and return null or the game will // crash when the player shift clicks a slot // returns null if the source slot is empty, or if none of the source slot // items could be moved. // otherwise, returns a copy of the source stack @Override public ItemStack transferStackInSlot(EntityPlayer player, int sourceSlotIndex) { Slot sourceSlot = (Slot) inventorySlots.get(sourceSlotIndex); if (sourceSlot == null || !sourceSlot.getHasStack()) return null; ItemStack sourceStack = sourceSlot.getStack(); ItemStack copyOfSourceStack = sourceStack.copy(); // Check if the slot clicked is one of the vanilla container slots if (sourceSlotIndex >= VANILLA_FIRST_SLOT_INDEX && sourceSlotIndex < VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT) { // This is a vanilla container slot so merge the stack into one of // the furnace slots // If the stack is smeltable try to merge merge the stack into the // input slots if (TileRefinery.getSmeltingResultForItem(sourceStack) != null) { if (!mergeItemStack(sourceStack, FIRST_INPUT_SLOT_INDEX, FIRST_INPUT_SLOT_INDEX + INPUT_SLOTS_COUNT, false)) { return null; } } else if (TileRefinery.getItemBurnTime(sourceStack) > 0) { if (!mergeItemStack(sourceStack, FIRST_FUEL_SLOT_INDEX, FIRST_FUEL_SLOT_INDEX + FUEL_SLOTS_COUNT, true)) { // Setting the boolean to true places the stack in the // bottom slot first return null; } } else { return null; } } else if (sourceSlotIndex >= FIRST_FUEL_SLOT_INDEX && sourceSlotIndex < FIRST_FUEL_SLOT_INDEX + FURNACE_SLOTS_COUNT) { // This is a furnace slot so merge the stack into the players // inventory: try the hotbar first and then the main inventory // because the main inventory slots are immediately after the hotbar // slots, we can just merge with a single call if (!mergeItemStack(sourceStack, VANILLA_FIRST_SLOT_INDEX, VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT, false)) { return null; } } else { System.err.print("Invalid slotIndex:" + sourceSlotIndex); return null; } // If stack size == 0 (the entire stack was moved) set slot contents to // null if (sourceStack.stackSize == 0) { sourceSlot.putStack(null); } else { sourceSlot.onSlotChanged(); } sourceSlot.onPickupFromSlot(player, sourceStack); return copyOfSourceStack; } /* Client Synchronization */ // This is where you check if any values have changed and if so send an // update to any clients accessing this container // The container itemstacks are tested in Container.detectAndSendChanges, so // we don't need to do that // We iterate through all of the TileEntity Fields to find any which have // changed, and send them. // You don't have to use fields if you don't wish to; just manually match // the ID in sendProgressBarUpdate with the value in // updateProgressBar() // The progress bar values are restricted to shorts. If you have a larger // value (eg int), it's not a good idea to try and split it // up into two shorts because the progress bar values are sent // independently, and unless you add synchronisation logic at the // receiving side, your int value will be wrong until the second short // arrives. Use a custom packet instead. @Override public void detectAndSendChanges() { super.detectAndSendChanges(); boolean allFieldsHaveChanged = false; boolean fieldHasChanged[] = new boolean[tile.getFieldCount()]; if (cachedFields == null) { cachedFields = new int[tile.getFieldCount()]; allFieldsHaveChanged = true; } for (int i = 0; i < cachedFields.length; ++i) { if (allFieldsHaveChanged || cachedFields[i] != tile.getField(i)) { cachedFields[i] = tile.getField(i); fieldHasChanged[i] = true; } } // go through the list of crafters (players using this container) and // update them if necessary for (int i = 0; i < this.crafters.size(); ++i) { ICrafting icrafting = (ICrafting) this.crafters.get(i); for (int fieldID = 0; fieldID < tile.getFieldCount(); ++fieldID) { if (fieldHasChanged[fieldID]) { // Note that although sendProgressBarUpdate takes 2 ints on // a server these are truncated to shorts icrafting.sendProgressBarUpdate(this, fieldID, cachedFields[fieldID]); } } } } // Called when a progress bar update is received from the server. The two // values (id and data) are the same two // values given to sendProgressBarUpdate. In this case we are using fields // so we just pass them to the tileEntity. @SideOnly(Side.CLIENT) @Override public void updateProgressBar(int id, int data) { tile.setField(id, data); } // SlotFuel is a slot for fuel items public class SlotFuel extends Slot { public SlotFuel(IInventory inventoryIn, int index, int xPosition, int yPosition) { super(inventoryIn, index, xPosition, yPosition); } // if this function returns false, the player won't be able to insert // the given item into this slot @Override public boolean isItemValid(ItemStack stack) { return TileRefinery.isItemValidForFuelSlot(stack); } } // SlotSmeltableInput is a slot for input items public class SlotSmeltableInput extends Slot { public SlotSmeltableInput(IInventory inventoryIn, int index, int xPosition, int yPosition) { super(inventoryIn, index, xPosition, yPosition); } // if this function returns false, the player won't be able to insert // the given item into this slot @Override public boolean isItemValid(ItemStack stack) { return TileRefinery.isItemValidForInputSlot(stack); } } // SlotOutput is a slot that will not accept any items public class SlotOutput extends Slot { public SlotOutput(IInventory inventoryIn, int index, int xPosition, int yPosition) { super(inventoryIn, index, xPosition, yPosition); } // if this function returns false, the player won't be able to insert // the given item into this slot @Override public boolean isItemValid(ItemStack stack) { return TileRefinery.isItemValidForOutputSlot(stack); } } } Here is the crash stacktrace: [10:20:44] [main/INFO] [GradleStart]: Extra: [] [10:20:44] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/student/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken, {REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] [10:20:44] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [10:20:44] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [10:20:44] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker [10:20:44] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [10:20:44] [main/INFO] [FML]: Forge Mod Loader version 8.99.116.1449 for Minecraft 1.8 loading [10:20:44] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_31, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jre1.8.0_31 [10:20:44] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [10:20:44] [main/WARN] [FML]: The coremod codechicken.core.launch.CodeChickenCorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [10:20:44] [main/WARN] [FML]: The coremod codechicken.lib.asm.CCLCorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [10:20:44] [main/WARN] [FML]: The coremod codechicken.lib.asm.CCLCorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [10:20:44] [main/WARN] [FML]: The coremod codechicken.nei.asm.NEICorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [10:20:44] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [10:20:44] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [10:20:44] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [10:20:44] [main/INFO] [GradleStart]: Injecting location in coremod codechicken.core.asm.MCPDeobfuscationTransformer.LoadPlugin [10:20:44] [main/INFO] [GradleStart]: Injecting location in coremod codechicken.lib.asm.CCLCorePlugin [10:20:44] [main/INFO] [GradleStart]: Injecting location in coremod codechicken.core.launch.CodeChickenCorePlugin [10:20:44] [main/INFO] [GradleStart]: Injecting location in coremod codechicken.lib.asm.CCLCorePlugin [10:20:44] [main/INFO] [GradleStart]: Injecting location in coremod codechicken.nei.asm.NEICorePlugin [10:20:44] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [10:20:44] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [10:20:44] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [10:20:44] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [10:20:44] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [10:20:44] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [10:20:44] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [10:20:45] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [10:20:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [10:20:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [10:20:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [10:20:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [10:20:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [10:20:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [10:20:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [10:20:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [10:20:46] [main/INFO] [GradleStart]: Remapping AccessTransformer rules... [10:20:46] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [10:20:46] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [10:20:46] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [10:20:47] [Client thread/INFO]: Setting user: Player85 [10:20:50] [Client thread/INFO]: LWJGL Version: 2.9.1 [10:20:51] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:235]: ---- Minecraft Crash Report ---- WARNING: coremods are present: CCLCorePlugin (CodeChickenLib-1.8-1.1.2.133-dev.jar) CodeChickenCorePlugin (CodeChickenCore-1.8-1.0.5.36-universal.jar) CCCDeobfPlugin (unknown) NEICorePlugin (NotEnoughItems-1.8-1.0.5.104-universal.jar) Contact their authors BEFORE contacting forge // You should try our sister game, Minceraft! Time: 6/19/15 10:20 AM Description: Loading screen debug info This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_31, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 798468864 bytes (761 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: Loaded coremods (and transformers): CCLCorePlugin (CodeChickenLib-1.8-1.1.2.133-dev.jar) codechicken.lib.asm.ClassHeirachyManager codechicken.lib.asm.RenderHookTransformer CodeChickenCorePlugin (CodeChickenCore-1.8-1.0.5.36-universal.jar) codechicken.core.asm.InterfaceDependancyTransformer codechicken.core.asm.TweakTransformer codechicken.core.asm.DelegatedTransformer codechicken.core.asm.DefaultImplementationTransformer CCCDeobfPlugin (unknown) NEICorePlugin (NotEnoughItems-1.8-1.0.5.104-universal.jar) codechicken.nei.asm.NEITransformer GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 350.12' Renderer: 'GeForce GT 755M/PCIe/SSE2' [10:20:51] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [10:20:51] [Client thread/INFO] [FML]: MinecraftForge v11.14.3.1449 Initialized [10:20:51] [Client thread/INFO] [FML]: Replaced 204 ore recipies [10:20:51] [Client thread/INFO] [FML]: Preloading CrashReport classes [10:20:51] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [10:20:51] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer [10:20:51] [Client thread/INFO] [FML]: Searching C:\Users\student\Desktop\Lucas B\forge-1.8-11.14.3.1449-src\eclipse\mods for mods [10:20:51] [Client thread/INFO] [FML]: Also searching C:\Users\student\Desktop\Lucas B\forge-1.8-11.14.3.1449-src\eclipse\mods\1.8 for mods [10:20:52] [Client thread/INFO] [FML]: Forge Mod Loader has identified 6 mods to load [10:20:52] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, CodeChickenCore, NotEnoughItems, nuclearcraft] at CLIENT [10:20:52] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, CodeChickenCore, NotEnoughItems, nuclearcraft] at SERVER [10:20:53] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Not Enough Items, FMLFileResourcePack:NuclearCraft [10:20:53] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [10:20:53] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations [10:20:53] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations [10:20:53] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations [10:20:53] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:75]: Entering preinitalization phase.. [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:76]: Registering items... [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:91]: Items registered. [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:92]: Registering blocks... [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:104]: Blocks registered. [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:105]: Registering tile entities... [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:110]: Tile entities registered. [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:111]: Registering gui handler... [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:116]: Gui handler registered. [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:117]: Registering fuel handler... [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:119]: Fuel handler registered. [10:20:53] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:preinit:120]: Preinitalization phase ended. [10:20:53] [Client thread/INFO] [FML]: Applying holder lookups [10:20:53] [Client thread/INFO] [FML]: Holder lookups applied [10:20:53] [Client thread/INFO] [FML]: Injecting itemstacks [10:20:53] [Client thread/INFO] [FML]: Itemstack injection complete [10:20:53] [sound Library Loader/INFO]: Starting up SoundSystem... [10:20:53] [Thread-10/INFO]: Initializing LWJGL OpenAL [10:20:53] [Thread-10/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [10:20:53] [Thread-10/INFO]: OpenAL initialized. [10:20:54] [sound Library Loader/INFO]: Sound engine started [10:20:55] [Client thread/INFO]: Created: 512x512 textures-atlas [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=3 not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=2 not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=4 not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=0 not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=2 not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=1 not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#inventory not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=4 not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=3 not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=1 not found [10:20:56] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=0 not found [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:init:125]: Entering initalization phase... [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:init:126]: Texturing items... [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:init:128]: Items textured. [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:init:129]: Texturing blocks... [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:init:131]: Blocks textured. [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:init:132]: Registering ore generator... [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:init:134]: Ore generator registered. [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:init:135]: Initalization phase ended. [10:20:57] [Client thread/INFO] [FML]: Injecting itemstacks [10:20:57] [Client thread/INFO] [FML]: Itemstack injection complete [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:140]: Entering postinitalization phase... [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:141]: Registering item recipes... [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:143]: Item recipes registered. [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:144]: Registering block recipes... [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:146]: Block recipes registered. [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:147]: Registering smelting recipes... [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:149]: Smelting recipes registered. [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:150]: Registering special names.. [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:152]: Special names registered. [10:20:57] [Client thread/INFO] [sTDOUT]: [com.mod.main.NuclearCraft:postinit:153]: Postinitalization phase ended. [10:20:57] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 6 mods [10:20:57] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Not Enough Items, FMLFileResourcePack:NuclearCraft [10:20:57] [Client thread/INFO]: SoundSystem shutting down... [10:20:57] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com [10:20:57] [sound Library Loader/INFO]: Starting up SoundSystem... [10:20:57] [Thread-13/INFO]: Initializing LWJGL OpenAL [10:20:57] [Thread-13/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [10:20:57] [Thread-13/INFO]: OpenAL initialized. [10:20:58] [sound Library Loader/INFO]: Sound engine started [10:20:59] [Client thread/INFO]: Created: 512x512 textures-atlas [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=3 not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=2 not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=4 not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=0 not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=2 not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=1 not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#inventory not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=4 not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:Refinery#burnbving_sides_count=3 not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=1 not found [10:20:59] [Client thread/ERROR] [FML]: Model definition for location nuclearcraft:NuclearBoiler#burnbving_sides_count=0 not found [10:21:17] [server thread/INFO]: Starting integrated minecraft server version 1.8 [10:21:17] [server thread/INFO]: Generating keypair [10:21:17] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance [10:21:17] [server thread/INFO] [FML]: Applying holder lookups [10:21:17] [server thread/INFO] [FML]: Holder lookups applied [10:21:18] [server thread/INFO] [FML]: Loading dimension 0 (Swag) (net.minecraft.server.integrated.IntegratedServer@57ab7ad9) [10:21:18] [server thread/INFO] [FML]: Loading dimension 1 (Swag) (net.minecraft.server.integrated.IntegratedServer@57ab7ad9) [10:21:18] [server thread/INFO] [FML]: Loading dimension -1 (Swag) (net.minecraft.server.integrated.IntegratedServer@57ab7ad9) [10:21:18] [server thread/INFO]: Preparing start region for level 0 [10:21:19] [server thread/INFO]: Changing view distance to 12, from 10 [10:21:20] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2 [10:21:20] [Netty Server IO #1/INFO] [FML]: Client protocol version 2 [10:21:20] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 6 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected] [10:21:20] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established [10:21:20] [server thread/INFO] [FML]: [server thread] Server side modded connection established [10:21:20] [server thread/INFO]: Player85[local:E:686f6c5a] logged in with entity id 119 at (-135.1219394250137, 67.0, 164.79377712835569) [10:21:20] [server thread/INFO]: Player85 joined the game [10:21:22] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@203a658f[id=c843d906-43ab-3137-9682-b42949d12a2f,name=Player85,properties={},legacy=false] com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:65) ~[YggdrasilAuthenticationService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:158) [YggdrasilMinecraftSessionService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:53) [YggdrasilMinecraftSessionService$1.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:50) [YggdrasilMinecraftSessionService$1.class:?] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?] at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:148) [YggdrasilMinecraftSessionService.class:?] at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [skinManager$3.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_31] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_31] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_31] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_31] at java.lang.Thread.run(Unknown Source) [?:1.8.0_31] [10:21:22] [server thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 3 java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 3 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:715) [FMLCommonHandler.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:727) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:669) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:171) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:540) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_31] Caused by: java.lang.ArrayIndexOutOfBoundsException: 3 at com.mod.gui.boiler.TileNuclearBoiler.getStackInSlot(TileNuclearBoiler.java:354) ~[TileNuclearBoiler.class:?] at net.minecraft.inventory.Slot.getStack(Slot.java:79) ~[slot.class:?] at net.minecraft.inventory.Container.getInventory(Container.java:75) ~[Container.class:?] at net.minecraft.inventory.Container.addCraftingToCrafters(Container.java:61) ~[Container.class:?] at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:92) ~[FMLNetworkHandler.class:?] at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2577) ~[EntityPlayer.class:?] at com.mod.gui.boiler.NuclearBoiler.onBlockActivated(NuclearBoiler.java:44) ~[NuclearBoiler.class:?] at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:476) ~[itemInWorldManager.class:?] at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:624) ~[NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:67) ~[C08PacketPlayerBlockPlacement.class:?] at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:114) ~[C08PacketPlayerBlockPlacement.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:24) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:714) ~[FMLCommonHandler.class:?] ... 5 more [10:21:22] [server thread/ERROR]: Encountered an unexpected exception net.minecraft.util.ReportedException: Ticking entity at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:781) ~[MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:669) ~[MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:171) ~[integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:540) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_31] Caused by: java.lang.ArrayIndexOutOfBoundsException: 3 at com.mod.gui.boiler.TileNuclearBoiler.getStackInSlot(TileNuclearBoiler.java:354) ~[TileNuclearBoiler.class:?] at net.minecraft.inventory.Slot.getStack(Slot.java:79) ~[slot.class:?] at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:97) ~[Container.class:?] at com.mod.gui.boiler.ContainerNuclearBoiler.detectAndSendChanges(ContainerNuclearBoiler.java:196) ~[ContainerNuclearBoiler.class:?] at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:263) ~[EntityPlayerMP.class:?] at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2031) ~[World.class:?] at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:758) ~[WorldServer.class:?] at net.minecraft.world.World.updateEntity(World.java:1997) ~[World.class:?] at net.minecraft.world.World.updateEntities(World.java:1823) ~[World.class:?] at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:587) ~[WorldServer.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:775) ~[MinecraftServer.class:?] ... 4 more [10:21:22] [server thread/ERROR]: This crash report has been saved to: C:\Users\student\Desktop\Lucas B\forge-1.8-11.14.3.1449-src\eclipse\.\crash-reports\crash-2015-06-19_10.21.22-server.txt [10:21:22] [server thread/INFO]: Stopping server [10:21:22] [server thread/INFO]: Saving players [10:21:23] [server thread/INFO]: Saving worlds [10:21:23] [server thread/INFO]: Saving chunks for level 'Swag'/Overworld [10:21:23] [server thread/INFO]: Saving chunks for level 'Swag'/Nether [10:21:23] [server thread/INFO]: Saving chunks for level 'Swag'/The End [10:21:23] [server thread/INFO] [FML]: Unloading dimension 0 [10:21:23] [server thread/INFO] [FML]: Unloading dimension -1 [10:21:23] [server thread/INFO] [FML]: Unloading dimension 1 [10:21:23] [server thread/INFO] [FML]: Applying holder lookups [10:21:23] [server thread/INFO] [FML]: Holder lookups applied [10:21:23] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded. Sup bruh.
June 19, 201510 yr Hi The problem is in your TileNuclearBoiler class. Some array is wrong there. Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.