
NikolaTheProgrammerNoob
Forge Modder-
Posts
47 -
Joined
-
Last visited
Everything posted by NikolaTheProgrammerNoob
-
Here is my recipes class. package com.nikola.carbonmod.crafting; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.nikola.carbonmod.init.CarbonBlocks; import com.nikola.carbonmod.init.CarbonItems; import net.minecraft.block.Block; import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; public class CraftingManager { private static final CraftingManager instance = new CraftingManager(); private List recipes = Lists.newArrayList(); private static final String __OBFID = "CL_00000090"; public static CraftingManager getInstance() { return instance; } private CraftingManager() { recipes = new ArrayList(); this.addRecipe(new ItemStack(CarbonBlocks.carbonBlock, 1), new Object[] {"AAA", "AAA", "AAA", 'A', CarbonItems.carbon}); this.addRecipe(new ItemStack(CarbonBlocks.steelBlock, 1), new Object[] {"AAA", "AAA", "AAA", 'A', CarbonItems.steelIngot}); this.addRecipe(new ItemStack(CarbonBlocks.siliconeBlock, 1), new Object[] {"AAA", "AAA", "AAA", 'A', CarbonItems.siliconeIngot}); this.addRecipe(new ItemStack(CarbonItems.steelIngot, 1), new Object[] {"ABA", 'A', CarbonItems.carbon, 'B', Items.iron_ingot }); this.addRecipe(new ItemStack(CarbonItems.steelRod, 1), new Object[] {"A", "A", 'A', CarbonItems.steelIngot }); this.addRecipe(new ItemStack(CarbonItems.steelSword, 1), new Object[] {" A ", " A ", " B ", 'A', CarbonItems.steelIngot, 'B', Items.stick }); this.addRecipe(new ItemStack(CarbonItems.steelPickaxe, 1), new Object[] {"AAA", " B ", " B ",'A', CarbonItems.steelIngot, 'B', Items.stick }); this.addRecipe(new ItemStack(CarbonItems.steelAxe, 1), new Object[] {"AAA", "AB ", " B ",'A', CarbonItems.steelIngot, 'B', Items.stick }); this.addRecipe(new ItemStack(CarbonItems.steelAxe, 1), new Object[] {"AAA", " BA", " B ", 'A', CarbonItems.steelIngot, 'B', Items.stick }); this.addRecipe(new ItemStack(CarbonItems.steelShovel, 1), new Object[] {" A ", " B ", " B ", 'A', CarbonItems.steelIngot, 'B', Items.stick }); this.addRecipe(new ItemStack(CarbonItems.steelHelmet, 1), new Object[] {"AAA", "A A", 'A', CarbonItems.steelIngot }); this.addRecipe(new ItemStack(CarbonItems.steelChestplate, 1), new Object[] {"A A", "AAA", "AAA",'A', CarbonItems.steelIngot }); this.addRecipe(new ItemStack(CarbonItems.steelLeggings, 1), new Object[] {"AAA", "A A", "A A", 'A', CarbonItems.steelIngot }); this.addRecipe(new ItemStack(CarbonItems.steelBoots, 1), new Object[] {"A A", "A A", 'A', CarbonItems.steelIngot }); Collections.sort(this.recipes, new IronForgeRecipeSorter(this)); } public IronForgeShapedRecipes addRecipe(ItemStack stack, Object ... recipeComponents) { String s = ""; int i = 0; int j = 0; int k = 0; if (recipeComponents[i] instanceof String[]) { String[] astring = (String[])((String[])recipeComponents[i++]); for (int l = 0; l < astring.length; ++l) { String s1 = astring[l]; ++k; j = s1.length(); s = s + s1; } } else { while (recipeComponents[i] instanceof String) { String s2 = (String)recipeComponents[i++]; ++k; j = s2.length(); s = s + s2; } } HashMap hashmap; for (hashmap = Maps.newHashMap(); i < recipeComponents.length; i += 2) { Character character = (Character)recipeComponents[i]; ItemStack itemstack1 = null; if (recipeComponents[i + 1] instanceof Item) { itemstack1 = new ItemStack((Item)recipeComponents[i + 1]); } else if (recipeComponents[i + 1] instanceof Block) { itemstack1 = new ItemStack((Block)recipeComponents[i + 1], 1, 32767); } else if (recipeComponents[i + 1] instanceof ItemStack) { itemstack1 = (ItemStack)recipeComponents[i + 1]; } hashmap.put(character, itemstack1); } ItemStack[] aitemstack = new ItemStack[j * k]; for (int i1 = 0; i1 < j * k; ++i1) { char c0 = s.charAt(i1); if (hashmap.containsKey(Character.valueOf(c0))) { aitemstack[i1] = ((ItemStack)hashmap.get(Character.valueOf(c0))).copy(); } else { aitemstack[i1] = null; } } IronForgeShapedRecipes shapedrecipes = new IronForgeShapedRecipes(j, k, aitemstack, stack); this.recipes.add(shapedrecipes); return shapedrecipes; } public void addShapelessRecipe(ItemStack stack, Object ... recipeComponents) { ArrayList arraylist = Lists.newArrayList(); Object[] aobject = recipeComponents; int i = recipeComponents.length; for (int j = 0; j < i; ++j) { Object object1 = aobject[j]; if (object1 instanceof ItemStack) { arraylist.add(((ItemStack)object1).copy()); } else if (object1 instanceof Item) { arraylist.add(new ItemStack((Item)object1)); } else { if (!(object1 instanceof Block)) { throw new IllegalArgumentException("Invalid shapeless recipe: unknown type " + object1.getClass().getName() + "!"); } arraylist.add(new ItemStack((Block)object1)); } } this.recipes.add(new IronForgeShapelessRecipes(stack, arraylist)); } public void addRecipe(IRecipe recipe) { this.recipes.add(recipe); } public ItemStack findMatchingRecipe(InventoryCrafting p_82787_1_, World worldIn) { Iterator iterator = this.recipes.iterator(); IRecipe irecipe; do { if (!iterator.hasNext()) { return null; } irecipe = (IRecipe)iterator.next(); } while (!irecipe.matches(p_82787_1_, worldIn)); return irecipe.getCraftingResult(p_82787_1_); } public ItemStack[] func_180303_b(InventoryCrafting p_180303_1_, World worldIn) { Iterator iterator = this.recipes.iterator(); while (iterator.hasNext()) { IRecipe irecipe = (IRecipe)iterator.next(); if (irecipe.matches(p_180303_1_, worldIn)) { return irecipe.getRemainingItems(p_180303_1_); } } ItemStack[] aitemstack = new ItemStack[p_180303_1_.getSizeInventory()]; for (int i = 0; i < aitemstack.length; ++i) { aitemstack[i] = p_180303_1_.getStackInSlot(i); } return aitemstack; } public List getRecipeList() { return this.recipes; } } I know you haven't said what the problem is yet, but thanks anyway
-
Now the GUI opens but I can't move my items When I click an item to drag it, it just puts it self back and when I use middle mouse on it I get the full stack and when I try to craft with the full stacks and click on the item that gets crafted it disapears and the items in the crafting grid all jump to a red 0 ! Please help
-
Hello, fellow forum addicts ! Unfortunately, this is my 3rd post that is related to Custom Craftin Tables... My problem is that I can't get my Custom Crafting Table to open the f-ing GUI ! I've tryed EVERYTHING ! Copying Minecraft code. Looking other peoples code. Looking at code from other mods. I've even started learning Java and learnt all the basics and know how to read the code. I am still learning it. But I can't find a way for this f-ing GUI to work ! So I turn to you guys again, and please don't say something like:"Go learn Java !" or "Stop posting this! It's stupid !" Cause I am learning Java and there is no other way of me getting to know how to fix this. So please just tell me what to edit in the code and I will thank you for your kindness and sensibility. Here is the code for all of you wanting to help me: I will not be pasting the imports and the packageds just so I save up space ! The Block Class: public class IronForge extends Block { private static final String __OBFID = "CL_00000221"; private BlockPos blockPos; public IronForge(Material materialIn) { super(materialIn); this.setHardness(3.0F); this.setResistance(15.0F); this.setStepSound(soundTypeAnvil); this.setBlockBounds(0, 0, 0, 1, 0.85F, 1); } public boolean onBlockActivated(World worldIn, int x, int y, int z, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote && playerIn.isSneaking()) { return true; } else { playerIn.openGui(Reference.MOD_ID, CarbonBlocks.guiIDIronForge, worldIn, x, y, z); return true; } } @Override public boolean isOpaqueCube() { return false; } public static class InterfaceCraftingTable implements IInteractionObject { private final World world; private final BlockPos position; private static final String __OBFID = "CL_00002127"; public InterfaceCraftingTable(World worldIn, BlockPos pos) { this.world = worldIn; this.position = pos; } public String getName() { return null; } public boolean hasCustomName() { return false; } public IChatComponent getDisplayName() { return new ChatComponentTranslation(CarbonBlocks.ironForge.getUnlocalizedName() + ".name", new Object[0]); } public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerIronForge(playerInventory, this.world, this.position); } public String getGuiID() { return "carbonmod:ironForge"; } } } The GUI for The Block Class: @SideOnly(Side.CLIENT) public class GuiIronForge extends GuiContainer { private static final ResourceLocation ironForgeGuiTextures = new ResourceLocation("textures/gui/container/ironForge.png"); private static final String __OBFID = "CL_00000750"; public GuiIronForge(InventoryPlayer playerInv, World worldIn) { this(playerInv, worldIn, BlockPos.ORIGIN); } public GuiIronForge(InventoryPlayer playerInv, World worldIn, BlockPos blockPosition) { super(new ContainerIronForge(playerInv, worldIn, blockPosition)); } protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752); this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); } protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(ironForgeGuiTextures); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); } } The Block Container Class: public class ContainerIronForge extends Container { public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); public IInventory craftResult = new InventoryCraftResult();; private World worldObj; private BlockPos field_178145_h; private static final String __OBFID = "CL_00001744"; public ContainerIronForge(InventoryPlayer invPlayer, World worldIn, BlockPos p_i45800_3) { this.worldObj = worldIn; this.field_178145_h = p_i45800_3; this.addSlotToContainer(new SlotCrafting(invPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35)); int i; int j; for (i = 0; i < 3; ++i) { for (j = 0; j < 3; ++j) { this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18)); } } for (i = 0; i < 3; ++i) { for (j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); } this.onCraftMatrixChanged(this.craftMatrix); } public ContainerIronForge(InventoryPlayer playerInv, World worldIn, int x, int y, int z) { } public void onCraftMatrixChanged(IInventory inventoryIn) { //this.craftResult.setInventorySlotContents(0, IronForgeCraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } public void onContainerClosed(EntityPlayer playerIn) { super.onContainerClosed(playerIn); if (!this.worldObj.isRemote) { for (int i = 0; i < 9; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != null) { playerIn.dropPlayerItemWithRandomChoice(itemstack, false); } } } } @Override public boolean canInteractWith(EntityPlayer playerIn) { return this.worldObj.getBlockState(this.field_178145_h).getBlock() != CarbonBlocks.ironForge ? false : playerIn.getDistanceSq((double)this.field_178145_h.getX() + 0.5D, (double)this.field_178145_h.getY() + 0.5D, (double)this.field_178145_h.getZ() + 0.5D) <= 64.0D; } public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; Slot slot = (Slot) this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (index == 0) { if (!this.mergeItemStack(itemstack1, 10, 46, true)) { return null; } slot.onSlotChange(itemstack1, itemstack); } else if (index >= 10 && index < 37) { if (!this.mergeItemStack(itemstack1, 37, 46, false)) { return null; } } else if (index >= 37 && index < 46) { if (!this.mergeItemStack(itemstack1, 10, 37, false)) { return null; } } else if (!this.mergeItemStack(itemstack1, 10, 46, false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack) null); } else { slot.onSlotChanged(); } if (itemstack1.stackSize == itemstack.stackSize) { return null; } slot.onPickupFromSlot(playerIn, itemstack1); } return itemstack; } @Override public boolean canMergeSlot(ItemStack p_94530_1_, Slot p_94530_2_) { return p_94530_2_.inventory != this.craftResult && super.canMergeSlot(p_94530_1_, p_94530_2_); } } And The GUI Handler Class: public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getTileEntity(new BlockPos(x, y, z)); if(ID == CarbonBlocks.guiIDIronForge) { return ID == CarbonBlocks.guiIDIronForge && world.getBlockState(new BlockPos(x, y, z)) == CarbonBlocks.ironForge ? new ContainerIronForge(player.inventory, world, x, y, z) : null; } return entity; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getTileEntity(new BlockPos(x, y, z)); if(ID == CarbonBlocks.guiIDIronForge) { return ID == CarbonBlocks.guiIDIronForge && world.getBlockState(new BlockPos(x, y, z)) == CarbonBlocks.ironForge ? new GuiIronForge(player.inventory, world/*, x, y, z*/) : null; } return entity; } } And I say this again, please don't post HATE replays because I am really, really.... really stuck.
-
Hello, fellow forum adicts ! Soo... my custom crafting table is not working for some reason The GUI wont open and the Console doesn't put out any information at all... Here is my code: The Block Class package com.nikola.carbonmod.blocks; import com.nikola.carbonmod.CarbonMod; import com.nikola.carbonmod.container.ContainerIronForge; import com.nikola.carbonmod.init.CarbonBlocks; import net.minecraft.block.Block; import net.minecraft.block.BlockWorkbench; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumFacing; import net.minecraft.util.IChatComponent; import net.minecraft.world.IInteractionObject; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.internal.FMLNetworkHandler; public class IronForge extends Block { private static final String __OBFID = "CL_00000221"; public IronForge(Material materialIn) { super(materialIn); this.setHardness(3.0F); this.setResistance(15.0F); this.isBlockContainer = true; } @Override public boolean isOpaqueCube() { return false; } @Override public boolean isFullCube() { return false; } public boolean onBlockActivated(World worldIn, int x, int y , int z, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote && playerIn.isSneaking()) { return true; } else { FMLNetworkHandler.openGui(playerIn, CarbonMod.instance, CarbonBlocks.guiIDIronForge, worldIn, x, y, z); return true; } } public static class InterfaceCraftingTable implements IInteractionObject { private final World world; private final BlockPos position; private static final String __OBFID = "CL_00002127"; public InterfaceCraftingTable(World worldIn, BlockPos pos) { this.world = worldIn; this.position = pos; } public String getName() { return null; } public boolean hasCustomName() { return false; } public IChatComponent getDisplayName() { return new ChatComponentTranslation(CarbonBlocks.ironForge.getUnlocalizedName() + ".name", new Object[0]); } public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerIronForge(playerInventory, this.world, this.position); } public String getGuiID() { return "carbonmod:ironForge"; } } } The Container for The Block package com.nikola.carbonmod.container; import com.nikola.carbonmod.crafting.IronForgeCraftingManager; import com.nikola.carbonmod.init.CarbonBlocks; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCraftResult; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotCrafting; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; public class ContainerIronForge extends Container { public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); public IInventory craftResult = new InventoryCraftResult();; private World worldObj; private BlockPos field_178145_h; private static final String __OBFID = "CL_00001744"; public ContainerIronForge(InventoryPlayer invPlayer, World worldIn, BlockPos p_i45800_3_) { this.worldObj = worldIn; this.field_178145_h = p_i45800_3_; this.addSlotToContainer(new SlotCrafting(invPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35)); int i; int j; for (i = 0; i < 3; ++i) { for (j = 0; j < 3; ++j) { this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18)); } } for (i = 0; i < 3; ++i) { for (j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); } this.onCraftMatrixChanged(this.craftMatrix); } //GuiHandlerConstructor public ContainerIronForge(InventoryPlayer invPlayer, World world, int x, int y, int z) { } public void onCraftMatrixChanged(IInventory inventoryIn) { //this.craftResult.setInventorySlotContents(0, IronForgeCraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } public void onContainerClosed(EntityPlayer playerIn) { super.onContainerClosed(playerIn); if (!this.worldObj.isRemote) { for (int i = 0; i < 9; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != null) { playerIn.dropPlayerItemWithRandomChoice(itemstack, false); } } } } @Override public boolean canInteractWith(EntityPlayer playerIn) { return this.worldObj.getBlockState(this.field_178145_h).getBlock() != CarbonBlocks.ironForge ? false : playerIn.getDistanceSq((double)this.field_178145_h.getX() + 0.5D, (double)this.field_178145_h.getY() + 0.5D, (double)this.field_178145_h.getZ() + 0.5D) <= 64.0D; } public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; Slot slot = (Slot) this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (index == 0) { if (!this.mergeItemStack(itemstack1, 10, 46, true)) { return null; } slot.onSlotChange(itemstack1, itemstack); } else if (index >= 10 && index < 37) { if (!this.mergeItemStack(itemstack1, 37, 46, false)) { return null; } } else if (index >= 37 && index < 46) { if (!this.mergeItemStack(itemstack1, 10, 37, false)) { return null; } } else if (!this.mergeItemStack(itemstack1, 10, 46, false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack) null); } else { slot.onSlotChanged(); } if (itemstack1.stackSize == itemstack.stackSize) { return null; } slot.onPickupFromSlot(playerIn, itemstack1); } return itemstack; } @Override public boolean canMergeSlot(ItemStack p_94530_1_, Slot p_94530_2_) { return p_94530_2_.inventory != this.craftResult && super.canMergeSlot(p_94530_1_, p_94530_2_); } } The Gui Handler package com.nikola.carbonmod.gui; import com.nikola.carbonmod.container.ContainerIronForge; import com.nikola.carbonmod.init.CarbonBlocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getTileEntity(new BlockPos(x, y, z)); if(ID == CarbonBlocks.guiIDIronForge) { return ID == CarbonBlocks.guiIDIronForge && world.getBlockState(new BlockPos(x, y, z)) == CarbonBlocks.ironForge ? new ContainerIronForge(player.inventory, world, x, y, z) : null; } return entity; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getTileEntity(new BlockPos(x, y, z)); if(ID == CarbonBlocks.guiIDIronForge) { return ID == CarbonBlocks.guiIDIronForge && world.getBlockState(new BlockPos(x, y, z)) == CarbonBlocks.ironForge ? new GuiIronForge(player.inventory, world, x, y, z) : null; } return entity; } } and The GUI for The Block package com.nikola.carbonmod.gui; import com.nikola.carbonmod.container.ContainerIronForge; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerWorkbench; import net.minecraft.util.BlockPos; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiIronForge extends GuiContainer { private static final ResourceLocation ironForgeGuiTextures = new ResourceLocation("textures/gui/container/ironForge.png"); private static final String __OBFID = "CL_00000750"; public GuiIronForge(InventoryPlayer playerInv, World worldIn, int x, int y, int z) { this(playerInv, worldIn, BlockPos.ORIGIN); } public GuiIronForge(InventoryPlayer playerInv, World worldIn, BlockPos blockPosition) { super(new ContainerIronForge(playerInv, worldIn, blockPosition)); } public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752); this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); } public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(ironForgeGuiTextures); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); } }
-
[1.8]--Custom Crafting Table not Working
NikolaTheProgrammerNoob replied to NikolaTheProgrammerNoob's topic in Modder Support
Still nothing -
[1.8]--Custom Crafting Table not Working
NikolaTheProgrammerNoob replied to NikolaTheProgrammerNoob's topic in Modder Support
Didn't work -
[1.8]--Custom Crafting Table not Working
NikolaTheProgrammerNoob replied to NikolaTheProgrammerNoob's topic in Modder Support
You mean like this: ? public boolean onBlockActivated(World worldIn, int x, int y , int z, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote) { return false; } else { FMLNetworkHandler.openGui(playerIn, CarbonMod.instance, CarbonBlocks.guiIDIronForge, worldIn, x, y, z); return true; } } -
[1.8]--Custom Crafting Table not Working
NikolaTheProgrammerNoob replied to NikolaTheProgrammerNoob's topic in Modder Support
Ok here is the code [embed=425,349]package com.nikola.carbonmod.container; import com.nikola.carbonmod.crafting.IronForgeCraftingManager; import com.nikola.carbonmod.init.CarbonBlocks; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCraftResult; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotCrafting; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; public class ContainerIronForge extends Container { public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); public IInventory craftResult = new InventoryCraftResult();; private World worldObj; private BlockPos blockPos; public ContainerIronForge(InventoryPlayer invPlayer, World world, BlockPos blockPos) { this.blockPos = blockPos; worldObj = world; this.addSlotToContainer(new SlotCrafting(invPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35)); int i; int j; for (i = 0; i < 3; ++i) { for (j = 0; j < 3; ++j) { this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18)); } } for (i = 0; i < 3; ++i) { for (j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); } onCraftMatrixChanged(craftMatrix); } //GuiHandlerConstructor public ContainerIronForge(InventoryPlayer invPlayer, World world, int x, int y, int z) { } @Override public boolean canInteractWith(EntityPlayer playerIn) { return this.worldObj.getBlockState(this.blockPos).getBlock() != CarbonBlocks.ironForge ? false : playerIn.getDistanceSq((double)this.blockPos.getX() + 0.5D, (double)this.blockPos.getY() + 0.5D, (double)this.blockPos.getZ() + 0.5D) <= 64.0D; } public void onCraftMatrixChanged(IInventory inventoryIn) { //this.craftResult.setInventorySlotContents(0, IronForgeCraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } public void onContainerClosed(EntityPlayer playerIn) { super.onContainerClosed(playerIn); if (!this.worldObj.isRemote) { for (int i = 0; i < 9; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != null) { playerIn.dropPlayerItemWithRandomChoice(itemstack, false); } } } } public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; Slot slot = (Slot) this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (index == 0) { if (!this.mergeItemStack(itemstack1, 10, 46, true)) { return null; } slot.onSlotChange(itemstack1, itemstack); } else if (index >= 10 && index < 37) { if (!this.mergeItemStack(itemstack1, 37, 46, false)) { return null; } } else if (index >= 37 && index < 46) { if (!this.mergeItemStack(itemstack1, 10, 37, false)) { return null; } } else if (!this.mergeItemStack(itemstack1, 10, 46, false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack) null); } else { slot.onSlotChanged(); } if (itemstack1.stackSize == itemstack.stackSize) { return null; } slot.onPickupFromSlot(playerIn, itemstack1); } return itemstack; } @Override public boolean canMergeSlot(ItemStack stack, Slot slot) { return slot.inventory != this.craftResult && super.canMergeSlot(stack, slot); } } [/embed] [embed=425,349]package com.nikola.carbonmod.blocks; import com.nikola.carbonmod.CarbonMod; import com.nikola.carbonmod.container.ContainerIronForge; import com.nikola.carbonmod.init.CarbonBlocks; import net.minecraft.block.Block; import net.minecraft.block.BlockWorkbench; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumFacing; import net.minecraft.util.IChatComponent; import net.minecraft.world.IInteractionObject; import net.minecraft.world.World; public class IronForge extends Block { public IronForge(Material materialIn) { super(materialIn); this.setHardness(3.0F); this.setResistance(15.0F); } @Override public boolean isOpaqueCube() { return false; } @Override public boolean isFullCube() { return false; } public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote) { return true; } else { playerIn.displayGui(new IronForge.InterfaceCraftingTable(worldIn, pos)); return true; } } public static class InterfaceCraftingTable implements IInteractionObject { private final World world; private final BlockPos position; private static final String __OBFID = "CL_00002127"; public InterfaceCraftingTable(World worldIn, BlockPos pos) { this.world = worldIn; this.position = pos; } public String getName() { return null; } public boolean hasCustomName() { return false; } public IChatComponent getDisplayName() { return new ChatComponentTranslation(CarbonBlocks.ironForge.getUnlocalizedName() + ".name", new Object[0]); } public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerIronForge(playerInventory, this.world, this.position); } public String getGuiID() { return "carbonmod:ironForge"; } } } [/embed] [embed=425,349]package com.nikola.carbonmod.gui; import org.lwjgl.opengl.GL11; import com.nikola.carbonmod.Reference; import com.nikola.carbonmod.container.ContainerIronForge; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; public class GuiIronForge extends GuiContainer { private ResourceLocation texture = new ResourceLocation(Reference.MOD_ID + ":" + "minecraft/texuters/gui/container/ironForge.png"); public GuiIronForge(InventoryPlayer invPlayer, World world, int x, int y, int z) { super(new ContainerIronForge(invPlayer, world, x, y, z)); this.xSize = 176; this.ySize = 166; } public void onGuiClosed() { super.onGuiClosed(); } protected void drawGuiContainerForgroundLayer(int i, int j) { this.fontRendererObj.drawString(StatCollector.translateToLocal("Iron Forge"), 100, 5, 0xFFFFFF); } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GL11.glColor4f(1F, 1F, 1F, 1F); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); } } [/embed] [embed=425,349]package com.nikola.carbonmod.gui; import com.nikola.carbonmod.container.ContainerIronForge; import com.nikola.carbonmod.init.CarbonBlocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getTileEntity(new BlockPos(x, y, z)); if(ID == CarbonBlocks.guiIDIronForge) { return ID == CarbonBlocks.guiIDIronForge && world.getBlockState(new BlockPos(x, y, z)) == CarbonBlocks.ironForge ? new ContainerIronForge(player.inventory, world, x, y, z) : null; } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity entity = world.getTileEntity(new BlockPos(x, y, z)); if(ID == CarbonBlocks.guiIDIronForge) { return ID == CarbonBlocks.guiIDIronForge && world.getBlockState(new BlockPos(x, y, z)) == CarbonBlocks.ironForge ? new ContainerIronForge(player.inventory, world, x, y, z) : null; } return null; } } [/embed] -
[1.8] Model/Texture Problems (blocks, items, GUI-es)
NikolaTheProgrammerNoob replied to Kethas's topic in Modder Support
Your code is very messy. Try rewriting your code and then you could see whats the problem instead of going onto the forums and asking for help. Remember, a good programmer always keep his code nice and legible. -
Hey there, fellow forum addicts ! I have a problem with my custom crafting table ! There are no errors in code ! Game doesn't crash on start ! Code is almost as same as in the Minecraft Workbench ! Note: I changed the field_178145_h to blockPos World loads fine, I try to click on the custom crafting table, and bam ! Nothing happens. I do get an error in my console which I will put down bellow. If I have an item in my hotbar, or more and I click the custom crafting table, it moves/ they move by one space. Sometimes when my hotbar is empty and I click the custom crafting table I get an item that I had before when I clicked the custom crafting table. Here is the error I get when I click the block: [18:50:03] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 45, Size: 45 java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 45, Size: 45 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_51] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_51] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:715) [FMLCommonHandler.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1077) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:376) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_51] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 45, Size: 45 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_51] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_51] at net.minecraft.inventory.Container.getSlot(Container.java:138) ~[Container.class:?] at net.minecraft.inventory.Container.putStacksInSlots(Container.java:574) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleWindowItems(NetHandlerPlayClient.java:1215) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.S30PacketWindowItems.func_180732_a(S30PacketWindowItems.java:67) ~[s30PacketWindowItems.class:?] at net.minecraft.network.play.server.S30PacketWindowItems.processPacket(S30PacketWindowItems.java:81) ~[s30PacketWindowItems.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_51] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_51] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:714) ~[FMLCommonHandler.class:?] ... 11 more
-
Hello! I'm a new developer and would like to share my mod with you fellow forum addicts ! I recently started making this awesome mod that I think looks cool. The mod includs a new ore called, you guessed it, Carbon ! And when you mine the Carbon ore you get, Carbon! It also has a new Quartz ore that spawns in the Overworld ! How cool is that, now you don't have to go to the Nether to get Quartz. But I didn't make this for all you lazy people. No ! I made it because from Quartz you can get Silicone powder, which when smelted gives you a Silicone Ingot ! And you can make Silicone Tools and Armor ! But thats not all, you can combine Silicone with Carbon to create Cast Iron, which you can also use to make Tools and Armor ! Wait, did you say that you can make Steel from Iron and Carbon ? Well, this mod actually let's you make Steel ! And not only that, but you can make multiple Steel alloys ! Isn't that just awesome ?! Now you may be thinking: "But wait ! Would it not be too simple to just put all of this in a Crafting Table and get this new super cool Tools and Armor?". It would ! That's why you have to create a special Iron Forge and Furnace to create all of your Super Cool new Tools and Armor. I hope you are looking forward to this mod as much as I am ! Because it will be soooo Cool ! Yours trully, ME.
-
Ok, so I dont know exactly where it started but here is the report after the first error: [embed=425,349]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 (x86) version 6.3 Java Version: 1.8.0_51, Oracle Corporation Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation Memory: 974123920 bytes (928 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '3.3.0' Renderer: 'GeForce GT 240/PCIe/SSE2' [15:23:52] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [15:23:52] [Client thread/INFO] [FML]: MinecraftForge v11.14.3.1502 Initialized [15:23:53] [Client thread/INFO] [FML]: Replaced 204 ore recipies [15:23:53] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [15:23:54] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer [15:23:54] [Client thread/INFO] [FML]: Searching C:\Users\nikola\Downloads\Mo' Things Mod\eclipse\mods for mods [15:24:01] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [15:24:02] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, carbonmod] at CLIENT [15:24:02] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, carbonmod] at SERVER [15:24:04] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:CarbonMod [15:24:04] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [15:24:04] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations [15:24:04] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations [15:24:04] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations [15:24:05] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [15:24:05] [Client thread/INFO] [FML]: Applying holder lookups [15:24:05] [Client thread/INFO] [FML]: Holder lookups applied [15:24:05] [Client thread/INFO] [FML]: Injecting itemstacks [15:24:05] [Client thread/INFO] [FML]: Itemstack injection complete [15:24:06] [sound Library Loader/INFO]: Starting up SoundSystem... [15:24:06] [Thread-9/INFO]: Initializing LWJGL OpenAL [15:24:06] [Thread-9/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.NullPointerException [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.ALC10.alcDestroyContext(ALC10.java:362) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.destroy(AL.java:210) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.init(AL.java:175) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.create(AL.java:138) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.create(AL.java:102) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.create(AL.java:201) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572) [15:24:08] [Thread-9/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.CommandThread.run(CommandThread.java:121) AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005 Exception in thread "Thread-9" [15:24:27] [Client thread/INFO] [FML]: Max texture size: 8192 [15:24:27] [Client thread/INFO]: Created: 16x16 textures-atlas [15:24:30] [Client thread/INFO] [FML]: Injecting itemstacks [15:24:30] [Client thread/INFO] [FML]: Itemstack injection complete [15:24:30] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods [15:24:30] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:CarbonMod [15:24:31] [sound Library Loader/INFO]: Starting up SoundSystem... [15:24:31] [Thread-11/INFO]: Initializing LWJGL OpenAL [15:24:31] [Thread-11/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [15:24:31] [Thread-11/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.IllegalStateException: Only one OpenAL context may be instantiated at any one time. [15:24:31] [Thread-11/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.create(AL.java:113) [15:24:31] [Thread-11/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.create(AL.java:102) [15:24:31] [Thread-11/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.create(AL.java:201) [15:24:31] [Thread-11/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164) [15:24:31] [Thread-11/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576) [15:24:31] [Thread-11/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572) [15:24:31] [Thread-11/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.CommandThread.run(CommandThread.java:121) Exception in thread "Thread-11" [15:24:48] [Client thread/INFO] [FML]: Max texture size: 8192 [15:24:48] [sound Library Loader/WARN]: ERROR MESSAGE: [15:24:48] [sound Library Loader/INFO]: SoundSystem did not load after 30 seconds. [15:24:48] [sound Library Loader/INFO]: Starting up SoundSystem... Exception in thread "Thread-13" [15:24:48] [Thread-13/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.NullPointerException [15:24:48] [Thread-13/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.ALC10.alcDestroyContext(ALC10.java:362) [15:24:48] [Thread-13/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.destroy(AL.java:210) [15:24:48] [Thread-13/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.libraries.LibraryLWJGLOpenAL.cleanup(LibraryLWJGLOpenAL.java:340) [15:24:48] [Thread-13/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1521) [15:24:48] [Thread-13/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572) [15:24:48] [Thread-13/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.CommandThread.run(CommandThread.java:121) [15:24:49] [Client thread/INFO]: Created: 512x512 textures-atlas [15:24:55] [server thread/INFO]: Starting integrated minecraft server version 1.8 [15:24:55] [server thread/INFO]: Generating keypair [15:24:56] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance [15:24:56] [server thread/INFO] [FML]: Applying holder lookups [15:24:56] [server thread/INFO] [FML]: Holder lookups applied [15:24:56] [server thread/INFO] [FML]: Loading dimension 0 (mod test) (net.minecraft.server.integrated.IntegratedServer@1d9006) [15:24:56] [server thread/INFO] [FML]: Loading dimension 1 (mod test) (net.minecraft.server.integrated.IntegratedServer@1d9006) [15:24:56] [server thread/INFO] [FML]: Loading dimension -1 (mod test) (net.minecraft.server.integrated.IntegratedServer@1d9006) [15:24:57] [server thread/INFO]: Preparing start region for level 0 [15:24:58] [server thread/INFO]: Preparing spawn area: 10% [15:24:59] [server thread/INFO]: Preparing spawn area: 72% [15:25:00] [server thread/INFO]: Changing view distance to 5, from 10 [15:25:07] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2 [15:25:07] [Netty Server IO #1/INFO] [FML]: Client protocol version 2 [15:25:07] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 4 mods : FML@8.0.99.99,Forge@11.14.3.1502,mcp@9.05,carbonmod@1.0 [15:25:07] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established [15:25:07] [server thread/INFO] [FML]: [server thread] Server side modded connection established [15:25:07] [server thread/INFO]: Player156[local:E:b19fb9cd] logged in with entity id 56 at (-648.7623300746113, 4.0625, -866.5700030656656) [15:25:07] [server thread/INFO]: Player156 joined the game [15:25:09] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@291e59[id=fd2b0ed7-411b-3fc7-aa79-261670dbe34f,name=Player156,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_51] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_51] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_51] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_51] at java.lang.Thread.run(Unknown Source) [?:1.8.0_51] [15:25:12] [sound Library Loader/WARN]: ERROR MESSAGE: [15:25:12] [sound Library Loader/INFO]: SoundSystem did not load after 30 seconds. [15:25:12] [sound Library Loader/INFO]: Starting up SoundSystem... Exception in thread "Thread-16" [15:25:12] [Thread-16/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.NullPointerException [15:25:12] [Thread-16/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.ALC10.alcDestroyContext(ALC10.java:362) [15:25:12] [Thread-16/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.lwjgl.openal.AL.destroy(AL.java:210) [15:25:12] [Thread-16/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.libraries.LibraryLWJGLOpenAL.cleanup(LibraryLWJGLOpenAL.java:340) [15:25:12] [Thread-16/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1521) [15:25:12] [Thread-16/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572) [15:25:12] [Thread-16/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at paulscode.sound.CommandThread.run(CommandThread.java:121) [15:25:13] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 3997ms behind, skipping 79 tick(s) [15:25:14] [server thread/INFO]: Player156 has just earned the achievement [Taking Inventory] [15:25:14] [Client thread/INFO]: [CHAT] Player156 has just earned the achievement [Taking Inventory] [15:25:29] [sound Library Loader/WARN]: ERROR MESSAGE: [15:25:29] [sound Library Loader/INFO]: SoundSystem did not load after 30 seconds. [15:25:29] [sound Library Loader/INFO]: Sound engine started [15:25:42] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 12661ms behind, skipping 253 tick(s) [15:25:51] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 5337ms behind, skipping 106 tick(s) [15:25:52] [sound Library Loader/WARN]: ERROR MESSAGE: [15:25:52] [sound Library Loader/INFO]: SoundSystem did not load after 30 seconds. [15:25:52] [sound Library Loader/INFO]: Sound engine started [15:26:16] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 10835ms behind, skipping 216 tick(s) [15:26:30] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 6040ms behind, skipping 120 tick(s) [15:26:50] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 7106ms behind, skipping 142 tick(s) [15:27:07] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 6051ms behind, skipping 121 tick(s) [15:27:26] [server thread/INFO]: Stopping server [15:27:26] [server thread/INFO]: Saving players [15:27:26] [server thread/INFO]: Saving worlds [15:27:26] [server thread/INFO]: Saving chunks for level 'mod test'/Overworld [15:27:26] [server thread/INFO]: Saving chunks for level 'mod test'/Nether [15:27:26] [server thread/INFO]: Saving chunks for level 'mod test'/The End [15:27:26] [server thread/INFO] [FML]: Unloading dimension 0 [15:27:26] [server thread/INFO] [FML]: Unloading dimension -1 [15:27:26] [server thread/INFO] [FML]: Unloading dimension 1 [15:27:26] [server thread/INFO] [FML]: Applying holder lookups [15:27:27] [server thread/INFO] [FML]: Holder lookups applied [15:27:28] [Client thread/FATAL]: Unreported exception thrown! java.lang.NullPointerException at net.minecraft.client.audio.SoundManager$SoundSystemStarterThread.playing(SoundManager.java:575) ~[soundManager$SoundSystemStarterThread.class:?] at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:273) ~[soundManager.class:?] at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:256) ~[soundHandler.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:2191) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1087) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:376) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_51] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] [15:27:28] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:663]: ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 11/8/15 3:27 PM Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraft.client.audio.SoundManager$SoundSystemStarterThread.playing(SoundManager.java:575) at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:273) at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:256) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2191) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1087) at net.minecraft.client.Minecraft.run(Minecraft.java:376) at net.minecraft.client.main.Main.main(Main.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.client.audio.SoundManager$SoundSystemStarterThread.playing(SoundManager.java:575) at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:273) at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:256) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player156'/56, l='MpServer', x=-664.70, y=4.00, z=-858.70]] Chunk stats: MultiplayerChunkCache: 121, 121 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: -637.00,4.00,-861.00 - World: (-637,4,-861), Chunk: (at 3,0,3 in -40,-54; contains blocks -640,0,-864 to -625,255,-849), Region: (-2,-2; contains chunks -64,-64 to -33,-33, blocks -1024,0,-1024 to -513,255,-513) Level time: 69625 game time, 272 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 23 total; [EntitySheep['Sheep'/32, l='MpServer', x=-622.09, y=4.00, z=-933.03], EntityCow['Cow'/33, l='MpServer', x=-626.94, y=4.00, z=-917.00], EntityCow['Cow'/34, l='MpServer', x=-610.94, y=4.00, z=-912.03], EntitySheep['Sheep'/35, l='MpServer', x=-613.25, y=4.00, z=-881.19], EntityCow['Cow'/4, l='MpServer', x=-741.09, y=4.00, z=-849.97], EntityCow['Cow'/36, l='MpServer', x=-593.91, y=4.00, z=-934.09], EntityPlayerSP['Player156'/56, l='MpServer', x=-664.70, y=4.00, z=-858.70], EntitySheep['Sheep'/37, l='MpServer', x=-603.88, y=4.00, z=-888.41], EntityCow['Cow'/5, l='MpServer', x=-735.31, y=4.00, z=-919.75], EntitySheep['Sheep'/6, l='MpServer', x=-733.06, y=4.00, z=-827.94], EntityCow['Cow'/7, l='MpServer', x=-724.22, y=4.00, z=-798.75], EntityCow['Cow'/40, l='MpServer', x=-588.09, y=4.00, z=-893.97], EntityCow['Cow'/8, l='MpServer', x=-712.09, y=4.00, z=-820.94], EntityRabbit['Rabbit'/9, l='MpServer', x=-705.72, y=4.00, z=-789.16], EntityCow['Cow'/10, l='MpServer', x=-712.94, y=4.00, z=-776.03], EntitySheep['Sheep'/14, l='MpServer', x=-694.00, y=4.00, z=-923.06], EntityCow['Cow'/15, l='MpServer', x=-698.22, y=4.00, z=-879.78], EntityChicken['Chicken'/17, l='MpServer', x=-684.47, y=4.00, z=-813.28], EntityArmorStand['Armor Stand'/18, l='MpServer', x=-659.50, y=4.00, z=-853.50], EntityArmorStand['Armor Stand'/19, l='MpServer', x=-659.50, y=4.00, z=-851.50], EntityArmorStand['Armor Stand'/24, l='MpServer', x=-653.50, y=4.00, z=-868.50], EntityArmorStand['Armor Stand'/25, l='MpServer', x=-643.50, y=4.00, z=-868.50], EntityItem['item.item.egg'/454361, l='MpServer', x=-684.31, y=4.00, z=-812.72]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2614) at net.minecraft.client.Minecraft.run(Minecraft.java:405) at net.minecraft.client.main.Main.main(Main.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 8.1 (x86) version 6.3 Java Version: 1.8.0_51, Oracle Corporation Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation Memory: 890818928 bytes (849 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1502 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.3.1502.jar) UCHIJAAAA Forge{11.14.3.1502} [Minecraft Forge] (forgeSrc-1.8-11.14.3.1502.jar) UCHIJAAAA carbonmod{1.0} [CarbonMod] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '3.3.0' Renderer: 'GeForce GT 240/PCIe/SSE2' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: GeForce GT 240/PCIe/SSE2 GL version 3.3.0, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) [15:27:28] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:663]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\nikola\Downloads\Mo' Things Mod\eclipse\.\crash-reports\crash-2015-11-08_15.27.28-client.txt Java HotSpot Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release [/embed]
-
Hello Forge Forums ! This is my first post, and hopefuly not the last .I have a problem with testing my Mod in Eclipse. The game would randomly crash without there being any errors in my code but there being errors with sound .Sometimes it crashes on clicking the Singeplayer buttong, sometimes when I don't wait for the chuncks to load but use my inventory, and sometimes it just suddenly crashes. Does anyone know how can I fix this or can I even fix this... Thanks