Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

GlowingWater

Members
  • Posts

    16
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

GlowingWater's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. When I put an item to my container, it automatically copies into the hotbar. What causes this? Container Class package com.gwater.decorationmod.container; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import com.gwater.decorationmod.tileentity.TileEntityCrate; public class ContainerCrate extends Container { private TileEntityCrate tileEntityCrate; 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; private final int VANILLA_FIRST_SLOT_INDEX = 0; private final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; private final int TE_INVENTORY_ROW_COUNT = 3; private final int TE_INVENTORY_COLUMN_COUNT = 3; private final int TE_INVENTORY_SLOT_COUNT = 3; public ContainerCrate(InventoryPlayer invPlayer, TileEntityCrate tileEntityCrate) { this.tileEntityCrate = tileEntityCrate; final int SLOT_X_SPACING = 18; final int SLOT_Y_SPACING = 18; final int HOTBAR_XPOS = 8; final int HOTBAR_YPOS = 140; 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 = 82; 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)); } } if(TE_INVENTORY_SLOT_COUNT != tileEntityCrate.getSizeInventory()) { System.err.println("Mismatched slot count in ContainerCrate(" + TE_INVENTORY_SLOT_COUNT + ") and TileEntityCrate(" + tileEntityCrate.getSizeInventory() + ")"); } final int TE_INVENTORY_XPOS = 62; final int TE_INVENTORY_YPOS = 15; for(int y = 0; y < TE_INVENTORY_ROW_COUNT; y++) { for(int x = 0; x < TE_INVENTORY_COLUMN_COUNT; x++) { int slotNumber = TE_INVENTORY_SLOT_COUNT + y * TE_INVENTORY_COLUMN_COUNT + x; int xpos = TE_INVENTORY_XPOS + SLOT_X_SPACING * x; int ypos = TE_INVENTORY_YPOS + SLOT_Y_SPACING * y; addSlotToContainer(new Slot(invPlayer, slotNumber, xpos, ypos)); } } //addSlotToContainer(new Slot(tileEntityCrate, slotNumber, TILE_INVENTORY_XPOS + SLOT_X_SPACING * x, TILE_INVENTORY_YPOS3)); } @Override public boolean canInteractWith(EntityPlayer playerIn) { return tileEntityCrate.isUseableByPlayer(playerIn); } @Override public ItemStack transferStackInSlot(EntityPlayer playerIn, 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 the tile inventory if (!mergeItemStack(sourceStack, TE_INVENTORY_FIRST_SLOT_INDEX, TE_INVENTORY_FIRST_SLOT_INDEX + TE_INVENTORY_SLOT_COUNT, false)){ return null; } } else if (sourceSlotIndex >= TE_INVENTORY_FIRST_SLOT_INDEX && sourceSlotIndex < TE_INVENTORY_FIRST_SLOT_INDEX + TE_INVENTORY_SLOT_COUNT) { // This is a TE slot so merge the stack into the players inventory 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(playerIn, sourceStack); return copyOfSourceStack; } @Override public void onContainerClosed(EntityPlayer playerIn) { super.onContainerClosed(playerIn); this.tileEntityCrate.closeInventory(playerIn); } } EDIT turned: for(int y = 0; y < TE_INVENTORY_ROW_COUNT; y++) { for(int x = 0; x < TE_INVENTORY_COLUMN_COUNT; x++) { int slotNumber = TE_INVENTORY_ROW_COUNT + y * TE_INVENTORY_COLUMN_COUNT + x; //3 + 0 * 3 + 0; int xpos = TE_INVENTORY_XPOS + x * SLOT_X_SPACING; int ypos = TE_INVENTORY_YPOS + y * SLOT_Y_SPACING; addSlotToContainer(new Slot(invPlayer, slotNumber, xpos, ypos)); } } to: for(int y = 0; y < TE_INVENTORY_ROW_COUNT; y++) { for(int x = 0; x < TE_INVENTORY_COLUMN_COUNT; x++) { int slotNumber = TE_INVENTORY_ROW_COUNT + y * TE_INVENTORY_COLUMN_COUNT + x; //3 + 0 * 3 + 0; int xpos = TE_INVENTORY_XPOS + x * SLOT_X_SPACING; int ypos = TE_INVENTORY_YPOS + y * SLOT_Y_SPACING; addSlotToContainer(new Slot(tileEntityCrate, slotNumber, xpos, ypos)); } } and console log appears when right-click the entity: [20:02:19] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@179586f[id=45c2c1e2-9dd4-3d62-8e53-82e2b4b32b4a,name=Player843,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:175) [YggdrasilMinecraftSessionService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:59) [YggdrasilMinecraftSessionService$1.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:56) [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:165) [YggdrasilMinecraftSessionService.class:?] at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3038) [Minecraft.class:?] at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:130) [skinManager$3.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_77] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_77] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77] [20:02:33] [server thread/INFO] [sTDERR]: [com.gwater.decorationmod.container.ContainerCrate:<init>:52]: Mismatched slot count in ContainerCrate(3) and TileEntityCrate(9) [20:02:33] [server thread/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 9 at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_77] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_77] at net.minecraft.util.Util.runTask(Util.java:24) [util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:738) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77] Caused by: java.lang.ArrayIndexOutOfBoundsException: 9 at com.gwater.decorationmod.tileentity.TileEntityCrate.getStackInSlot(TileEntityCrate.java:26) ~[TileEntityCrate.class:?] at net.minecraft.inventory.Slot.getStack(Slot.java:81) ~[slot.class:?] at net.minecraft.inventory.Container.getInventory(Container.java:62) ~[Container.class:?] at net.minecraft.inventory.Container.onCraftGuiOpened(Container.java:51) ~[Container.class:?] at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) ~[FMLNetworkHandler.class:?] at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2694) ~[EntityPlayer.class:?] at com.gwater.decorationmod.block.Crate.onBlockActivated(Crate.java:42) ~[Crate.class:?] at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:455) ~[PlayerInteractionManager.class:?] at net.minecraft.network.NetHandlerPlayServer.processRightClickBlock(NetHandlerPlayServer.java:706) ~[NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItem.processPacket(CPacketPlayerTryUseItem.java:68) ~[CPacketPlayerTryUseItem.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItem.processPacket(CPacketPlayerTryUseItem.java:13) ~[CPacketPlayerTryUseItem.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_77] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_77] at net.minecraft.util.Util.runTask(Util.java:23) ~[util.class:?] ... 5 more [20:02:33] [server thread/ERROR]: Encountered an unexpected exception net.minecraft.util.ReportedException: Ticking player at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:785) ~[MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) ~[MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) ~[integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77] Caused by: java.lang.ArrayIndexOutOfBoundsException: 9 at com.gwater.decorationmod.tileentity.TileEntityCrate.getStackInSlot(TileEntityCrate.java:26) ~[TileEntityCrate.class:?] at net.minecraft.inventory.Slot.getStack(Slot.java:81) ~[slot.class:?] at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:84) ~[Container.class:?] at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:290) ~[EntityPlayerMP.class:?] at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2086) ~[World.class:?] at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:864) ~[WorldServer.class:?] at net.minecraft.world.World.updateEntity(World.java:2051) ~[World.class:?] at net.minecraft.world.WorldServer.tickPlayers(WorldServer.java:666) ~[WorldServer.class:?] at net.minecraft.world.World.updateEntities(World.java:1858) ~[World.class:?] at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:637) ~[WorldServer.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:779) ~[MinecraftServer.class:?] ... 4 more [20:02:33] [server thread/ERROR]: This crash report has been saved to: C:\Users\El3mentz\Desktop\DecorationMod\run\.\crash-reports\crash-2016-04-13_20.02.33-server.txt [20:02:33] [server thread/INFO]: Stopping server [20:02:33] [server thread/INFO]: Saving players [20:02:33] [server thread/INFO]: Saving worlds [20:02:33] [server thread/INFO]: Saving chunks for level 'Showcase'/Overworld [20:02:33] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:645]: ---- Minecraft Crash Report ---- // You should try our sister game, Minceraft! Time: 13.04.16 20:02 Description: Ticking player java.lang.ArrayIndexOutOfBoundsException: 9 at com.gwater.decorationmod.tileentity.TileEntityCrate.getStackInSlot(TileEntityCrate.java:26) at net.minecraft.inventory.Slot.getStack(Slot.java:81) at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:84) at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:290) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2086) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:864) at net.minecraft.world.World.updateEntity(World.java:2051) at net.minecraft.world.WorldServer.tickPlayers(WorldServer.java:666) at net.minecraft.world.World.updateEntities(World.java:1858) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:637) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:779) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) at java.lang.Thread.run(Thread.java:745) Found the important logs. Maybe it will help: at com.gwater.decorationmod.tileentity.TileEntityCrate.getStackInSlot(TileEntityCrate.java:26) ~[TileEntityCrate.class:?] at com.gwater.decorationmod.block.Crate.onBlockActivated(Crate.java:42) ~[Crate.class:?] Fixed it. I had to change this line of code: int slotNumber = TE_INVENTORY_ROW_COUNT + y * TE_INVENTORY_COLUMN_COUNT + x; to: int slotNumber = x + y * 3; //position + position * slotAmount
  2. Thanks coolAliaz. I was in fact returning container for client-side. Updated code: @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID != getGuiID()) { System.err.println("Invalid ID: expected " + getGuiID() + ", received " + ID); } BlockPos xyz = new BlockPos(x, y, z); TileEntity tileEntity = world.getTileEntity(xyz); if(tileEntity instanceof TileEntityCrate) { TileEntityCrate tileEntityCrate = (TileEntityCrate)tileEntity; return new GuiCrate(player.inventory, tileEntityCrate); } return null; }
  3. Thanks for reply. Did what you said but it still doesn't open up. Updated code: @Mod(modid = References.MODID, version = References.VERSION, name = References.NAME, guiFactory="com.gwater.decorationmod.handler.GuiHandlerCrate") Have a console report also: [15:49:58] [Client thread/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.ClassCastException: com.gwater.decorationmod.container.ContainerCrate cannot be cast to net.minecraft.client.gui.GuiScreen at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_77] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_77] at net.minecraft.util.Util.runTask(Util.java:24) [util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1104) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:401) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77] 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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.ClassCastException: com.gwater.decorationmod.container.ContainerCrate cannot be cast to net.minecraft.client.gui.GuiScreen at net.minecraftforge.fml.client.FMLClientHandler.showGuiScreen(FMLClientHandler.java:471) ~[FMLClientHandler.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.showGuiScreen(FMLCommonHandler.java:309) ~[FMLCommonHandler.class:?] at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:103) ~[FMLNetworkHandler.class:?] at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2694) ~[EntityPlayer.class:?] at net.minecraftforge.fml.common.network.internal.OpenGuiHandler.process(OpenGuiHandler.java:39) ~[OpenGuiHandler.class:?] at net.minecraftforge.fml.common.network.internal.OpenGuiHandler.access$000(OpenGuiHandler.java:15) ~[OpenGuiHandler.class:?] at net.minecraftforge.fml.common.network.internal.OpenGuiHandler$1.run(OpenGuiHandler.java:30) ~[OpenGuiHandler$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_77] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_77] at net.minecraft.util.Util.runTask(Util.java:23) ~[util.class:?] ... 15 more
  4. Hey, I'm having an issue with my custom block. When I right-click it, my GUI doesn't show up. What's the reason? Main Class GameRegistry.registerBlock(crate, crate.getUnlocalizedName().substring(5)); GameRegistry.registerTileEntity(TileEntityCrate.class, "tile_crate"); NetworkRegistry.INSTANCE.registerGuiHandler(DecorationMod.instance, new GuiHandlerCrate()); Block Class package com.gwater.decorationmod.block; import net.minecraft.block.BlockContainer; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import com.gwater.decorationmod.DecorationMod; import com.gwater.decorationmod.handler.GuiHandlerCrate; import com.gwater.decorationmod.tileentity.TileEntityCrate; public class Crate extends BlockContainer { public Crate(Material wood) { super(wood); this.setUnlocalizedName("crate"); this.setHardness(2.5F); this.setHarvestLevel("axe", 0); this.setStepSound(SoundType.WOOD); this.setCreativeTab(DecorationMod.tabDecorationMod); } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityCrate(); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if(!worldIn.isRemote) { playerIn.openGui(DecorationMod.instance, GuiHandlerCrate.getGuiID(), worldIn, pos.getX(), pos.getY(), pos.getZ()); } return true; } @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { IInventory inventory = worldIn.getTileEntity(pos) instanceof IInventory ? (IInventory)worldIn.getTileEntity(pos) : null; if(inventory != null) { for(int i = 0; i < inventory.getSizeInventory(); i++) { if(inventory.getStackInSlot(i) != null) { EntityItem item = new EntityItem(worldIn, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, inventory.getStackInSlot(i)); float multiplier = 0.1F; float motionX = worldIn.rand.nextFloat() - 0.5F; float motionY = worldIn.rand.nextFloat() - 0.5F; float motionZ = worldIn.rand.nextFloat() - 0.5F; item.motionX = motionX * multiplier; item.motionY = motionY * multiplier; item.motionZ = motionZ * multiplier; worldIn.spawnEntityInWorld(item); } } inventory.clear(); } super.breakBlock(worldIn, pos, state); } @Override public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.SOLID; } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } @Override public boolean isOpaqueCube(IBlockState state) { return true; } @Override public boolean isFullCube(IBlockState state) { return true; } } Container Class package com.gwater.decorationmod.container; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import com.gwater.decorationmod.tileentity.TileEntityCrate; public class ContainerCrate extends Container { private TileEntityCrate tileEntityCrate; 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; private final int VANILLA_FIRST_SLOT_INDEX = 0; private final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; private final int TE_INVENTORY_SLOT_COUNT = 9; public ContainerCrate(InventoryPlayer invPlayer, TileEntityCrate tileEntityCrate) { this.tileEntityCrate = tileEntityCrate; final int SLOT_X_SPACING = 18; final int SLOT_Y_SPACING = 18; final int HOTBAR_XPOS = 8; final int HOTBAR_YPOS = 109; 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 = 51; 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)); } } if(TE_INVENTORY_SLOT_COUNT != tileEntityCrate.getSizeInventory()) { System.err.println("Mismatched slot count in ContainerCrate(" + TE_INVENTORY_SLOT_COUNT + ") and TileEntityCrate(" + tileEntityCrate.getSizeInventory() + ")"); } final int TILE_INVENTORY_XPOS = 8; final int TILE_INVENTORY_YPOS = 20; for(int x = 0; x < TE_INVENTORY_SLOT_COUNT; x++) { int slotNumber = x; addSlotToContainer(new Slot(tileEntityCrate, slotNumber, TILE_INVENTORY_XPOS + SLOT_X_SPACING * x, TILE_INVENTORY_YPOS)); } } @Override public boolean canInteractWith(EntityPlayer playerIn) { return tileEntityCrate.isUseableByPlayer(playerIn); } @Override public ItemStack transferStackInSlot(EntityPlayer playerIn, 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 the tile inventory if (!mergeItemStack(sourceStack, TE_INVENTORY_FIRST_SLOT_INDEX, TE_INVENTORY_FIRST_SLOT_INDEX + TE_INVENTORY_SLOT_COUNT, false)){ return null; } } else if (sourceSlotIndex >= TE_INVENTORY_FIRST_SLOT_INDEX && sourceSlotIndex < TE_INVENTORY_FIRST_SLOT_INDEX + TE_INVENTORY_SLOT_COUNT) { // This is a TE slot so merge the stack into the players inventory 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(playerIn, sourceStack); return copyOfSourceStack; } @Override public void onContainerClosed(EntityPlayer playerIn) { super.onContainerClosed(playerIn); this.tileEntityCrate.closeInventory(playerIn); } } GUI Class package com.gwater.decorationmod.gui; import java.awt.Color; 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.util.ResourceLocation; import com.gwater.decorationmod.References; import com.gwater.decorationmod.container.ContainerCrate; import com.gwater.decorationmod.tileentity.TileEntityCrate; public class GuiCrate extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation(References.MODID, "/textures/gui/crate_gui_bg.png"); private TileEntityCrate tileEntityCrate; public GuiCrate(InventoryPlayer invPlayer, TileEntityCrate tile) { super(new ContainerCrate(invPlayer, tile)); tileEntityCrate = tile; xSize = 176; ySize = 133; } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { Minecraft.getMinecraft().getTextureManager().bindTexture(texture); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { final int LABEL_XPOS = 5; final int LABEL_YPOS = 5; fontRendererObj.drawString(tileEntityCrate.getDisplayName().getUnformattedText(), LABEL_XPOS, LABEL_YPOS, Color.DARK_GRAY.getRGB()); } } GUI Handler Class package com.gwater.decorationmod.handler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; import com.gwater.decorationmod.container.ContainerCrate; import com.gwater.decorationmod.tileentity.TileEntityCrate; public class GuiHandlerCrate implements IGuiHandler { private static final int GUI_ID = 30; public static int getGuiID() {return GUI_ID;} @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID != getGuiID()) { System.err.println("Invalid ID: expected " + getGuiID() + ", received " + ID); } BlockPos xyz = new BlockPos(x, y, z); TileEntity tileEntity = world.getTileEntity(xyz); if(tileEntity instanceof TileEntityCrate) { TileEntityCrate tileEntityCrate = (TileEntityCrate)tileEntity; return new ContainerCrate(player.inventory, tileEntityCrate); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID != getGuiID()) { System.err.println("Invalid ID: expected " + getGuiID() + ", received " + ID); } BlockPos xyz = new BlockPos(x, y, z); TileEntity tileEntity = world.getTileEntity(xyz); if(tileEntity instanceof TileEntityCrate) { TileEntityCrate tileEntityCrate = (TileEntityCrate)tileEntity; return new ContainerCrate(player.inventory, tileEntityCrate); } return null; } } Tile Entity Class package com.gwater.decorationmod.tileentity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentTranslation; import scala.actors.threadpool.Arrays; public class TileEntityCrate extends TileEntity implements IInventory { final int NUMBER_OF_SLOTS = 9; private ItemStack[] itemStacks = new ItemStack[NUMBER_OF_SLOTS]; @Override public int getSizeInventory() { return itemStacks.length; } @Override public ItemStack getStackInSlot(int index) { return itemStacks[index]; } @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; } @Override public void setInventorySlotContents(int slotIndex, ItemStack stack) { itemStacks[slotIndex] = stack; if(stack != null && stack.stackSize > getInventoryStackLimit()) { stack.stackSize = getInventoryStackLimit(); } markDirty(); } @Override public int getInventoryStackLimit() { return 64; } @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; } @Override public boolean isItemValidForSlot(int index, ItemStack stack) { return true; } @Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); 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); } } compound.setTag("Items", dataForAllSlots); } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); final byte NBT_TYPE_COMPOUND = 10; NBTTagList dataForAllSlots = compound.getTagList("Items", NBT_TYPE_COMPOUND); Arrays.fill(itemStacks, null); for(int i = 0; i < dataForAllSlots.tagCount(); i++) { NBTTagCompound dataForOneSlot = dataForAllSlots.getCompoundTagAt(i); int slotIndex = dataForOneSlot.getByte("Slot") & 255; if(slotIndex >= 0 && slotIndex < this.itemStacks.length) { this.itemStacks[slotIndex] = ItemStack.loadItemStackFromNBT(dataForOneSlot); } } } @Override public void clear() { Arrays.fill(itemStacks, null); } @Override public String getName() { return "container.crate.name"; } @Override public boolean hasCustomName() { return false; } @Override public ITextComponent getDisplayName() { return this.hasCustomName() ? new TextComponentString(this.getName()) : new TextComponentTranslation(this.getName()); } @Override public ItemStack removeStackFromSlot(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) {} @Override public int getField(int id) { return 0; } @Override public void setField(int id, int value) {} @Override public int getFieldCount() { return 0; } }
  5. 1. I don't know 2. I don't understand you, because i'm from Poland
  6. At now I have another crash report... ---- Minecraft Crash Report ---- // Why is it breaking Time: 24.03.15 16:24 Description: Unexpected error java.lang.ArrayIndexOutOfBoundsException: 1 at com.glowingwater.cherrieland.biome.features.CherrieSapling.getIcon(CherrieSapling.java:62) at net.minecraft.client.renderer.RenderBlocks.getBlockIconFromSideAndMetadata(RenderBlocks.java:8451) at net.minecraft.client.renderer.RenderBlocks.renderCrossedSquares(RenderBlocks.java:3716) at net.minecraft.client.renderer.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:351) at net.minecraft.client.renderer.WorldRenderer.updateRenderer(WorldRenderer.java:207) at net.minecraft.client.renderer.RenderGlobal.updateRenderers(RenderGlobal.java:1618) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1263) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1056) at net.minecraft.client.Minecraft.run(Minecraft.java:951) at net.minecraft.client.main.Main.main(Main.java:164) 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 com.glowingwater.cherrieland.biome.features.CherrieSapling.getIcon(CherrieSapling.java:62) at net.minecraft.client.renderer.RenderBlocks.getBlockIconFromSideAndMetadata(RenderBlocks.java:8451) at net.minecraft.client.renderer.RenderBlocks.renderCrossedSquares(RenderBlocks.java:3716) at net.minecraft.client.renderer.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:351) at net.minecraft.client.renderer.WorldRenderer.updateRenderer(WorldRenderer.java:207) at net.minecraft.client.renderer.RenderGlobal.updateRenderers(RenderGlobal.java:1618) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1263) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Player719'/192, l='MpServer', x=-68,12, y=66,62, z=225,90]] Chunk stats: MultiplayerChunkCache: 289, 289 Level seed: 0 Level generator: ID 04 - cherrie, ver 0. Features enabled: false Level generator options: Level spawn location: World: (-64,64,212), Chunk: (at 0,4,4 in -4,13; contains blocks -64,0,208 to -49,255,223), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Level time: 83 game time, 83 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: 76 total; [EntityBat['Bat'/1361, l='MpServer', x=-16,15, y=20,40, z=160,03], EntityZombie['Zombie'/2185, l='MpServer', x=-141,50, y=31,00, z=208,50], EntitySkeleton['Skeleton'/800, l='MpServer', x=-148,50, y=17,00, z=288,50], EntitySkeleton['Skeleton'/801, l='MpServer', x=-145,50, y=17,00, z=283,50], EntitySkeleton['Skeleton'/1397, l='MpServer', x=-108,50, y=24,00, z=170,50], EntityCreeper['Creeper'/796, l='MpServer', x=-5,50, y=30,00, z=170,50], EntitySkeleton['Skeleton'/2228, l='MpServer', x=-49,56, y=50,00, z=174,65], EntityBat['Bat'/792, l='MpServer', x=-3,45, y=41,61, z=212,59], EntityZombie['Zombie'/1865, l='MpServer', x=-110,50, y=36,00, z=181,50], EntityCreeper['Creeper'/2220, l='MpServer', x=-143,50, y=49,00, z=194,50], EntityChicken['Chicken'/63, l='MpServer', x=-106,50, y=84,00, z=264,50], EntityChicken['Chicken'/62, l='MpServer', x=-109,50, y=92,00, z=265,50], EntityChicken['Chicken'/61, l='MpServer', x=-109,50, y=93,00, z=267,50], EntitySkeleton['Skeleton'/2270, l='MpServer', x=-43,50, y=52,00, z=166,50], EntityChicken['Chicken'/64, l='MpServer', x=-105,50, y=83,00, z=266,50], EntitySkeleton['Skeleton'/614, l='MpServer', x=-106,50, y=26,00, z=176,50], EntityEnderman['Enderman'/1849, l='MpServer', x=-138,50, y=42,00, z=210,50], EntitySkeleton['Skeleton'/615, l='MpServer', x=-109,50, y=26,00, z=179,50], EntityCreeper['Creeper'/612, l='MpServer', x=-107,50, y=26,00, z=174,50], EntityCreeper['Creeper'/613, l='MpServer', x=-109,50, y=26,00, z=174,50], EntitySkeleton['Skeleton'/616, l='MpServer', x=-107,50, y=26,00, z=176,50], EntitySkeleton['Skeleton'/617, l='MpServer', x=-107,50, y=26,00, z=179,50], EntityChicken['Chicken'/72, l='MpServer', x=-88,50, y=79,00, z=236,50], EntityChicken['Chicken'/73, l='MpServer', x=-91,50, y=80,00, z=233,50], EntityChicken['Chicken'/74, l='MpServer', x=-92,50, y=80,00, z=232,50], EntityChicken['Chicken'/75, l='MpServer', x=-93,48, y=80,00, z=232,52], EntityChicken['Chicken'/85, l='MpServer', x=-67,50, y=71,00, z=257,50], EntityChicken['Chicken'/84, l='MpServer', x=-65,50, y=64,00, z=203,50], EntityChicken['Chicken'/87, l='MpServer', x=-67,94, y=72,00, z=254,55], EntityChicken['Chicken'/86, l='MpServer', x=-68,50, y=65,00, z=258,50], EntityBat['Bat'/1294, l='MpServer', x=-143,10, y=52,00, z=175,19], EntityChicken['Chicken'/81, l='MpServer', x=-61,50, y=64,00, z=203,50], EntityChicken['Chicken'/83, l='MpServer', x=-63,50, y=65,00, z=204,50], EntityChicken['Chicken'/82, l='MpServer', x=-62,50, y=64,00, z=203,50], EntitySkeleton['Skeleton'/877, l='MpServer', x=-39,50, y=60,00, z=244,50], EntityChicken['Chicken'/88, l='MpServer', x=-64,50, y=71,00, z=259,50], EntityChicken['Chicken'/102, l='MpServer', x=-47,50, y=64,00, z=293,50], EntityChicken['Chicken'/103, l='MpServer', x=-47,50, y=71,00, z=291,50], EntityChicken['Chicken'/101, l='MpServer', x=-48,50, y=64,00, z=294,50], EntityChicken['Chicken'/108, l='MpServer', x=-34,50, y=80,00, z=241,50], EntityChicken['Chicken'/106, l='MpServer', x=-31,50, y=75,00, z=242,50], EntityChicken['Chicken'/107, l='MpServer', x=-32,33, y=76,00, z=243,54], EntityChicken['Chicken'/104, l='MpServer', x=-48,50, y=71,00, z=290,50], EntityChicken['Chicken'/105, l='MpServer', x=-29,50, y=81,00, z=240,50], EntityEnderman['Enderman'/1557, l='MpServer', x=-0,41, y=38,00, z=234,77], EntitySkeleton['Skeleton'/1556, l='MpServer', x=-0,50, y=38,00, z=230,50], EntityCreeper['Creeper'/1559, l='MpServer', x=-115,50, y=24,00, z=184,29], EntityCreeper['Creeper'/2306, l='MpServer', x=-123,50, y=31,00, z=188,50], EntityCreeper['Creeper'/2304, l='MpServer', x=-127,50, y=31,00, z=194,50], EntityCreeper['Creeper'/2305, l='MpServer', x=-129,50, y=31,00, z=193,50], EntityFallingBlock['Falling Block'/2314, l='MpServer', x=-58,50, y=31,96, z=112,50], EntityFallingBlock['Falling Block'/2318, l='MpServer', x=-49,50, y=17,46, z=264,50], EntityBat['Bat'/395, l='MpServer', x=-26,58, y=51,00, z=150,56], EntityEnderman['Enderman'/393, l='MpServer', x=-147,50, y=30,00, z=271,50], EntityEnderman['Enderman'/392, l='MpServer', x=-146,50, y=30,00, z=273,50], EntityBat['Bat'/396, l='MpServer', x=-23,52, y=51,14, z=149,64], EntityZombie['Zombie'/2025, l='MpServer', x=-38,50, y=54,00, z=155,50], EntityZombie['Zombie'/2027, l='MpServer', x=-39,53, y=55,00, z=158,08], EntityCreeper['Creeper'/1485, l='MpServer', x=-24,50, y=33,00, z=240,50], EntityZombie['Zombie'/2026, l='MpServer', x=-39,50, y=54,00, z=154,50], EntitySkeleton['Skeleton'/2029, l='MpServer', x=-146,50, y=35,00, z=192,50], EntityCreeper['Creeper'/2031, l='MpServer', x=-145,50, y=35,00, z=194,50], EntitySkeleton['Skeleton'/2030, l='MpServer', x=-148,50, y=35,00, z=193,50], EntityZombie['Zombie'/2097, l='MpServer', x=-14,50, y=64,00, z=218,50], EntityZombie['Zombie'/1737, l='MpServer', x=-57,50, y=21,00, z=280,50], EntityZombie['Zombie'/2104, l='MpServer', x=-125,50, y=22,00, z=192,50], EntityCreeper['Creeper'/2090, l='MpServer', x=-117,50, y=25,00, z=176,50], EntityCreeper['Creeper'/2091, l='MpServer', x=-114,50, y=25,00, z=173,50], EntityBat['Bat'/900, l='MpServer', x=-28,25, y=54,45, z=225,79], EntityFallingBlock['Falling Block'/2092, l='MpServer', x=-115,50, y=31,37, z=320,50], EntityZombie['Zombie'/2140, l='MpServer', x=-148,50, y=21,00, z=270,50], EntityClientPlayerMP['Player719'/192, l='MpServer', x=-68,12, y=66,62, z=225,90], EntityBat['Bat'/989, l='MpServer', x=-52,86, y=17,67, z=264,66], EntitySkeleton['Skeleton'/1945, l='MpServer', x=-107,50, y=39,00, z=167,50], EntityZombie['Zombie'/1684, l='MpServer', x=-116,50, y=24,00, z=181,50], EntitySkeleton['Skeleton'/1683, l='MpServer', x=-116,50, y=24,00, z=183,50]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2555) at net.minecraft.client.Minecraft.run(Minecraft.java:980) at net.minecraft.client.main.Main.main(Main.java:164) 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.7.10 Operating System: Windows 7 (x86) version 6.1 Java Version: 1.7.0_67, Oracle Corporation Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation Memory: 735562536 bytes (701 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95 FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.85.1291} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.2.1291} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available cherrieland{1.0.0} [Cherrie Land] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GT 630/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. 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) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1) This code: @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { meta &= 7; return iconLength[MathHelper.clamp_int(meta, 0, 5)]; } and i can't set unlocalized name because there's an error.
  7. Here's crash report: ---- Minecraft Crash Report ---- // On the bright side, I bought you a teddy bear! Time: 24.03.15 16:01 Description: There was a severe problem during mod loading that has caused the game to fail cpw.mods.fml.common.LoaderException: java.lang.IllegalArgumentException: The name cherrieland:null has been registered twice, for com.glowingwater.cherrieland.blocks.CherrieLeaves@9166e7 and com.glowingwater.cherrieland.biome.features.CherrieSapling@16702aa. at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:233) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:182) at com.glowingwater.cherrieland.init.ModBlocks.mainRegistry(ModBlocks.java:45) at com.glowingwater.cherrieland.CherrieLand.preInit(CherrieLand.java:41) 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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) 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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:239) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) at net.minecraft.client.Minecraft.run(Minecraft.java:931) at net.minecraft.client.main.Main.main(Main.java:164) 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) Caused by: java.lang.IllegalArgumentException: The name cherrieland:null has been registered twice, for com.glowingwater.cherrieland.blocks.CherrieLeaves@9166e7 and com.glowingwater.cherrieland.biome.features.CherrieSapling@16702aa. at cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:383) at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:883) at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:858) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:223) ... 42 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (x86) version 6.1 Java Version: 1.7.0_67, Oracle Corporation Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation Memory: 901500992 bytes (859 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{7.10.85.1291} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized Forge{10.13.2.1291} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized cherrieland{1.0.0} [Cherrie Land] (bin) Unloaded->Constructed->Errored CherrieLand.java - line 41 ModBlocks.mainRegistry(); ModBlocks.java - line 45 GameRegistry.registerBlock(cherrie_sapling, ItemSaplingBlocks.class, cherrie_sapling.getUnlocalizedName().substring(5)); and CherrieSapling.java - all package com.glowingwater.cherrieland.biome.features; import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockSapling; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenBigTree; import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; import com.glowingwater.cherrieland.CherrieLand; import com.glowingwater.cherrieland.Reference; import com.glowingwater.cherrieland.init.ModBlocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class CherrieSapling extends BlockSapling { public static final String[] saplings = new String[] {"cherrie"}; private static final IIcon[] iconLength = new IIcon[saplings.length]; private static final String __OBFID = "CL_00000305"; public CherrieSapling() { float f = 0.4F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); this.setCreativeTab(CherrieLand.tabCherrieLand); } /** * Ticks the block if it's been scheduled */ public void updateTick(World world, int x, int y, int z, Random random) { if (!world.isRemote) { super.updateTick(world, x, y, z, random); if (world.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(7) == 0) { this.func_149879_c(world, x, y, z, random); } } } /** * Gets the block's texture. Args: side, meta */ @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { meta &= 7; return iconLength[MathHelper.clamp_int(meta, 0, 5)]; } //markOrGrowMarked public void func_149879_c(World world, int x, int y, int z, Random random) { int l = world.getBlockMetadata(x, y, z); if ((l & == 0) { world.setBlockMetadataWithNotify(x, y, z, l | 8, 4); } else { this.func_149878_d(world, x, y, z, random); } } //growTree @Override public void func_149878_d(World world, int x, int y, int z, Random random) { if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, random, x, y, z)) return; int l = world.getBlockMetadata(x, y, z) & 7; Object object = random.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true); int i1 = 0; int j1 = 0; boolean flag = false; switch (l) { case 0: break; case 1: object = new WorldGenCherrieTree(ModBlocks.cherrie_log, ModBlocks.cherrie_leaves, 1, 1, false, 10, 15, false); break; case 2: break; case 3: break; case 4: break; case 5: break; default: break; } Block block = Blocks.air; if (flag) { world.setBlock(x + i1, y, z + j1, block, 0, 4); world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4); world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4); world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4); } else { world.setBlock(x, y, z, block, 0, 4); } if (!((WorldGenerator)object).generate(world, random, x + i1, y, z + j1)) { if (flag) { world.setBlock(x + i1, y, z + j1, this, l, 4); world.setBlock(x + i1 + 1, y, z + j1, this, l, 4); world.setBlock(x + i1, y, z + j1 + 1, this, l, 4); world.setBlock(x + i1 + 1, y, z + j1 + 1, this, l, 4); } else { world.setBlock(x, y, z, this, l, 4); } } } public boolean func_149880_a(World world, int x, int y, int z, int par1) { return world.getBlock(x, y, z) == this && (world.getBlockMetadata(x, y, z) & 7) == par1; } /** * Determines the damage on the item the block drops. Used in cloth and wood. */ public int damageDropped(int p_149692_1_) { return MathHelper.clamp_int(p_149692_1_ & 7, 0, 5); } /** * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */ @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < saplings.length; i++) { list.add(new ItemStack(item, 1, 1)); } } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { for (int i = 0; i < iconLength.length; ++i) { iconLength[i] = iconRegister.registerIcon(this.getTextureName() + "_" + saplings[i]); } } public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { return true; } public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { return (double)p_149852_1_.rand.nextFloat() < 0.45D; } public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) { this.func_149879_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, p_149853_2_); } } Why it don't work?
  8. So I have WhiteSandstoneSlab.java: package com.glowingwater.mostone.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import com.glowingwater.mostone.MoStone; public class WhiteSandstoneSlab extends Block { public WhiteSandstoneSlab(Material rock) { super(rock); this.setHardness(2.0f); this.setCreativeTab(MoStone.tabMoStone); } } white_sandstone_slab.json: (mostone/blockstates) { "variants": { "half=bottom": { "model": "half_white_sandstone_slab" }, "half=top": { "model": "upper_white_sandstone_slab" } } } half_white_sandstone_slab.json: (mostone/models/block) { "parent": "block/half_slab", "textures": { "bottom": "mostone:blocks/whiteSandstoneBottom", "top": "mostone:blocks/whiteSandstoneTop", "side": "mostone:blocks/whiteSandstoneSide" } } upper_white_sandstone_slab.json: (mostone/models/block) { "parent": "block/upper_slab", "textures": { "bottom": "mostone:blocks/whiteSandstoneBottom", "top": "mostone:blocks/whiteSandstoneTop", "side": "mostone:blocks/whiteSandstoneSide" } } and I don't know why it don't work
  9. How do I make multitexture blocks in 1.8? Because im gonna make some new sandstone types.
  10. Thank you, but I found tutorial and helped me so much
  11. Can someone tell me why this is happenning?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.