Jump to content

RoseCotton

Members
  • Posts

    62
  • Joined

  • Last visited

Posts posted by RoseCotton

  1. Hi, Andrewca.

     

    I made the same mod and am faced with the same problem.  My kid just uses the mod in creative mode and right-clicks the mod spawner with the proper spawn egg to make the spawner he wants.

     

    I was hoping to override some magic function so the spawner cycles through the 16 monster options when clicked on, but haven't figured it out.  I gave up at the point where I figured I'd have to make my own item.

     

    Did you figure it out?

     

    I plan to take a look at ItemMonsterPlacer this evening to see if the function it has for what happens when you right-click on a block covers the "if the block is a monster spawner, set the monster spawner moster type to the spawn egg type" or something.

    But even then I'm thinking I'd have to make my own monster spawner.

     

    What's up with the version 1.8 suggestion?  I'm using 1.8 so it seems like I should be able to use NBT data or something to get this done...

  2. Sweet!  it crashed!  ;) 

    That means I actually made it into some new code.

     

    I'll debug it when I get back to the computer in a few hours...

     

    Here's the console data:

     

     

    [04:57:09] [main/INFO] [GradleStart]: Extra: []

    [04:57:09] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Becky/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken, {REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker]

    [04:57:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

    [04:57:09] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

    [04:57:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

    [04:57:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

    [04:57:09] [main/INFO] [FML]: Forge Mod Loader version 8.0.20.1023 for Minecraft 1.8 loading

    [04:57:09] [main/INFO] [FML]: Java is Java HotSpot Client VM, version 1.8.0_31, running on Windows 7:x86:6.1, installed at C:\Program Files\Java\jre1.8.0_31

    [04:57:09] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

    [04:57:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

    [04:57:09] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

    [04:57:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

    [04:57:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

    [04:57:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

    [04:57:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

    [04:57:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

    [04:57:10] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

    [04:57:11] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

    [04:57:11] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

    [04:57:12] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

    [04:57:12] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

    [04:57:12] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

    [04:57:13] [Client thread/INFO]: Setting user: Player583

    [04:57:13] [Client thread/INFO]: (Session ID is token:FML:Player583)

    [04:57:16] [Client thread/INFO]: LWJGL Version: 2.9.1

    [04:57:17] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

    [04:57:17] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

    [04:57:17] [Client thread/INFO] [FML]: Searching C:\Users\Becky\Desktop\Forge ModLoader-1.8-8.0.20.1023-1.8-src\eclipse\mods for mods

    [04:57:21] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load

    [04:57:22] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, testmod01, oredetectmod, shelvesmod] at CLIENT

    [04:57:22] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, testmod01, oredetectmod, shelvesmod] at SERVER

    [04:57:22] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Test Mod 01, FMLFileResourcePack:Ore Detect Mod, FMLFileResourcePack:Shelves Mod

    [04:57:22] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

    [04:57:22] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations

    [04:57:22] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getGuiID:19]: Called method: GuiHandlerShelf.getGuiID

    [04:57:22] [Client thread/INFO] [FML]: Applying holder lookups

    [04:57:22] [Client thread/INFO] [FML]: Holder lookups applied

    [04:57:23] [sound Library Loader/INFO]: Starting up SoundSystem...

    [04:57:23] [Thread-7/INFO]: Initializing LWJGL OpenAL

    [04:57:23] [Thread-7/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

    [04:57:25] [Thread-7/INFO]: OpenAL initialized.

    [04:57:25] [sound Library Loader/INFO]: Sound engine started

    [04:57:38] [Client thread/INFO]: Created: 512x512 textures-atlas

    [04:57:40] [Client thread/INFO] [sTDOUT]: [com.becky.testmod01.Testmod01:postInit:142]: Called method: postInit

    [04:57:40] [Client thread/INFO] [sTDOUT]: [com.rosecotton.oredetect.OreDetectMod:postInit:120]: Called method: postInit

    [04:57:40] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.ShelvesMod:postInit:99]: Called method: postInit

    [04:57:40] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods

    [04:57:40] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Test Mod 01, FMLFileResourcePack:Ore Detect Mod, FMLFileResourcePack:Shelves Mod

    [04:57:40] [Client thread/INFO]: SoundSystem shutting down...

    [04:57:40] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

    [04:57:40] [sound Library Loader/INFO]: Starting up SoundSystem...

    [04:57:40] [Thread-9/INFO]: Initializing LWJGL OpenAL

    [04:57:40] [Thread-9/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

    [04:57:40] [Thread-9/INFO]: OpenAL initialized.

    [04:57:41] [sound Library Loader/INFO]: Sound engine started

    [04:57:43] [Client thread/INFO]: Created: 512x512 textures-atlas

    [04:58:11] [server thread/INFO]: Starting integrated minecraft server version 1.8

    [04:58:11] [server thread/INFO]: Generating keypair

    [04:58:11] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

    [04:58:11] [server thread/INFO] [FML]: Applying holder lookups

    [04:58:11] [server thread/INFO] [FML]: Holder lookups applied

    [04:58:11] [server thread/INFO]: Preparing start region for level 0

    [04:58:12] [server thread/INFO]: Preparing spawn area: 49%

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.NullPointerException

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.ItemModelMesher.register(ItemModelMesher.java:81)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.registerItem(RenderItem.java:102)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:107)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:112)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.registerItems(RenderItem.java:526)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.<init>(RenderItem.java:87)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.rosecotton.shelvesmod.RenderShelfItems.<init>(RenderShelfItems.java:43)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.rosecotton.shelvesmod.ShelfTitleEntity.<init>(ShelfTitleEntity.java:25)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Constructor.newInstance(Unknown Source)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.Class.newInstance(Unknown Source)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.tileentity.TileEntity.createAndLoadEntity(TileEntity.java:99)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.chunk.storage.AnvilChunkLoader.readChunkFromNBT(AnvilChunkLoader.java:445)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.chunk.storage.AnvilChunkLoader.checkedReadChunkFromNBT(AnvilChunkLoader.java:96)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadChunk(AnvilChunkLoader.java:79)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.gen.ChunkProviderServer.loadChunkFromFile(ChunkProviderServer.java:144)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:93)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:329)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:134)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:148)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:457)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.Thread.run(Unknown Source)

    [04:58:12] [server thread/WARN]: Skipping BlockEntity with id shelfTitleEntity

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.NullPointerException

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.ItemModelMesher.register(ItemModelMesher.java:81)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.registerItem(RenderItem.java:102)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:107)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:112)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.registerItems(RenderItem.java:526)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.entity.RenderItem.<init>(RenderItem.java:87)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.rosecotton.shelvesmod.RenderShelfItems.<init>(RenderShelfItems.java:43)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.rosecotton.shelvesmod.ShelfTitleEntity.<init>(ShelfTitleEntity.java:25)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Constructor.newInstance(Unknown Source)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.Class.newInstance(Unknown Source)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.tileentity.TileEntity.createAndLoadEntity(TileEntity.java:99)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.chunk.storage.AnvilChunkLoader.readChunkFromNBT(AnvilChunkLoader.java:445)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.chunk.storage.AnvilChunkLoader.checkedReadChunkFromNBT(AnvilChunkLoader.java:96)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadChunk(AnvilChunkLoader.java:79)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.gen.ChunkProviderServer.loadChunkFromFile(ChunkProviderServer.java:144)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:93)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:329)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:134)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:148)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:457)

    [04:58:12] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.Thread.run(Unknown Source)

    [04:58:12] [server thread/WARN]: Skipping BlockEntity with id shelfTitleEntity

    [04:58:13] [server thread/INFO]: Changing view distance to 8, from 10

    [04:58:14] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 1

    [04:58:14] [Netty Server IO #1/INFO] [FML]: Client protocol version 1

    [04:58:14] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : oredetectmod@1.0,FML@8.0.20.1023,shelvesmod@1.0,testmod01@1.0,mcp@9.05

    [04:58:14] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established

    [04:58:14] [server thread/INFO] [FML]: [server thread] Server side modded connection established

    [04:58:14] [server thread/INFO]: Player583[local:E:a647b99d] logged in with entity id 336 at (-231.76331149411786, 77.0, 60.54905211113862)

    [04:58:14] [server thread/INFO]: Player583 joined the game

    [04:58:18] [Client thread/FATAL]: Reported exception thrown!

    net.minecraft.util.ReportedException: Exception in world tick

    at net.minecraft.client.Minecraft.runTick(Minecraft.java:2109) ~[Minecraft.class:?]

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1016) ~[Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:346) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?]

    at GradleStart.main(GradleStart.java:45) [start/:?]

    Caused by: java.lang.NullPointerException

    at net.minecraft.client.renderer.ItemModelMesher.register(ItemModelMesher.java:81) ~[itemModelMesher.class:?]

    at net.minecraft.client.renderer.entity.RenderItem.registerItem(RenderItem.java:102) ~[RenderItem.class:?]

    at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:107) ~[RenderItem.class:?]

    at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:112) ~[RenderItem.class:?]

    at net.minecraft.client.renderer.entity.RenderItem.registerItems(RenderItem.java:526) ~[RenderItem.class:?]

    at net.minecraft.client.renderer.entity.RenderItem.<init>(RenderItem.java:87) ~[RenderItem.class:?]

    at com.rosecotton.shelvesmod.RenderShelfItems.<init>(RenderShelfItems.java:43) ~[RenderShelfItems.class:?]

    at com.rosecotton.shelvesmod.ShelfTitleEntity.<init>(ShelfTitleEntity.java:25) ~[shelfTitleEntity.class:?]

    at com.rosecotton.shelvesmod.BlockShelf.createNewTileEntity(BlockShelf.java:329) ~[blockShelf.class:?]

    at net.minecraft.world.chunk.Chunk.createNewTileEntity(Chunk.java:867) ~[Chunk.class:?]

    at net.minecraft.world.chunk.Chunk.func_150804_b(Chunk.java:1185) ~[Chunk.class:?]

    at net.minecraft.client.multiplayer.ChunkProviderClient.unloadQueuedChunks(ChunkProviderClient.java:84) ~[ChunkProviderClient.class:?]

    at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:89) ~[WorldClient.class:?]

    at net.minecraft.client.Minecraft.runTick(Minecraft.java:2093) ~[Minecraft.class:?]

    ... 11 more

    [04:58:18] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: ---- Minecraft Crash Report ----

    // You're mean.

     

    Time: 3/13/15 4:58 AM

    Description: Exception in world tick

     

    java.lang.NullPointerException: Exception in world tick

    at net.minecraft.client.renderer.ItemModelMesher.register(ItemModelMesher.java:81)

    at net.minecraft.client.renderer.entity.RenderItem.registerItem(RenderItem.java:102)

    at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:107)

    at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:112)

    at net.minecraft.client.renderer.entity.RenderItem.registerItems(RenderItem.java:526)

    at net.minecraft.client.renderer.entity.RenderItem.<init>(RenderItem.java:87)

    at com.rosecotton.shelvesmod.RenderShelfItems.<init>(RenderShelfItems.java:43)

    at com.rosecotton.shelvesmod.ShelfTitleEntity.<init>(ShelfTitleEntity.java:25)

    at com.rosecotton.shelvesmod.BlockShelf.createNewTileEntity(BlockShelf.java:329)

    at net.minecraft.world.chunk.Chunk.createNewTileEntity(Chunk.java:867)

    at net.minecraft.world.chunk.Chunk.func_150804_b(Chunk.java:1185)

    at net.minecraft.client.multiplayer.ChunkProviderClient.unloadQueuedChunks(ChunkProviderClient.java:84)

    at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:89)

    at net.minecraft.client.Minecraft.runTick(Minecraft.java:2093)

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1016)

    at net.minecraft.client.Minecraft.run(Minecraft.java:346)

    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(GradleStartCommon.java:85)

    at GradleStart.main(GradleStart.java:45)

     

     

    A detailed walkthrough of the error, its code path and all known details is as follows:

    ---------------------------------------------------------------------------------------

     

    -- Head --

    Stacktrace:

    at net.minecraft.client.renderer.ItemModelMesher.register(ItemModelMesher.java:81)

    at net.minecraft.client.renderer.entity.RenderItem.registerItem(RenderItem.java:102)

    at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:107)

    at net.minecraft.client.renderer.entity.RenderItem.registerBlock(RenderItem.java:112)

    at net.minecraft.client.renderer.entity.RenderItem.registerItems(RenderItem.java:526)

    at net.minecraft.client.renderer.entity.RenderItem.<init>(RenderItem.java:87)

    at com.rosecotton.shelvesmod.RenderShelfItems.<init>(RenderShelfItems.java:43)

    at com.rosecotton.shelvesmod.ShelfTitleEntity.<init>(ShelfTitleEntity.java:25)

    at com.rosecotton.shelvesmod.BlockShelf.createNewTileEntity(BlockShelf.java:329)

    at net.minecraft.world.chunk.Chunk.createNewTileEntity(Chunk.java:867)

    at net.minecraft.world.chunk.Chunk.func_150804_b(Chunk.java:1185)

    at net.minecraft.client.multiplayer.ChunkProviderClient.unloadQueuedChunks(ChunkProviderClient.java:84)

     

    -- Affected level --

    Details:

    Level name: MpServer

    All players: 1 total; [EntityPlayerSP['Player583'/336, l='MpServer', x=-231.76, y=77.00, z=60.55]]

    Chunk stats: MultiplayerChunkCache: 289, 289

    Level seed: 0

    Level generator: ID 00 - default, ver 1. Features enabled: false

    Level generator options:

    Level spawn location: -228.00,64.00,60.00 - World: (-228,64,60), Chunk: (at 12,4,12 in -15,3; contains blocks -240,0,48 to -225,255,63), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

    Level time: 33459 game time, 33459 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: 84 total; [EntityChicken['Chicken'/128, l='MpServer', x=-284.38, y=72.00, z=130.06], EntityChicken['Chicken'/258, l='MpServer', x=-158.22, y=70.97, z=-12.42], EntityChicken['Chicken'/261, l='MpServer', x=-153.66, y=70.00, z=-11.41], EntityChicken['Chicken'/262, l='MpServer', x=-159.40, y=71.00, z=-12.50], EntityChicken['Chicken'/263, l='MpServer', x=-155.94, y=62.67, z=14.06], EntityChicken['Chicken'/143, l='MpServer', x=-259.50, y=75.00, z=-14.25], EntityChicken['Chicken'/144, l='MpServer', x=-259.81, y=72.00, z=2.56], EntityChicken['Chicken'/145, l='MpServer', x=-271.15, y=79.00, z=17.38], EntityCow['Cow'/146, l='MpServer', x=-262.43, y=66.00, z=88.44], EntityChicken['Chicken'/147, l='MpServer', x=-259.94, y=68.00, z=107.73], EntityItem['item.item.egg'/148, l='MpServer', x=-266.66, y=73.00, z=103.75], EntityChicken['Chicken'/149, l='MpServer', x=-266.78, y=73.00, z=103.47], EntityItem['item.item.egg'/150, l='MpServer', x=-266.63, y=75.00, z=113.28], EntityChicken['Chicken'/151, l='MpServer', x=-265.75, y=75.00, z=113.50], EntityChicken['Chicken'/152, l='MpServer', x=-264.33, y=78.46, z=125.70], EntityItem['item.item.egg'/154, l='MpServer', x=-263.81, y=77.00, z=124.75], EntityChicken['Chicken'/155, l='MpServer', x=-261.38, y=69.00, z=121.41], EntityChicken['Chicken'/167, l='MpServer', x=-260.03, y=73.61, z=3.61], EntityItem['item.item.egg'/168, l='MpServer', x=-255.25, y=73.00, z=2.94], EntityBat['Bat'/169, l='MpServer', x=-247.21, y=61.21, z=78.38], EntityBat['Bat'/170, l='MpServer', x=-253.03, y=60.10, z=73.75], EntityBat['Bat'/171, l='MpServer', x=-245.04, y=59.16, z=79.61], EntityBat['Bat'/172, l='MpServer', x=-244.69, y=32.52, z=135.46], EntityBat['Bat'/173, l='MpServer', x=-251.97, y=18.10, z=131.22], EntityChicken['Chicken'/174, l='MpServer', x=-251.84, y=77.00, z=138.27], EntityBat['Bat'/184, l='MpServer', x=-236.52, y=27.25, z=1.98], EntitySquid['Squid'/185, l='MpServer', x=-228.86, y=60.19, z=122.30], EntityChicken['Chicken'/193, l='MpServer', x=-210.41, y=65.00, z=-16.56], EntityChicken['Chicken'/194, l='MpServer', x=-212.36, y=64.14, z=-7.47], EntityCow['Cow'/195, l='MpServer', x=-212.63, y=74.00, z=31.63], EntityBat['Bat'/196, l='MpServer', x=-216.75, y=57.10, z=60.75], EntitySquid['Squid'/197, l='MpServer', x=-219.50, y=61.04, z=124.66], EntityChicken['Chicken'/73, l='MpServer', x=-305.34, y=79.00, z=2.50], EntityPig['Pig'/202, l='MpServer', x=-196.28, y=64.00, z=-13.84], EntityBat['Bat'/1098, l='MpServer', x=-309.43, y=30.00, z=77.49], EntityChicken['Chicken'/203, l='MpServer', x=-204.53, y=64.00, z=-10.02], EntityPig['Pig'/204, l='MpServer', x=-205.47, y=64.00, z=1.53], EntityChicken['Chicken'/76, l='MpServer', x=-306.47, y=81.00, z=16.47], EntityChicken['Chicken'/205, l='MpServer', x=-204.69, y=65.00, z=12.47], EntityChicken['Chicken'/206, l='MpServer', x=-205.03, y=67.00, z=19.31], EntityChicken['Chicken'/207, l='MpServer', x=-200.75, y=68.00, z=25.44], EntityItem['item.item.egg'/208, l='MpServer', x=-206.03, y=69.00, z=21.97], EntityChicken['Chicken'/80, l='MpServer', x=-308.50, y=78.00, z=87.50], EntityPlayerSP['Player583'/336, l='MpServer', x=-231.76, y=77.00, z=60.55], EntityItem['item.item.egg'/209, l='MpServer', x=-202.97, y=67.00, z=21.22], EntityChicken['Chicken'/81, l='MpServer', x=-311.63, y=73.00, z=112.38], EntityCow['Cow'/210, l='MpServer', x=-200.00, y=68.00, z=28.91], EntityCow['Cow'/211, l='MpServer', x=-206.03, y=74.00, z=25.53], EntityItem['item.item.egg'/97, l='MpServer', x=-294.19, y=75.00, z=-3.47], EntityBat['Bat'/225, l='MpServer', x=-185.93, y=51.10, z=-12.77], EntityChicken['Chicken'/98, l='MpServer', x=-289.59, y=74.00, z=-7.41], EntityBat['Bat'/226, l='MpServer', x=-191.25, y=51.29, z=-3.05], EntityChicken['Chicken'/227, l='MpServer', x=-180.50, y=71.00, z=7.34], EntityChicken['Chicken'/99, l='MpServer', x=-299.02, y=78.01, z=4.38], EntityPig['Pig'/228, l='MpServer', x=-185.25, y=64.00, z=7.47], EntityItem['item.item.egg'/229, l='MpServer', x=-180.78, y=71.00, z=6.59], EntityChicken['Chicken'/230, l='MpServer', x=-188.63, y=64.00, z=12.41], EntityChicken['Chicken'/102, l='MpServer', x=-300.59, y=81.00, z=48.34], EntityPig['Pig'/231, l='MpServer', x=-185.53, y=65.00, z=7.28], EntityChicken['Chicken'/103, l='MpServer', x=-299.44, y=81.00, z=78.41], EntityItem['item.item.egg'/232, l='MpServer', x=-189.56, y=64.00, z=12.88], EntityChicken['Chicken'/104, l='MpServer', x=-297.69, y=76.00, z=88.50], EntitySquid['Squid'/233, l='MpServer', x=-179.81, y=61.90, z=106.67], EntityItem['item.item.egg'/105, l='MpServer', x=-289.81, y=72.00, z=88.94], EntitySquid['Squid'/234, l='MpServer', x=-184.91, y=61.53, z=108.90], EntityItem['item.item.egg'/106, l='MpServer', x=-288.63, y=70.00, z=106.16], EntitySquid['Squid'/235, l='MpServer', x=-181.48, y=61.78, z=106.55], EntityChicken['Chicken'/107, l='MpServer', x=-292.59, y=71.00, z=104.38], EntitySquid['Squid'/236, l='MpServer', x=-179.15, y=62.42, z=114.38], EntityBat['Bat'/237, l='MpServer', x=-183.53, y=25.48, z=129.66], EntityBat['Bat'/246, l='MpServer', x=-167.68, y=45.73, z=9.24], EntityChicken['Chicken'/118, l='MpServer', x=-279.78, y=76.00, z=-18.50], EntityItem['item.item.egg'/120, l='MpServer', x=-285.94, y=75.00, z=2.75], EntityChicken['Chicken'/248, l='MpServer', x=-164.44, y=70.00, z=7.38], EntityChicken['Chicken'/121, l='MpServer', x=-287.75, y=82.00, z=20.53], EntityChicken['Chicken'/122, l='MpServer', x=-284.72, y=85.00, z=33.59], EntityChicken['Chicken'/123, l='MpServer', x=-276.53, y=74.00, z=78.28], EntityItem['item.item.egg'/124, l='MpServer', x=-272.34, y=69.00, z=81.00], EntitySquid['Squid'/252, l='MpServer', x=-168.00, y=52.95, z=110.42], EntityChicken['Chicken'/125, l='MpServer', x=-275.66, y=69.00, z=105.66], EntitySquid['Squid'/253, l='MpServer', x=-168.59, y=55.74, z=110.73], EntityItem['item.item.egg'/126, l='MpServer', x=-283.75, y=70.00, z=106.13], EntityChicken['Chicken'/127, l='MpServer', x=-278.69, y=69.00, z=99.56], EntitySquid['Squid'/255, l='MpServer', x=-172.96, y=55.42, z=113.55]]

    Retry entities: 0 total; []

    Server brand: fml

    Server type: Integrated singleplayer server

    Stacktrace:

    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:350)

    at net.minecraft.client.Minecraft.runTick(Minecraft.java:2106)

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1016)

    at net.minecraft.client.Minecraft.run(Minecraft.java:346)

    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(GradleStartCommon.java:85)

    at GradleStart.main(GradleStart.java:45)

     

    -- Affected level --

    Details:

    Level name: MpServer

    All players: 1 total; [EntityPlayerSP['Player583'/336, l='MpServer', x=-231.76, y=77.00, z=60.55]]

    Chunk stats: MultiplayerChunkCache: 289, 289

    Level seed: 0

    Level generator: ID 00 - default, ver 1. Features enabled: false

    Level generator options:

    Level spawn location: -228.00,64.00,60.00 - World: (-228,64,60), Chunk: (at 12,4,12 in -15,3; contains blocks -240,0,48 to -225,255,63), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

    Level time: 33459 game time, 33459 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: 84 total; [EntityChicken['Chicken'/128, l='MpServer', x=-284.38, y=72.00, z=130.06], EntityChicken['Chicken'/258, l='MpServer', x=-158.22, y=70.97, z=-12.42], EntityChicken['Chicken'/261, l='MpServer', x=-153.66, y=70.00, z=-11.41], EntityChicken['Chicken'/262, l='MpServer', x=-159.40, y=71.00, z=-12.50], EntityChicken['Chicken'/263, l='MpServer', x=-155.94, y=62.67, z=14.06], EntityChicken['Chicken'/143, l='MpServer', x=-259.50, y=75.00, z=-14.25], EntityChicken['Chicken'/144, l='MpServer', x=-259.81, y=72.00, z=2.56], EntityChicken['Chicken'/145, l='MpServer', x=-271.15, y=79.00, z=17.38], EntityCow['Cow'/146, l='MpServer', x=-262.43, y=66.00, z=88.44], EntityChicken['Chicken'/147, l='MpServer', x=-259.94, y=68.00, z=107.73], EntityItem['item.item.egg'/148, l='MpServer', x=-266.66, y=73.00, z=103.75], EntityChicken['Chicken'/149, l='MpServer', x=-266.78, y=73.00, z=103.47], EntityItem['item.item.egg'/150, l='MpServer', x=-266.63, y=75.00, z=113.28], EntityChicken['Chicken'/151, l='MpServer', x=-265.75, y=75.00, z=113.50], EntityChicken['Chicken'/152, l='MpServer', x=-264.33, y=78.46, z=125.70], EntityItem['item.item.egg'/154, l='MpServer', x=-263.81, y=77.00, z=124.75], EntityChicken['Chicken'/155, l='MpServer', x=-261.38, y=69.00, z=121.41], EntityChicken['Chicken'/167, l='MpServer', x=-260.03, y=73.61, z=3.61], EntityItem['item.item.egg'/168, l='MpServer', x=-255.25, y=73.00, z=2.94], EntityBat['Bat'/169, l='MpServer', x=-247.21, y=61.21, z=78.38], EntityBat['Bat'/170, l='MpServer', x=-253.03, y=60.10, z=73.75], EntityBat['Bat'/171, l='MpServer', x=-245.04, y=59.16, z=79.61], EntityBat['Bat'/172, l='MpServer', x=-244.69, y=32.52, z=135.46], EntityBat['Bat'/173, l='MpServer', x=-251.97, y=18.10, z=131.22], EntityChicken['Chicken'/174, l='MpServer', x=-251.84, y=77.00, z=138.27], EntityBat['Bat'/184, l='MpServer', x=-236.52, y=27.25, z=1.98], EntitySquid['Squid'/185, l='MpServer', x=-228.86, y=60.19, z=122.30], EntityChicken['Chicken'/193, l='MpServer', x=-210.41, y=65.00, z=-16.56], EntityChicken['Chicken'/194, l='MpServer', x=-212.36, y=64.14, z=-7.47], EntityCow['Cow'/195, l='MpServer', x=-212.63, y=74.00, z=31.63], EntityBat['Bat'/196, l='MpServer', x=-216.75, y=57.10, z=60.75], EntitySquid['Squid'/197, l='MpServer', x=-219.50, y=61.04, z=124.66], EntityChicken['Chicken'/73, l='MpServer', x=-305.34, y=79.00, z=2.50], EntityPig['Pig'/202, l='MpServer', x=-196.28, y=64.00, z=-13.84], EntityBat['Bat'/1098, l='MpServer', x=-309.43, y=30.00, z=77.49], EntityChicken['Chicken'/203, l='MpServer', x=-204.53, y=64.00, z=-10.02], EntityPig['Pig'/204, l='MpServer', x=-205.47, y=64.00, z=1.53], EntityChicken['Chicken'/76, l='MpServer', x=-306.47, y=81.00, z=16.47], EntityChicken['Chicken'/205, l='MpServer', x=-204.69, y=65.00, z=12.47], EntityChicken['Chicken'/206, l='MpServer', x=-205.03, y=67.00, z=19.31], EntityChicken['Chicken'/207, l='MpServer', x=-200.75, y=68.00, z=25.44], EntityItem['item.item.egg'/208, l='MpServer', x=-206.03, y=69.00, z=21.97], EntityChicken['Chicken'/80, l='MpServer', x=-308.50, y=78.00, z=87.50], EntityPlayerSP['Player583'/336, l='MpServer', x=-231.76, y=77.00, z=60.55], EntityItem['item.item.egg'/209, l='MpServer', x=-202.97, y=67.00, z=21.22], EntityChicken['Chicken'/81, l='MpServer', x=-311.63, y=73.00, z=112.38], EntityCow['Cow'/210, l='MpServer', x=-200.00, y=68.00, z=28.91], EntityCow['Cow'/211, l='MpServer', x=-206.03, y=74.00, z=25.53], EntityItem['item.item.egg'/97, l='MpServer', x=-294.19, y=75.00, z=-3.47], EntityBat['Bat'/225, l='MpServer', x=-185.93, y=51.10, z=-12.77], EntityChicken['Chicken'/98, l='MpServer', x=-289.59, y=74.00, z=-7.41], EntityBat['Bat'/226, l='MpServer', x=-191.25, y=51.29, z=-3.05], EntityChicken['Chicken'/227, l='MpServer', x=-180.50, y=71.00, z=7.34], EntityChicken['Chicken'/99, l='MpServer', x=-299.02, y=78.01, z=4.38], EntityPig['Pig'/228, l='MpServer', x=-185.25, y=64.00, z=7.47], EntityItem['item.item.egg'/229, l='MpServer', x=-180.78, y=71.00, z=6.59], EntityChicken['Chicken'/230, l='MpServer', x=-188.63, y=64.00, z=12.41], EntityChicken['Chicken'/102, l='MpServer', x=-300.59, y=81.00, z=48.34], EntityPig['Pig'/231, l='MpServer', x=-185.53, y=65.00, z=7.28], EntityChicken['Chicken'/103, l='MpServer', x=-299.44, y=81.00, z=78.41], EntityItem['item.item.egg'/232, l='MpServer', x=-189.56, y=64.00, z=12.88], EntityChicken['Chicken'/104, l='MpServer', x=-297.69, y=76.00, z=88.50], EntitySquid['Squid'/233, l='MpServer', x=-179.81, y=61.90, z=106.67], EntityItem['item.item.egg'/105, l='MpServer', x=-289.81, y=72.00, z=88.94], EntitySquid['Squid'/234, l='MpServer', x=-184.91, y=61.53, z=108.90], EntityItem['item.item.egg'/106, l='MpServer', x=-288.63, y=70.00, z=106.16], EntitySquid['Squid'/235, l='MpServer', x=-181.48, y=61.78, z=106.55], EntityChicken['Chicken'/107, l='MpServer', x=-292.59, y=71.00, z=104.38], EntitySquid['Squid'/236, l='MpServer', x=-179.15, y=62.42, z=114.38], EntityBat['Bat'/237, l='MpServer', x=-183.53, y=25.48, z=129.66], EntityBat['Bat'/246, l='MpServer', x=-167.68, y=45.73, z=9.24], EntityChicken['Chicken'/118, l='MpServer', x=-279.78, y=76.00, z=-18.50], EntityItem['item.item.egg'/120, l='MpServer', x=-285.94, y=75.00, z=2.75], EntityChicken['Chicken'/248, l='MpServer', x=-164.44, y=70.00, z=7.38], EntityChicken['Chicken'/121, l='MpServer', x=-287.75, y=82.00, z=20.53], EntityChicken['Chicken'/122, l='MpServer', x=-284.72, y=85.00, z=33.59], EntityChicken['Chicken'/123, l='MpServer', x=-276.53, y=74.00, z=78.28], EntityItem['item.item.egg'/124, l='MpServer', x=-272.34, y=69.00, z=81.00], EntitySquid['Squid'/252, l='MpServer', x=-168.00, y=52.95, z=110.42], EntityChicken['Chicken'/125, l='MpServer', x=-275.66, y=69.00, z=105.66], EntitySquid['Squid'/253, l='MpServer', x=-168.59, y=55.74, z=110.73], EntityItem['item.item.egg'/126, l='MpServer', x=-283.75, y=70.00, z=106.13], EntityChicken['Chicken'/127, l='MpServer', x=-278.69, y=69.00, z=99.56], EntitySquid['Squid'/255, l='MpServer', x=-172.96, y=55.42, z=113.55]]

    Retry entities: 0 total; []

    Server brand: fml

    Server type: Integrated singleplayer server

     

    -- System Details --

    Details:

    Minecraft Version: 1.8

    Operating System: Windows 7 (x86) version 6.1

    Java Version: 1.8.0_31, Oracle Corporation

    Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

    Memory: 835785472 bytes (797 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95

    FML: MCP v9.10 FML v8.0.20.1023 5 mods loaded, 5 mods active

    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    FML{8.0.20.1023} [Forge Mod Loader] (fmlSrc-1.8-8.0.20.1023-1.8.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    testmod01{1.0} [Test Mod 01] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    oredetectmod{1.0} [Ore Detect Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    shelvesmod{1.0} [shelves Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    Launched Version: 1.8

    LWJGL: 2.9.1

    OpenGL: ATI Radeon HD 4800 Series GL version 3.3.11672 Compatibility Profile Context, ATI Technologies Inc.

    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'

    Type: Client (map_client.txt)

    Resource Packs: []

    Current Language: English (US)

    Profiler Position: N/A (disabled)

    [04:58:18] [server thread/INFO]: Stopping server

    [04:58:18] [server thread/INFO]: Saving players

    [04:58:18] [server thread/INFO]: Saving worlds

    [04:58:18] [server thread/INFO]: Saving chunks for level 'TestingShelvesGui'/Overworld

    [04:58:18] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Becky\Desktop\Forge ModLoader-1.8-8.0.20.1023-1.8-src\eclipse\.\crash-reports\crash-2015-03-13_04.58.18-client.txt

    [04:58:18] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.

    [04:58:18] [server thread/INFO]: Saving chunks for level 'TestingShelvesGui'/Nether

    [04:58:18] [server thread/INFO]: Saving chunks for level 'TestingShelvesGui'/The End

    [04:58:19] [server thread/INFO] [FML]: Applying holder lookups

    [04:58:19] [server thread/INFO] [FML]: Holder lookups applied

    [04:58:19] [Client thread/INFO] [FML]: Server terminated.

    AL lib: (EE) alc_cleanup: 1 device not closed

    Java HotSpot Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

     

     

  3. Oh, I figured since my shelf holds four items I'd need to make a separate RenderItem for each one, but you're saying that I can get a RenderItem from calling this Minecraft.getMinecraft().getRenderItem() and the line of code

    RenderShelfItems renderShelfItems = new RenderShelfItems(Minecraft.getMinecraft().getRenderManager, Minecraft.getMinecraft().getRenderItem());

     

    should invoke all the rendering that happens in my RenderShelfItems class?

     

    Do I call that line of code in my ShelfTileEntity class or in some other class?  Other calls like that are made inside of RenderManager, but I can't figure out how to 'register' my RenderShelfItems class with RenderManager so it gets called when all the others do.

  4. Hi

     

    This might help...

     

    RenderItem::

        public void renderItemModel(ItemStack stack)

        {

            IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);

            this.renderItemModelTransform(stack, ibakedmodel, ItemCameraTransforms.TransformType.NONE);

        }

     

    -TGG

     

    Thanks, Grey Ghost.

    I looked at that a number of times but am getting the organization wrong in my head.

    Would I extend RenderItem a RenderShelfItems class or something?

    Currently I'm saying:

    public class RenderShelfItems extends Render

     

    Should I instead say:

    public class RenderShelfItems extends RenderItem

    ?

     

    Or do I create a new RenderItem object and call the renderItemModel method?

    I specify the location within the block for each of four ItemStacks that need to have an Item rendered in the block, so can I use renderItemModel(itemStackX) and somehow specify _where_ to render the item?

     

    mod:

    package com.rosecotton.shelvesmod;
    
    import net.minecraft.block.Block;
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.renderer.entity.RenderItem;
    import net.minecraft.client.resources.model.ModelResourceLocation;
    import net.minecraft.init.Blocks;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.fml.common.Mod;
    import net.minecraftforge.fml.common.Mod.EventHandler;
    import net.minecraftforge.fml.common.Mod.Instance;
    import net.minecraftforge.fml.common.SidedProxy;
    import net.minecraftforge.fml.common.event.FMLInitializationEvent;
    import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
    import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
    import net.minecraftforge.fml.common.network.NetworkRegistry;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    import net.minecraftforge.fml.common.registry.LanguageRegistry;
    import net.minecraftforge.fml.relauncher.Side;
    
    import com.rosecotton.shelvesmod.BlockShelf;
    //import com.becky.testmod01.Testmod01;
    
    @Mod(modid = ShelvesMod.MODID, name = ShelvesMod.MODNAME, version = ShelvesMod.VERSION) 
    
    public class ShelvesMod 
    {
    
      public static Block shelfBlock;
      //public static Item brickIngot;
      public static final String MODID = "shelvesmod";
      public static final String MODNAME = "RoseCotton's Shelves Mod for 1.8";
      public static final String VERSION = "1.0";
      public static int type;
    
      @Instance(value = "shelvesmod")
      public static ShelvesMod instance = new ShelvesMod();
      
      public static class MySidedProxyHolder {
    	  @SidedProxy(modId="shelvesmod",clientSide="com.rosecotton.shelvesmod.ClientProxy", serverSide="com.rosecotton.shelvesmod.CommonProxy")
    	  public static CommonProxy proxy;
    	  }
    	  
    	  public class CommonProxy {
    		  // Common or server stuff here that needs to be overridden on the client
    	  }
    	  public class ClientProxy extends CommonProxy {
    		  // Override common stuff with client specific stuff here
    	  }
    
      @EventHandler
      public void preInit(FMLPreInitializationEvent event) 
      {
    
      	//blocks
      	shelfBlock = new BlockShelf(type);
      	LanguageRegistry.addName(shelfBlock, "Shelf Block");
      	
      	GameRegistry.registerTileEntity(ShelfTitleEntity.class, "shelfTitleEntity");
      	//was com.rosecotton.shelvesmod.ShelfTitleEntity.class
      	
      	
      	//items
      	//brickIngot = new ItemBrickIngot();
    	  //MOVE GAMEREGISTRY TO ITEM CLASS?
      	//GameRegistry.registerItem(brickIngot, ((ItemBrickIngot) brickIngot).getName());
      	//LanguageRegistry.addName(brickIngot, "Brick Ingot");
    	NetworkRegistry.INSTANCE.registerGuiHandler(ShelvesMod.instance, GuiHandlerRegistry.getInstance());
    	GuiHandlerRegistry.getInstance().registerGuiHandler(new GuiHandlerShelf(), GuiHandlerShelf.getGuiID());
      }
    
      @EventHandler
      public void init(FMLInitializationEvent event) 
      {
      	//System.out.println("Called method: init");
      
      	if(event.getSide() == Side.CLIENT)
      	{
      		
      		RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
    
      		renderItem.getItemModelMesher().register(Item.getItemFromBlock(shelfBlock), 0, new ModelResourceLocation(ShelvesMod.MODID + ":" + ((BlockShelf) shelfBlock).getName(), "shelfBlock"));
      		Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(shelfBlock),0, new ModelResourceLocation(ShelvesMod.MODID+":"+ "shelfBlock", "inventory"));
      	}
      	
      	//recipes
      	GameRegistry.addRecipe(new ItemStack(shelfBlock), new Object[]{
      	"   ",
      	"  A",
      	" AA",
      	'A', Items.stick //getItemFromBlock(Blocks.planks)
      	});
      }
        @EventHandler
        public void postInit(FMLPostInitializationEvent event) 
        {
        	System.out.println("Called method: postInit");
        }
    }
    

     

    Block

    package com.rosecotton.shelvesmod;
    
    //import BlockStairs;
    
    import java.util.Iterator;
    import java.util.Random;
    
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockContainer;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.properties.IProperty;
    import net.minecraft.block.properties.PropertyDirection;
    import net.minecraft.block.properties.PropertyEnum;
    import net.minecraft.block.state.BlockState;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.client.resources.model.ModelResourceLocation;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.passive.EntityOcelot;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.inventory.InventoryHelper;
    import net.minecraft.inventory.InventoryLargeChest;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.tileentity.TileEntityChest;
    import net.minecraft.util.AxisAlignedBB;
    import net.minecraft.util.BlockPos;
    import net.minecraft.util.EnumFacing;
    import net.minecraft.util.IStringSerializable;
    import net.minecraft.util.MathHelper;
    import net.minecraft.world.IBlockAccess;
    import net.minecraft.world.ILockableContainer;
    import net.minecraft.world.World;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    
    
    public class BlockShelf extends BlockContainer {
    
        public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
        public static final PropertyEnum SECTION = PropertyEnum.create("section", BlockShelf.EnumShape.class);
        
        private final Random rand = new Random();
       // private static final String __OBFID = "CL_00000214";
    private final String name = "shelfBlock";
    ModelResourceLocation modelresourcelocation = new ModelResourceLocation("shelvesmod"+":"+name, "inventory");
        
        protected BlockShelf(int type)
        {
            super(Material.wood);
            //TEH FOLLOWIONG LINE MIGHT HAVE BEEN USEFUL BUT MAYBE CAUSED AN ERROR AT RUNTIME, TRY AGAIN
            this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
            //this.chestType = type;
            this.setCreativeTab(CreativeTabs.tabMisc);
            this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
            this.useNeighborBrightness = true;
    	this.setDefaultState(this.blockState.getBaseState());
            GameRegistry.registerBlock(this, name);
        	this.setUnlocalizedName(ShelvesMod.MODID + "_" + name);
        	this.setBlockBounds(1/16.0F, 0, 1/16.0F, 15/16.0F, 8/16.0F, 15/16.0F);
        }
    
        public String toString()
        {
            return this.name;
        }
        public String getName()
        {
            return this.name;
        }
    
        // used by the renderer to control lighting and visibility of other blocks.
        // set to false because this block doesn't fill the entire 1x1x1 space
        @Override
        public boolean isOpaqueCube() {
          return false;
        }
    
        // used by the renderer to control lighting and visibility of other blocks, also by
        // (eg) wall or fence to control whether the fence joins itself to this block
        // set to false because this block doesn't fill the entire 1x1x1 space
        @Override
        public boolean isFullCube() {
          return false;
        }
        
        // this function returns the correct item type corresponding to the colour of our block;
        // i.e. when a sign is broken, it will drop the correct item.
        @Override
        public int damageDropped(IBlockState state)
        {
          //EnumColour enumColour = (EnumColour)state.getValue(PROPERTYCOLOUR);
          //return this.getMetadata();//enumColour.getMetadata();
        	return 0;
        }
        
    
        
        
        public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
        {
            if (worldIn.getBlockState(pos.north()).getBlock() == this)
            {
                this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F);
            }
            else if (worldIn.getBlockState(pos.south()).getBlock() == this)
            {
                this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F);
            }
            else if (worldIn.getBlockState(pos.west()).getBlock() == this)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
            }
            else if (worldIn.getBlockState(pos.east()).getBlock() == this)
            {
                this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F);
            }
            else
            {
                this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
            }
        }
    
        public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
        {
            //this.checkForSurroundingChests(worldIn, pos, state);
            Iterator iterator = EnumFacing.Plane.HORIZONTAL.iterator();
    
            while (iterator.hasNext())
            {
                EnumFacing enumfacing = (EnumFacing)iterator.next();
                BlockPos blockpos1 = pos.offset(enumfacing);
                IBlockState iblockstate1 = worldIn.getBlockState(blockpos1);
    
            }
        }
    @Override
        public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase player)
        {
            return this.getDefaultState().withProperty(FACING, player.getHorizontalFacing());
        }
    
        public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
        {
            EnumFacing enumfacing = EnumFacing.getHorizontal(MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3).getOpposite();
            state = state.withProperty(FACING, enumfacing);
            BlockPos blockpos1 = pos.north();
            BlockPos blockpos2 = pos.south();
            BlockPos blockpos3 = pos.west();
            BlockPos blockpos4 = pos.east();
            boolean flag = this == worldIn.getBlockState(blockpos1).getBlock();
            boolean flag1 = this == worldIn.getBlockState(blockpos2).getBlock();
            boolean flag2 = this == worldIn.getBlockState(blockpos3).getBlock();
            boolean flag3 = this == worldIn.getBlockState(blockpos4).getBlock();
    
            if (!flag && !flag1 && !flag2 && !flag3)
            {
                worldIn.setBlockState(pos, state, 3);
            }
            else if (enumfacing.getAxis() == EnumFacing.Axis.X && (flag || flag1))
            {
                if (flag)
                {
                    worldIn.setBlockState(blockpos1, state, 3);
                }
                else
                {
                    worldIn.setBlockState(blockpos2, state, 3);
                }
    
                worldIn.setBlockState(pos, state, 3);
            }
            else if (enumfacing.getAxis() == EnumFacing.Axis.Z && (flag2 || flag3))
            {
                if (flag2)
                {
                    worldIn.setBlockState(blockpos3, state, 3);
                }
                else
                {
                    worldIn.setBlockState(blockpos4, state, 3);
                }
    
                worldIn.setBlockState(pos, state, 3);
            }
    
            if (stack.hasDisplayName())
            {
                TileEntity tileentity = worldIn.getTileEntity(pos);
    
                if (tileentity instanceof TileEntityChest)
                {
                    ((TileEntityChest)tileentity).setCustomName(stack.getDisplayName());
                }
            }
        }
        
        public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state)
        {
            EnumFacing enumfacing = null;
            Iterator iterator = EnumFacing.Plane.HORIZONTAL.iterator();
    
            while (iterator.hasNext())
            {
                EnumFacing enumfacing1 = (EnumFacing)iterator.next();
                IBlockState iblockstate1 = worldIn.getBlockState(pos.offset(enumfacing1));
    
                if (iblockstate1.getBlock() == this)
                {
                    return state;
                }
    
                if (iblockstate1.getBlock().isFullBlock())
                {
                    if (enumfacing != null)
                    {
                        enumfacing = null;
                        break;
                    }
    
                    enumfacing = enumfacing1;
                }
            }
    
            if (enumfacing != null)
            {
                return state.withProperty(FACING, enumfacing.getOpposite());
            }
            else
            {
                EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING);
    
                if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
                {
                    enumfacing2 = enumfacing2.getOpposite();
                }
    
                if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
                {
                    enumfacing2 = enumfacing2.rotateY();
                }
    
                if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
                {
                    enumfacing2 = enumfacing2.getOpposite();
                }
    
                return state.withProperty(FACING, enumfacing2);
            }
        }
    
    
    
    
    
        public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
        {
            TileEntity tileentity = worldIn.getTileEntity(pos);
    
            if (tileentity instanceof IInventory)
            {
                InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity);
                worldIn.updateComparatorOutputLevel(pos, this);
            }
    
            super.breakBlock(worldIn, pos, state);
        }
        
       /* 
    // This is where you can do something when the block is broken. In this case drop the inventory's contents
    @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 each slot in the inventory
    		for (int i = 0; i < inventory.getSizeInventory(); i++){
    			// If the slot is not empty
    			if (inventory.getStackInSlot(i) != null)
    			{
    				// Create a new entity item with the item stack in the slot
    				EntityItem item = new EntityItem(worldIn, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, inventory.getStackInSlot(i));
    
    				// Apply some random motion to the item
    				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;
    
    				// Spawn the item in the world
    				worldIn.spawnEntityInWorld(item);
    			}
    		}
    
    		// Clear the inventory so nothing else (such as another mod) can do anything with the items
    		inventory.clear();
    	}
    
    	// Super MUST be called last because it removes the tile entity
    	super.breakBlock(worldIn, pos, state);
    }*/
    
    
    
    // Called when the block is right clicked
    // In this block it is used to open the blocks gui when right clicked by a player
    @Override
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {
    	// Uses the gui handler registered to your mod to open the gui for the given gui id
    	// open on the server side only  (not sure why you shouldn't open client side too... vanilla doesn't, so we better not either)
    	if (worldIn.isRemote) return true;
    
    
    	playerIn.openGui(ShelvesMod.instance, GuiHandlerShelf.getGuiID(), worldIn, pos.getX(), pos.getY(), pos.getZ());
       	System.out.println("Called method: BlockShelf.onBlockActivated");
    	return true;
    }
    @Override
       public TileEntity createNewTileEntity(World worldIn, int meta)
        {
            return new ShelfTitleEntity();
        }
    
    
    
        private boolean isBlocked(World worldIn, BlockPos pos)
        {
            return this.isBelowSolidBlock(worldIn, pos) || this.isOcelotSittingOnChest(worldIn, pos);
        }
    
        private boolean isBelowSolidBlock(World worldIn, BlockPos pos)
        {
            return worldIn.getBlockState(pos.up()).getBlock().isNormalCube();
        }
    
    
    
    
        private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos)
        {
            Iterator iterator = worldIn.getEntitiesWithinAABB(EntityOcelot.class, new AxisAlignedBB((double)pos.getX(), (double)(pos.getY() + 1), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 2), (double)(pos.getZ() + 1))).iterator();
            EntityOcelot entityocelot;
    
            do
            {
                if (!iterator.hasNext())
                {
                    return false;
                }
    
                Entity entity = (Entity)iterator.next();
                entityocelot = (EntityOcelot)entity;
            }
            while (!entityocelot.isSitting());
    
            return true;
        }
    
        public boolean hasComparatorInputOverride()
        {
            return true;
        }
    
        @Override
        public IBlockState getStateFromMeta(int meta)
        {
            EnumFacing enumfacing = EnumFacing.getFront(meta);
    
            if (enumfacing.getAxis() == EnumFacing.Axis.Y)
            {
                enumfacing = EnumFacing.NORTH;
            }
    
            return this.getDefaultState().withProperty(FACING, enumfacing);
        }
    
        @Override
        public int getMetaFromState(IBlockState state)
        {
          EnumFacing facing = (EnumFacing)state.getValue(FACING);
    
          int facingbits = facing.getHorizontalIndex();
          return facingbits;// | colourbits;
        }
    
        // necessary to define which properties your blocks use
        // will also affect the variants listed in the blockstates model file
        @Override
        protected BlockState createBlockState()
        {
            return new BlockState(this, new IProperty[] {FACING,SECTION});
        }
    
        
        @Override
        public Item getItemDropped(IBlockState state, Random rand, int fortune)
        {
            return Item.getItemFromBlock(this);
        }
        public static enum EnumShape implements IStringSerializable
        {
            TOP("top"),
            MIDDLE("middle"),
            BOTTOM("bottom");
    
            private final String name;
    
            private static final String __OBFID = "CL_00003061";
    
            private EnumShape(String name)
            {
                this.name = name;
            }
    
            public String toString()
            {
                return this.name;
            }
    
            public String getName()
            {
                return this.name;
            }
    
        }
        public TileEntity createTileEntity(World world, int metadata)
        {
           return new ShelfTitleEntity();
        }
        
        @Override
        public int getRenderType()
        {
            return 3;
        }
        
    }
    

     

    TileEntity (misspelled)

    package com.rosecotton.shelvesmod;
    import java.util.Arrays;
    
    import net.minecraft.block.BlockChest;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    //import net.minecraft.network.INetworkManager;
    import net.minecraft.network.Packet;
    //import net.minecraft.network.packet.Packet132TileEntityData;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.util.ChatComponentText;
    import net.minecraft.util.ChatComponentTranslation;
    import net.minecraft.util.IChatComponent;
    import net.minecraft.world.World;
    import net.minecraft.nbt.NBTTagList;
    
    public class ShelfTitleEntity extends TileEntity implements IInventory {
    final int NUMBER_OF_SLOTS = 4;
        public int numPlayersUsing;
    private ItemStack[] itemStacks = new ItemStack[NUMBER_OF_SLOTS];
    
    
    // will add a key for this container to the lang file so we can name it in the GUI
    @Override
    public String getName() {
    	return "Block Shelf";
    }
    
    @Override
    public boolean hasCustomName() {
    return false;
    }
    
    // standard code to look up what the human-readable name is
    @Override
    public IChatComponent getDisplayName() {
    return this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName());
    }
    
    @Override
    public int getSizeInventory() {
    return itemStacks.length;
    }
    
    @Override
    public ItemStack getStackInSlot(int slotIndex) {
    return itemStacks[slotIndex];
    }
    
    @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;
    }
    
    // -----------------------------------------------------------------------------------------------------------
    // The following method is not needed for this example but are part of IInventory so must be implemented
    /**
    * This method removes the entire contents of the given slot and returns it.
    * Used by containers such as crafting tables which return any items in their slots when you close the GUI
    * @param slotIndex
    * @return
    */
    @Override
    public ItemStack getStackInSlotOnClosing(int slotIndex) {
    ItemStack itemStack = getStackInSlot(slotIndex);
    if (itemStack != null) setInventorySlotContents(slotIndex, null);
    return itemStack;
    }
    
    // overwrites the stack in the given slotIndex with the given stack
    @Override
    public void setInventorySlotContents(int slotIndex, ItemStack itemstack) {
    itemStacks[slotIndex] = itemstack;
    if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) {
    	itemstack.stackSize = getInventoryStackLimit();
    }
    markDirty();
    }
    
    // This is the maximum number if items allowed in each slot
    // This only affects things such as hoppers trying to insert items you need to use the container to enforce this for players
    // inserting items via the gui
    @Override
    public int getInventoryStackLimit() {
    return 64;
    }
    
    // Return true if the given player is able to use this block. In this case it checks that
    // 1) the world tileentity hasn't been replaced in the meantime, and
    // 2) the player isn't too far away from the centre of the block
    @Override
    public boolean isUseableByPlayer(EntityPlayer player) {
    if (this.worldObj.getTileEntity(this.pos) != this) return false;
    final double X_CENTRE_OFFSET = 0.5;
    final double Y_CENTRE_OFFSET = 0.5;
    final double Z_CENTRE_OFFSET = 0.5;
    final double MAXIMUM_DISTANCE_SQ = 8.0 * 8.0;
    return player.getDistanceSq(pos.getX() + X_CENTRE_OFFSET, pos.getY() + Y_CENTRE_OFFSET, pos.getZ() + Z_CENTRE_OFFSET) < MAXIMUM_DISTANCE_SQ;
    }
    
    //-----------------------------------------------------------------------------------------------------------
    //The following method is not needed for this example but are part of IInventory so must be implemented
    @Override
    public void openInventory(EntityPlayer player) {
        if (!player.isSpectator())
        {
            if (this.numPlayersUsing < 0)
            {
                this.numPlayersUsing = 0;
            }
    
            ++this.numPlayersUsing;
            this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing);
            this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType());
            this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType());
        	System.out.println("Called method: ShelfTitleEntity.openInventory");
        }
    }
    
    //-----------------------------------------------------------------------------------------------------------
    //The following method is not needed for this example but are part of IInventory so must be implemented
    @Override
    public void closeInventory(EntityPlayer player) {
        if (!player.isSpectator() && this.getBlockType() instanceof BlockChest)
        {
            --this.numPlayersUsing;
            this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing);
            this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType());
            this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType());
        }
    }
    
    // Return true if the given stack is allowed to go in the given slot.  In this case, we can insert anything.
    // This only affects things such as hoppers trying to insert items you need to use the container to enforce this for players
    // inserting items via the gui
    @Override
    public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) {
    return true;
    }
    
    
    // This is where you save any data that you don't want to lose when the tile entity unloads
    // In this case, it saves the itemstacks stored in the container
    @Override
    public void writeToNBT(NBTTagCompound parentNBTTagCompound)
    {
    super.writeToNBT(parentNBTTagCompound); // The super call is required to save and load the tileEntity's location
    
    // to use an analogy with Java, this code generates an array of hashmaps
    // The itemStack in each slot is converted to an NBTTagCompound, which is effectively a hashmap of key->value pairs such
    //   as slot=1, id=2353, count=1, etc
    // Each of these NBTTagCompound are then inserted into NBTTagList, which is similar to an array.
    NBTTagList dataForAllSlots = new NBTTagList();
    for (int i = 0; i < this.itemStacks.length; ++i) {
    	if (this.itemStacks[i] != null)	{
    		NBTTagCompound dataForThisSlot = new NBTTagCompound();
    		dataForThisSlot.setByte("Slot", (byte) i);
    		this.itemStacks[i].writeToNBT(dataForThisSlot);
    		dataForAllSlots.appendTag(dataForThisSlot);
    	}
    }
    // the array of hashmaps is then inserted into the parent hashmap for the container
    parentNBTTagCompound.setTag("Items", dataForAllSlots);
    }
    
    // This is where you load the data that you saved in writeToNBT
    @Override
    public void readFromNBT(NBTTagCompound parentNBTTagCompound)
    {
    super.readFromNBT(parentNBTTagCompound); // The super call is required to save and load the tiles location
    
    final byte NBT_TYPE_COMPOUND = 10;       // See NBTBase.createNewByType() for a listing
    NBTTagList dataForAllSlots = parentNBTTagCompound.getTagList("Items", NBT_TYPE_COMPOUND);
    
    Arrays.fill(itemStacks, null);           // set all slots to empty
    for (int i = 0; i < dataForAllSlots.tagCount(); ++i) {
    	NBTTagCompound dataForOneSlot = dataForAllSlots.getCompoundTagAt(i);
    	int slotIndex = dataForOneSlot.getByte("Slot") & 255;
    
    	if (slotIndex >= 0 && slotIndex < this.itemStacks.length) {
    		this.itemStacks[slotIndex] = ItemStack.loadItemStackFromNBT(dataForOneSlot);
    	}
    }
    }
    
    public boolean receiveClientEvent(int id, int type)
    {
        if (id == 1)
        {
            this.numPlayersUsing = type;
            return true;
        }
        else
        {
            return super.receiveClientEvent(id, type);
        }
    }
    
    @Override
    public int getField(int id) {
    return Item.getIdFromItem(itemStacks[id].getItem());
    }
    
    @Override
    public void setField(int id, int value) {
    itemStacks[id].setItem(Item.getItemById(value));
    }
    
    @Override
    public int getFieldCount() {
    return itemStacks.length;
    }
    
    // set all slots to empty
    @Override
    public void clear() {
    Arrays.fill(itemStacks, null);
    }
    }
    

     

    RenderShelfItems (never runs, don't know where or how to use this)

    package com.rosecotton.shelvesmod;
    
    
    
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.gui.FontRenderer;
    import net.minecraft.client.renderer.BlockRendererDispatcher;
    import net.minecraft.client.renderer.GlStateManager;
    import net.minecraft.client.renderer.RenderHelper;
    import net.minecraft.client.renderer.Tessellator;
    import net.minecraft.client.renderer.WorldRenderer;
    import net.minecraft.client.renderer.entity.Render;
    import net.minecraft.client.renderer.entity.RenderItem;
    import net.minecraft.client.renderer.entity.RenderManager;
    import net.minecraft.client.renderer.texture.TextureAtlasSprite;
    import net.minecraft.client.renderer.texture.TextureCompass;
    import net.minecraft.client.renderer.texture.TextureMap;
    import net.minecraft.client.resources.model.IBakedModel;
    import net.minecraft.client.resources.model.ModelManager;
    import net.minecraft.client.resources.model.ModelResourceLocation;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.entity.item.EntityItemFrame;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemSkull;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.BlockPos;
    import net.minecraft.util.MathHelper;
    import net.minecraft.util.ResourceLocation;
    import net.minecraft.world.storage.MapData;
    import net.minecraftforge.fml.relauncher.Side;
    import net.minecraftforge.fml.relauncher.SideOnly;
    import org.lwjgl.opengl.GL11;
    
    @SideOnly(Side.CLIENT)
    public class RenderShelfItems extends Render
    {
    	private static final ResourceLocation mapBackgroundTextures = new ResourceLocation("textures/map/map_background.png");
        private final Minecraft mc = Minecraft.getMinecraft();
        private final ModelResourceLocation itemFrameModel = new ModelResourceLocation("item_frame", "normal");
        private final ModelResourceLocation mapModel = new ModelResourceLocation("item_frame", "map");
        private RenderItem itemRenderer[] = new RenderItem[4];
        //private static final String __OBFID = "CL_00001002";
    
        public RenderShelfItems(RenderManager renderManagerIn, RenderItem renderItemIn[])
        {
            super(renderManagerIn);
            renderManagerIn.entityRenderMap.put(ShelfTitleEntity.class, new RenderShelfItems(renderManager, null));
            for (int i = 0; i<4; i++)
            {
            	this.itemRenderer[i] = renderItemIn[i];
            }
        }
    
        public void doRender(ShelfTitleEntity entity, double x, double y, double z, float rotationMaybeIn, float partialTicks)
        {
            GlStateManager.pushMatrix();
            BlockPos blockpos = entity.getPos();
            double d3 = (double)blockpos.getX() - entity.getPos().getX() + x;
            double d4 = (double)blockpos.getY() - entity.getPos().getY() + y;
            double d5 = (double)blockpos.getZ() - entity.getPos().getZ() + z;
            for(int i = 0; i<4; i++)
            {
    	        double d3Add = d3 + (double)(4 +(i%2)*8)/16;
    	        double d4Add = d4 + (double)(2 + (i/2)*6)/16;
    	        double d5Add = d5 + (double)(13 - (i/2)*8)/16;
    	        //GlStateManager.translate(d3 + 0.5D, d4 + 0.5D, d5 + 0.5D);  OLD CODE
    	        GlStateManager.translate(d3Add, d4Add, d5Add);
    	        //GlStateManager.rotate(180.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
    	        //this.renderManager.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
    	        BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
    	        ModelManager modelmanager = blockrendererdispatcher.getBlockModelShapes().getModelManager();
    	        IBakedModel ibakedmodel;
    
    	        //OLD CODE
    	        /*if (entity.getStackInSlot(i) != null && entity.getStackInSlot(i).getItem() == Items.filled_map)
    	        {
    	            ibakedmodel = modelmanager.getModel(this.mapModel);
    	        }
    	        else
    	        {
    	            ibakedmodel = modelmanager.getModel(this.itemFrameModel);
    	        }*/
    	        if (entity.getStackInSlot(i) != null)
    	        {
    	        	ibakedmodel = modelmanager.getModel(new ModelResourceLocation(entity.getStackInSlot(i).getUnlocalizedName(),"inventory"));
    	        }
    	        else
    	        {
    	        	ibakedmodel = modelmanager.getMissingModel();
    	        }
    
    	        GlStateManager.pushMatrix();
    	        GlStateManager.translate(-0.5F, -0.5F, -0.5F);
    	        blockrendererdispatcher.getBlockModelRenderer().renderModelBrightnessColor(ibakedmodel, 1.0F, 1.0F, 1.0F, 1.0F);
    	        GlStateManager.popMatrix();
    	        GlStateManager.translate(0.0F, 0.0F, 0.4375F);
    	        this.renderItem(entity);
    	        GlStateManager.popMatrix();
    	        //OLD, OMG I CANNOT MAKE THIS WORK, field_174860_B IS AN ENUMFACING FACING DIRECTION VARIABLE THINGY AND I CAN'T SEEM TO GET IT...
    	        //this.func_147914_a(entity, x + (double)((float)entity.field_174860_b.getFrontOffsetX() * 0.3F), y - 0.25D, z + (double)((float)entity.field_174860_b.getFrontOffsetZ() * 0.3F));
    	        //this.func_147914_a(entity, x, y, z);  //SCREW IT, WE CAN TWEAK THE POSITIONING LATER
        	}
        }
    
        protected ResourceLocation getEntityTexture(EntityItemFrame entity)
        {
            return null;
        }
    
        private void renderItem(ShelfTitleEntity shelfTitleEntityIn)
        {
            ItemStack itemstack[] = new ItemStack[4];
            for (int i = 0; i<4; i++)
            {
            	itemstack[i] = shelfTitleEntityIn.getStackInSlot(i);
            
    
    	        if (itemstack[i] != null)
    	        {
    	            EntityItem entityitem = new EntityItem(shelfTitleEntityIn.getWorld(), 0.0D, 0.0D, 0.0D, itemstack[i]);
    	            Item item = entityitem.getEntityItem().getItem();
    	            
    	            //DO I WANT THIS?  WILL IT SCREW UP THE NUMBER OF ITEMS I HAVE STORED IN EACH STACK OR JUST DISPLAY PROPERLY?
    	            entityitem.getEntityItem().stackSize = 1;
    	            entityitem.hoverStart = 0.0F;
    	            GlStateManager.pushMatrix();
    	            GlStateManager.disableLighting();
    	            
    	            //I DON'T DO ROTATION SO I THINK IT'S OK TO LEAVE THIS OUT
    	            //int i = shelfTitleEntityIn.getRotation();
    
    	            //if (item == Items.filled_map)
    	            //{
    	            //    i = i % 4 * 2;
    	            //}
    
    	            //GlStateManager.rotate((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);
    
    	            if (item == Items.filled_map)
    	            {
    	                this.renderManager.renderEngine.bindTexture(mapBackgroundTextures);
    	                GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
    	                float f = 0.0078125F;
    	                GlStateManager.scale(f, f, f);
    	                GlStateManager.translate(-64.0F, -64.0F, 0.0F);
    	                MapData mapdata = Items.filled_map.getMapData(entityitem.getEntityItem(), shelfTitleEntityIn.getWorld());
    	                GlStateManager.translate(0.0F, 0.0F, -1.0F);
    
    	                if (mapdata != null)
    	                {
    	                    this.mc.entityRenderer.getMapItemRenderer().func_148250_a(mapdata, true);
    	                }
    	            }
    	            else
    	            {
    	                TextureAtlasSprite textureatlassprite = null;
    
    	                if (item == Items.compass)
    	                {
    	                    textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite(TextureCompass.field_176608_l);
    	                    this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    
    	                    if (textureatlassprite instanceof TextureCompass)
    	                    {
    	                        TextureCompass texturecompass = (TextureCompass)textureatlassprite;
    	                        double d0 = texturecompass.currentAngle;
    	                        double d1 = texturecompass.angleDelta;
    	                        texturecompass.currentAngle = 0.0D;
    	                        texturecompass.angleDelta = 0.0D;
    	                        
    	                        //NM COMPASS ACCURACY. THIS IS RIDICULOUS. I CANNOT FIGURE OUT HOW TO GET THE ENUMFACING ROTATION DATA FOR MY SHELFTILEENTITY
    	                        //texturecompass.updateCompass(shelfTitleEntityIn.getWorld(), shelfTitleEntityIn.getPos().getX(), shelfTitleEntityIn.getPos().getZ(), (double)MathHelper.wrapAngleTo180_float((float)(180 + shelfTitleEntityIn.field_174860_b.getHorizontalIndex() * 90)), false, true);
    	                        texturecompass.currentAngle = d0;
    	                        texturecompass.angleDelta = d1;
    	                    }
    	                    else
    	                    {
    	                        textureatlassprite = null;
    	                    }
    	                }
    
    	                GlStateManager.scale(0.5F, 0.5F, 0.5F);
    
    	                /*if (!this.itemRenderer.shouldRenderItemIn3D(entityitem.getEntityItem()) || item instanceof ItemSkull)
    	                {
    	                    GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
    	                }*/
    
    	                GlStateManager.pushAttrib();
    	                RenderHelper.enableStandardItemLighting();
    	                this.itemRenderer[i].renderItemModel(shelfTitleEntityIn.getStackInSlot(i));
    	                RenderHelper.disableStandardItemLighting();
    	                GlStateManager.popAttrib();
    
    	                if (textureatlassprite != null && textureatlassprite.getFrameCount() > 0)
    	                {
    	                    textureatlassprite.updateAnimation();
    	                }
    	            }
    
    	            GlStateManager.enableLighting();
    	            GlStateManager.popMatrix();
    	        }
            }
        }
    
        //I REALLY DON'T KNOW WHAT THIS IS BUT IF IT'S FOR LABELS OR LIVING THINGS OR WHATEVER, LET'S SKIP IT
        /*
        protected void func_147914_a(ShelfTitleEntity shelfTitleEntityIn2, double p_147914_2_, double p_147914_4_, double p_147914_6_)
        {
        	for(int i = 0; i<4; i++)
        	{
    	        if (Minecraft.isGuiEnabled() && shelfTitleEntityIn2.getStackInSlot(i) != null && shelfTitleEntityIn2.getStackInSlot(i).hasDisplayName() && this.renderManager.pointedEntity == (shelfTitleEntityIn2.getStackInSlot(i)))
    	        {
    	            float f = 1.6F;
    	            float f1 = 0.016666668F * f;
    	            double d3 = shelfTitleEntityIn2.getDistanceSqToEntity(this.renderManager.livingPlayer);
    	            float f2 = shelfTitleEntityIn2.isSneaking() ? 32.0F : 64.0F;
    
    	            if (d3 < (double)(f2 * f2))
    	            {
    	                String s = shelfTitleEntityIn2.getStackInSlot(i).getDisplayName();
    
    	                if (shelfTitleEntityIn2.isSneaking())
    	                {
    	                    FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
    	                    GlStateManager.pushMatrix();
    	                    GlStateManager.translate((float)p_147914_2_ + 0.0F, (float)p_147914_4_ + shelfTitleEntityIn2.height + 0.5F, (float)p_147914_6_);
    	                    GL11.glNormal3f(0.0F, 1.0F, 0.0F);
    	                    GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    	                    GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    	                    GlStateManager.scale(-f1, -f1, f1);
    	                    GlStateManager.disableLighting();
    	                    GlStateManager.translate(0.0F, 0.25F / f1, 0.0F);
    	                    GlStateManager.depthMask(false);
    	                    GlStateManager.enableBlend();
    	                    GlStateManager.blendFunc(770, 771);
    	                    Tessellator tessellator = Tessellator.getInstance();
    	                    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    	                    GlStateManager.disableTexture2D();
    	                    worldrenderer.startDrawingQuads();
    	                    int i = fontrenderer.getStringWidth(s) / 2;
    	                    worldrenderer.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
    	                    worldrenderer.addVertex((double)(-i - 1), -1.0D, 0.0D);
    	                    worldrenderer.addVertex((double)(-i - 1), 8.0D, 0.0D);
    	                    worldrenderer.addVertex((double)(i + 1), 8.0D, 0.0D);
    	                    worldrenderer.addVertex((double)(i + 1), -1.0D, 0.0D);
    	                    tessellator.draw();
    	                    GlStateManager.enableTexture2D();
    	                    GlStateManager.depthMask(true);
    	                    fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127);
    	                    GlStateManager.enableLighting();
    	                    GlStateManager.disableBlend();
    	                    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    	                    GlStateManager.popMatrix();
    	                }
    	                else
    	                {
    	                    this.renderLivingLabel(shelfTitleEntityIn2, s, p_147914_2_, p_147914_4_, p_147914_6_, 64);
    	                }
    	            }
    	        }
        	}
        }*/
    
        protected ResourceLocation getEntityTexture(Entity entity)
        {
            return this.getEntityTexture((EntityItemFrame)entity);
        }
    
        protected void renderName(Entity entity, double x, double y, double z)
        {
            //this.func_147914_a((EntityItemFrame)entity, x, y, z);
        }
    
        public void doRender(Entity entity, double x, double y, double z, float rotationMaybeIn, float partialTicks)
        {
            this.doRender((EntityItemFrame)entity, x, y, z, rotationMaybeIn, partialTicks);
        }
    
    }
    

     

    ok, sorry for the earlier edit on this post.  I think I got all the bad words out of the comments this time.

  5. Really, what I want is an IBakedModel from either a RenderItem or an ItemStack.

     

    I just want to render an item within a block that is representative of the ItemStack held in a block's TileEntity.

     

    I'm copying a lot of code from the ItemFrame because it's the closest thing to what I want to do (i.e. render an item that is stored in a block).

     

    I'll post code if that helps, but I think I've narrowed down my question enough that it's probably not necessary.

    (this isn't one of those "my code's broke" questions).

  6. Maybe I don't understand since I'm also new, but why are you making this a TileEntity?  Does it contain items or other data?  Like, are you going to try to set items on the table?  or is it just a block?

     

    If you do set stuff on the table and render it so it's visible, let me know how you do it!  :)

  7. Hi, All.

    I was trying to add code to render items on my shelf block when they're contained in the shelf's tile entity and I broke its container properties.

    Now, in the GUI, if I left-click on an item placed in the shelf, it disappears.

    If I right-click on an item in the shelf, it cuts the quantity in half, deletes half, and leaves 1/4 in the shelf and I can place 1/4 in my regular inventory.  if I take that stack from inventory and put it back on the item in the shelf I got it from, I get 3/4 what I started with (so, like the item stack in inventory actually had 2x the quantity it was reporting).

     

    I'll say what I say each time I screw up my code... "I didn't change anything that should do this!"

    I've been combing through the code and can't find how I can even screw this up so bad.  Can you find the blatant error?

     

    console data gives no clues.

     

     

    [04:18:58] [main/INFO] [GradleStart]: Extra: []

    [04:18:58] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Becky/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken, {REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker]

    [04:18:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

    [04:18:58] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

    [04:18:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

    [04:18:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

    [04:18:58] [main/INFO] [FML]: Forge Mod Loader version 8.0.20.1023 for Minecraft 1.8 loading

    [04:18:58] [main/INFO] [FML]: Java is Java HotSpot Client VM, version 1.8.0_31, running on Windows 7:x86:6.1, installed at C:\Program Files\Java\jre1.8.0_31

    [04:18:58] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

    [04:18:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

    [04:18:58] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

    [04:18:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

    [04:18:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

    [04:18:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

    [04:18:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

    [04:18:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

    [04:18:58] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

    [04:19:00] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

    [04:19:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

    [04:19:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

    [04:19:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

    [04:19:00] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

    [04:19:01] [Client thread/INFO]: Setting user: Player688

    [04:19:01] [Client thread/INFO]: (Session ID is token:FML:Player688)

    [04:19:04] [Client thread/INFO]: LWJGL Version: 2.9.1

    [04:19:05] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

    [04:19:05] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

    [04:19:05] [Client thread/INFO] [FML]: Searching C:\Users\Becky\Desktop\Forge ModLoader-1.8-8.0.20.1023-1.8-src\eclipse\mods for mods

    [04:19:08] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load

    [04:19:08] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, testmod01, oredetectmod, shelvesmod] at CLIENT

    [04:19:08] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, testmod01, oredetectmod, shelvesmod] at SERVER

    [04:19:09] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Test Mod 01, FMLFileResourcePack:Ore Detect Mod, FMLFileResourcePack:Shelves Mod

    [04:19:09] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

    [04:19:09] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations

    [04:19:09] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getGuiID:19]: Called method: GuiHandlerShelf.getGuiID

    [04:19:09] [Client thread/INFO] [FML]: Applying holder lookups

    [04:19:09] [Client thread/INFO] [FML]: Holder lookups applied

    [04:19:09] [sound Library Loader/INFO]: Starting up SoundSystem...

    [04:19:09] [Thread-7/INFO]: Initializing LWJGL OpenAL

    [04:19:09] [Thread-7/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

    [04:19:10] [Thread-7/INFO]: OpenAL initialized.

    [04:19:10] [sound Library Loader/INFO]: Sound engine started

    [04:19:12] [Client thread/INFO]: Created: 512x512 textures-atlas

    [04:19:13] [Client thread/INFO] [sTDOUT]: [com.becky.testmod01.Testmod01:postInit:142]: Called method: postInit

    [04:19:13] [Client thread/INFO] [sTDOUT]: [com.rosecotton.oredetect.OreDetectMod:postInit:120]: Called method: postInit

    [04:19:13] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.ShelvesMod:postInit:102]: Called method: postInit

    [04:19:13] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods

    [04:19:13] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Test Mod 01, FMLFileResourcePack:Ore Detect Mod, FMLFileResourcePack:Shelves Mod

    [04:19:13] [Client thread/INFO]: SoundSystem shutting down...

    [04:19:14] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

    [04:19:14] [sound Library Loader/INFO]: Starting up SoundSystem...

    [04:19:14] [Thread-9/INFO]: Initializing LWJGL OpenAL

    [04:19:14] [Thread-9/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

    [04:19:14] [Thread-9/INFO]: OpenAL initialized.

    [04:19:14] [sound Library Loader/INFO]: Sound engine started

    [04:19:16] [Client thread/INFO]: Created: 512x512 textures-atlas

    [04:19:26] [server thread/INFO]: Starting integrated minecraft server version 1.8

    [04:19:26] [server thread/INFO]: Generating keypair

    [04:19:26] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

    [04:19:26] [server thread/INFO] [FML]: Applying holder lookups

    [04:19:26] [server thread/INFO] [FML]: Holder lookups applied

    [04:19:27] [server thread/INFO]: Preparing start region for level 0

    [04:19:28] [server thread/INFO]: Preparing spawn area: 52%

    [04:19:28] [server thread/INFO]: Changing view distance to 8, from 10

    [04:19:29] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 1

    [04:19:29] [Netty Server IO #1/INFO] [FML]: Client protocol version 1

    [04:19:29] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : oredetectmod@1.0,FML@8.0.20.1023,shelvesmod@1.0,testmod01@1.0,mcp@9.05

    [04:19:29] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established

    [04:19:29] [server thread/INFO] [FML]: [server thread] Server side modded connection established

    [04:19:29] [server thread/INFO]: Player688[local:E:c7e0955e] logged in with entity id 39 at (229.69999998807907, 66.0, -203.30925797377813)

    [04:19:29] [server thread/INFO]: Player688 joined the game

    [04:19:37] [server thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getGuiID:19]: Called method: GuiHandlerShelf.getGuiID

    [04:19:37] [server thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getGuiID:19]: Called method: GuiHandlerShelf.getGuiID

    [04:19:37] [server thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getServerGuiElement:33]: Called method: GuiHandlerShelf.getServerGuiElement return good stuff

    [04:19:37] [server thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.BlockShelf:onBlockActivated:283]: Called method: BlockShelf.onBlockActivated

    [04:19:37] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getGuiID:19]: Called method: GuiHandlerShelf.getGuiID

    [04:19:37] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getClientGuiElement:51]: Called method: GuiHandlerShelf.getClientGuiElement return good stuff

    [04:20:00] [server thread/INFO]: Saving and pausing game...

    [04:20:00] [server thread/INFO]: Saving chunks for level 'Survival'/Overworld

    [04:20:01] [server thread/INFO]: Saving chunks for level 'Survival'/Nether

    [04:20:01] [server thread/INFO]: Saving chunks for level 'Survival'/The End

    [04:20:02] [server thread/INFO]: Stopping server

    [04:20:02] [server thread/INFO]: Saving players

    [04:20:02] [server thread/INFO]: Saving worlds

    [04:20:02] [server thread/INFO]: Saving chunks for level 'Survival'/Overworld

    [04:20:02] [server thread/INFO]: Saving chunks for level 'Survival'/Nether

    [04:20:02] [server thread/INFO]: Saving chunks for level 'Survival'/The End

    [04:20:02] [server thread/INFO] [FML]: Applying holder lookups

    [04:20:02] [server thread/INFO] [FML]: Holder lookups applied

    [04:20:02] [Client thread/INFO]: Stopping!

    [04:20:02] [Client thread/INFO]: SoundSystem shutting down...

    [04:20:02] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

    Java HotSpot Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

     

     

     

    package com.rosecotton.shelvesmod;
    
    import net.minecraft.block.Block;
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.renderer.entity.RenderItem;
    import net.minecraft.client.resources.model.ModelResourceLocation;
    import net.minecraft.init.Blocks;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.fml.client.registry.ClientRegistry;
    import net.minecraftforge.fml.common.Mod;
    import net.minecraftforge.fml.common.Mod.EventHandler;
    import net.minecraftforge.fml.common.Mod.Instance;
    import net.minecraftforge.fml.common.SidedProxy;
    import net.minecraftforge.fml.common.event.FMLInitializationEvent;
    import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
    import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
    import net.minecraftforge.fml.common.network.NetworkRegistry;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    import net.minecraftforge.fml.common.registry.LanguageRegistry;
    import net.minecraftforge.fml.relauncher.Side;
    
    import com.rosecotton.shelvesmod.BlockShelf;
    //import com.becky.testmod01.Testmod01;
    
    @Mod(modid = ShelvesMod.MODID, name = ShelvesMod.MODNAME, version = ShelvesMod.VERSION) 
    
    public class ShelvesMod 
    {
    
      public static Block shelfBlock;
      //public static Item brickIngot;
      public static final String MODID = "shelvesmod";
      public static final String MODNAME = "RoseCotton's Shelves Mod for 1.8";
      public static final String VERSION = "1.0";
      public static int type;
    
      @Instance(value = "shelvesmod")
      public static ShelvesMod instance = new ShelvesMod();
      
      public static class MySidedProxyHolder {
    	  @SidedProxy(modId="shelvesmod",clientSide="com.rosecotton.shelvesmod.ClientProxy", serverSide="com.rosecotton.shelvesmod.CommonProxy")
    	  public static CommonProxy proxy;
    	  }
    	  
    	  public class CommonProxy {
    		  // Common or server stuff here that needs to be overridden on the client
    	  }
    	  public class ClientProxy extends CommonProxy {
    		  // Override common stuff with client specific stuff here
    	  }
    
      @EventHandler
      public void preInit(FMLPreInitializationEvent event) 
      {
    
      	//blocks
      	shelfBlock = new BlockShelf(type);
      	LanguageRegistry.addName(shelfBlock, "Shelf Block");
      	
      	GameRegistry.registerTileEntity(ShelfTitleEntity.class, "shelfTitleEntity");
      	//was com.rosecotton.shelvesmod.ShelfTitleEntity.class
      	
      	
      	//items
      	//brickIngot = new ItemBrickIngot();
    	  //MOVE GAMEREGISTRY TO ITEM CLASS?
      	//GameRegistry.registerItem(brickIngot, ((ItemBrickIngot) brickIngot).getName());
      	//LanguageRegistry.addName(brickIngot, "Brick Ingot");
    	NetworkRegistry.INSTANCE.registerGuiHandler(ShelvesMod.instance, GuiHandlerRegistry.getInstance());
    	GuiHandlerRegistry.getInstance().registerGuiHandler(new GuiHandlerShelf(), GuiHandlerShelf.getGuiID());
      }
    
      @EventHandler
      public void init(FMLInitializationEvent event) 
      {
      	//System.out.println("Called method: init");
      
      	if(event.getSide() == Side.CLIENT)
      	{
      		
      		RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
    
      		renderItem.getItemModelMesher().register(Item.getItemFromBlock(shelfBlock), 0, new ModelResourceLocation(ShelvesMod.MODID + ":" + ((BlockShelf) shelfBlock).getName(), "shelfBlock"));
      		Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(shelfBlock),0, new ModelResourceLocation(ShelvesMod.MODID+":"+ "shelfBlock", "inventory"));
      		
    //	  	    ClientRegistry.bindTileEntitySpecialRenderer(ShelfTitleEntity.class, new TileEntitySpecialRendererShelf());
      	}
      	
      	//recipes
      	GameRegistry.addRecipe(new ItemStack(shelfBlock), new Object[]{
      	"   ",
      	"  A",
      	" AA",
      	'A', Items.stick //getItemFromBlock(Blocks.planks)
      	});
      }
        @EventHandler
        public void postInit(FMLPostInitializationEvent event) 
        {
        	System.out.println("Called method: postInit");
        }
    }
    

     

    package com.rosecotton.shelvesmod;
    
    //import BlockStairs;
    
    import java.util.Iterator;
    import java.util.Random;
    
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockContainer;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.properties.IProperty;
    import net.minecraft.block.properties.PropertyDirection;
    import net.minecraft.block.properties.PropertyEnum;
    import net.minecraft.block.state.BlockState;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.client.resources.model.ModelResourceLocation;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.passive.EntityOcelot;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.inventory.InventoryHelper;
    import net.minecraft.inventory.InventoryLargeChest;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.tileentity.TileEntityChest;
    import net.minecraft.util.AxisAlignedBB;
    import net.minecraft.util.BlockPos;
    import net.minecraft.util.EnumFacing;
    import net.minecraft.util.IStringSerializable;
    import net.minecraft.util.MathHelper;
    import net.minecraft.world.IBlockAccess;
    import net.minecraft.world.ILockableContainer;
    import net.minecraft.world.World;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    
    
    public class BlockShelf extends BlockContainer {
    
        public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
        public static final PropertyEnum SECTION = PropertyEnum.create("section", BlockShelf.EnumShape.class);
        
        private final Random rand = new Random();
       // private static final String __OBFID = "CL_00000214";
    private final String name = "shelfBlock";
    ModelResourceLocation modelresourcelocation = new ModelResourceLocation("shelvesmod"+":"+name, "inventory");
        
        protected BlockShelf(int type)
        {
            super(Material.wood);
            //TEH FOLLOWIONG LINE MIGHT HAVE BEEN USEFUL BUT MAYBE CAUSED AN ERROR AT RUNTIME, TRY AGAIN
            this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
            //this.chestType = type;
            this.setCreativeTab(CreativeTabs.tabMisc);
            this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
            this.useNeighborBrightness = true;
    	this.setDefaultState(this.blockState.getBaseState());
            GameRegistry.registerBlock(this, name);
        	this.setUnlocalizedName(ShelvesMod.MODID + "_" + name);
        	this.setBlockBounds(1/16.0F, 0, 1/16.0F, 15/16.0F, 8/16.0F, 15/16.0F);
        }
    
        public String toString()
        {
            return this.name;
        }
        public String getName()
        {
            return this.name;
        }
    
        // used by the renderer to control lighting and visibility of other blocks.
        // set to false because this block doesn't fill the entire 1x1x1 space
        @Override
        public boolean isOpaqueCube() {
          return false;
        }
    
        // used by the renderer to control lighting and visibility of other blocks, also by
        // (eg) wall or fence to control whether the fence joins itself to this block
        // set to false because this block doesn't fill the entire 1x1x1 space
        @Override
        public boolean isFullCube() {
          return false;
        }
        
        // this function returns the correct item type corresponding to the colour of our block;
        // i.e. when a sign is broken, it will drop the correct item.
        @Override
        public int damageDropped(IBlockState state)
        {
          //EnumColour enumColour = (EnumColour)state.getValue(PROPERTYCOLOUR);
          //return this.getMetadata();//enumColour.getMetadata();
        	return 0;
        }
        
    
        
        
        public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
        {
            if (worldIn.getBlockState(pos.north()).getBlock() == this)
            {
                this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F);
            }
            else if (worldIn.getBlockState(pos.south()).getBlock() == this)
            {
                this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F);
            }
            else if (worldIn.getBlockState(pos.west()).getBlock() == this)
            {
                this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
            }
            else if (worldIn.getBlockState(pos.east()).getBlock() == this)
            {
                this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F);
            }
            else
            {
                this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
            }
        }
    
        public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
        {
            //this.checkForSurroundingChests(worldIn, pos, state);
            Iterator iterator = EnumFacing.Plane.HORIZONTAL.iterator();
    
            while (iterator.hasNext())
            {
                EnumFacing enumfacing = (EnumFacing)iterator.next();
                BlockPos blockpos1 = pos.offset(enumfacing);
                IBlockState iblockstate1 = worldIn.getBlockState(blockpos1);
    
            }
        }
    @Override
        public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase player)
        {
            return this.getDefaultState().withProperty(FACING, player.getHorizontalFacing());
        }
    
        public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
        {
            EnumFacing enumfacing = EnumFacing.getHorizontal(MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3).getOpposite();
            state = state.withProperty(FACING, enumfacing);
            BlockPos blockpos1 = pos.north();
            BlockPos blockpos2 = pos.south();
            BlockPos blockpos3 = pos.west();
            BlockPos blockpos4 = pos.east();
            boolean flag = this == worldIn.getBlockState(blockpos1).getBlock();
            boolean flag1 = this == worldIn.getBlockState(blockpos2).getBlock();
            boolean flag2 = this == worldIn.getBlockState(blockpos3).getBlock();
            boolean flag3 = this == worldIn.getBlockState(blockpos4).getBlock();
    
            if (!flag && !flag1 && !flag2 && !flag3)
            {
                worldIn.setBlockState(pos, state, 3);
            }
            else if (enumfacing.getAxis() == EnumFacing.Axis.X && (flag || flag1))
            {
                if (flag)
                {
                    worldIn.setBlockState(blockpos1, state, 3);
                }
                else
                {
                    worldIn.setBlockState(blockpos2, state, 3);
                }
    
                worldIn.setBlockState(pos, state, 3);
            }
            else if (enumfacing.getAxis() == EnumFacing.Axis.Z && (flag2 || flag3))
            {
                if (flag2)
                {
                    worldIn.setBlockState(blockpos3, state, 3);
                }
                else
                {
                    worldIn.setBlockState(blockpos4, state, 3);
                }
    
                worldIn.setBlockState(pos, state, 3);
            }
    
            if (stack.hasDisplayName())
            {
                TileEntity tileentity = worldIn.getTileEntity(pos);
    
                if (tileentity instanceof TileEntityChest)
                {
                    ((TileEntityChest)tileentity).setCustomName(stack.getDisplayName());
                }
            }
        }
        
        public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state)
        {
            EnumFacing enumfacing = null;
            Iterator iterator = EnumFacing.Plane.HORIZONTAL.iterator();
    
            while (iterator.hasNext())
            {
                EnumFacing enumfacing1 = (EnumFacing)iterator.next();
                IBlockState iblockstate1 = worldIn.getBlockState(pos.offset(enumfacing1));
    
                if (iblockstate1.getBlock() == this)
                {
                    return state;
                }
    
                if (iblockstate1.getBlock().isFullBlock())
                {
                    if (enumfacing != null)
                    {
                        enumfacing = null;
                        break;
                    }
    
                    enumfacing = enumfacing1;
                }
            }
    
            if (enumfacing != null)
            {
                return state.withProperty(FACING, enumfacing.getOpposite());
            }
            else
            {
                EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING);
    
                if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
                {
                    enumfacing2 = enumfacing2.getOpposite();
                }
    
                if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
                {
                    enumfacing2 = enumfacing2.rotateY();
                }
    
                if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
                {
                    enumfacing2 = enumfacing2.getOpposite();
                }
    
                return state.withProperty(FACING, enumfacing2);
            }
        }
    
    
    
    
    
        public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
        {
            TileEntity tileentity = worldIn.getTileEntity(pos);
    
            if (tileentity instanceof IInventory)
            {
                InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity);
                worldIn.updateComparatorOutputLevel(pos, this);
            }
    
            super.breakBlock(worldIn, pos, state);
        }
        
    
    // Called when the block is right clicked
    // In this block it is used to open the blocks gui when right clicked by a player
    @Override
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {
    	// Uses the gui handler registered to your mod to open the gui for the given gui id
    	// open on the server side only  (not sure why you shouldn't open client side too... vanilla doesn't, so we better not either)
    	if (worldIn.isRemote) return true;
    
    	playerIn.openGui(ShelvesMod.instance, GuiHandlerShelf.getGuiID(), worldIn, pos.getX(), pos.getY(), pos.getZ());
       	System.out.println("Called method: BlockShelf.onBlockActivated");
    	return true;
    }
    
    @Override
       public TileEntity createNewTileEntity(World worldIn, int meta)
        {
            return new ShelfTitleEntity();
        }
    
    
    
        private boolean isBlocked(World worldIn, BlockPos pos)
        {
            return this.isBelowSolidBlock(worldIn, pos) || this.isOcelotSittingOnChest(worldIn, pos);
        }
    
        private boolean isBelowSolidBlock(World worldIn, BlockPos pos)
        {
            return worldIn.getBlockState(pos.up()).getBlock().isNormalCube();
        }
    
    
    
    
        private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos)
        {
            Iterator iterator = worldIn.getEntitiesWithinAABB(EntityOcelot.class, new AxisAlignedBB((double)pos.getX(), (double)(pos.getY() + 1), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 2), (double)(pos.getZ() + 1))).iterator();
            EntityOcelot entityocelot;
    
            do
            {
                if (!iterator.hasNext())
                {
                    return false;
                }
    
                Entity entity = (Entity)iterator.next();
                entityocelot = (EntityOcelot)entity;
            }
            while (!entityocelot.isSitting());
    
            return true;
        }
    
        public boolean hasComparatorInputOverride()
        {
            return true;
        }
    
        @Override
        public IBlockState getStateFromMeta(int meta)
        {
            EnumFacing enumfacing = EnumFacing.getFront(meta);
    
            if (enumfacing.getAxis() == EnumFacing.Axis.Y)
            {
                enumfacing = EnumFacing.NORTH;
            }
    
            return this.getDefaultState().withProperty(FACING, enumfacing);
        }
    
        @Override
        public int getMetaFromState(IBlockState state)
        {
          EnumFacing facing = (EnumFacing)state.getValue(FACING);
    
          int facingbits = facing.getHorizontalIndex();
          return facingbits;// | colourbits;
        }
    
        // necessary to define which properties your blocks use
        // will also affect the variants listed in the blockstates model file
        @Override
        protected BlockState createBlockState()
        {
            return new BlockState(this, new IProperty[] {FACING,SECTION});
        }
    
        
        @Override
        public Item getItemDropped(IBlockState state, Random rand, int fortune)
        {
            return Item.getItemFromBlock(this);
        }
        public static enum EnumShape implements IStringSerializable
        {
            TOP("top"),
            MIDDLE("middle"),
            BOTTOM("bottom");
    
            private final String name;
    
            private static final String __OBFID = "CL_00003061";
    
            private EnumShape(String name)
            {
                this.name = name;
            }
    
            public String toString()
            {
                return this.name;
            }
    
            public String getName()
            {
                return this.name;
            }
    
        }
        public TileEntity createTileEntity(World world, int metadata)
        {
           return new ShelfTitleEntity();
        }
        
        @Override
        public int getRenderType()
        {
            return 3;
        }
        
    }
    

     

    package com.rosecotton.shelvesmod;
    
    import com.rosecotton.shelvesmod.ShelvesMod;
    
    public class ShelvesEventHandler {
    }
    

     

    package com.rosecotton.shelvesmod;
    import java.util.Arrays;
    
    import net.minecraft.block.BlockChest;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.network.Packet;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.util.ChatComponentText;
    import net.minecraft.util.ChatComponentTranslation;
    import net.minecraft.util.IChatComponent;
    import net.minecraft.world.World;
    import net.minecraft.nbt.NBTTagList;
    
    public class ShelfTitleEntity extends TileEntity implements IInventory {
    final static int NUMBER_OF_SLOTS = 4;
        public int numPlayersUsing;
    public static ItemStack[] itemStacks = new ItemStack[NUMBER_OF_SLOTS];
    //public EntityItem itemEnt[] = null;
    
    
    
    // will add a key for this container to the lang file so we can name it in the GUI
    @Override
    public String getName() {
    	return "Block Shelf";
    }
    
    @Override
    public boolean hasCustomName() {
    	return false;
    }
    
    // standard code to look up what the human-readable name is
    @Override
    public IChatComponent getDisplayName() {
    	return this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName());
    }
    
    @Override
    public int getSizeInventory() {
    	return itemStacks.length;
    }
    
    
    @Override
    public ItemStack getStackInSlot(int slotIndex) {
    	return itemStacks[slotIndex];
    	}
    
    @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;
    }
    
    // -----------------------------------------------------------------------------------------------------------
    // The following method is not needed for this example but are part of IInventory so must be implemented
    /**
     * This method removes the entire contents of the given slot and returns it.
     * Used by containers such as crafting tables which return any items in their slots when you close the GUI
     * @param slotIndex
     * @return
     */
    @Override
    public ItemStack getStackInSlotOnClosing(int slotIndex) {
    	ItemStack itemStack = getStackInSlot(slotIndex);
    	if (itemStack != null) setInventorySlotContents(slotIndex, null);
    	return itemStack;
    }
    
    // overwrites the stack in the given slotIndex with the given stack
    @Override
    public void setInventorySlotContents(int slotIndex, ItemStack itemstack) {
    	itemStacks[slotIndex] = itemstack;
    	if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) {
    		itemstack.stackSize = getInventoryStackLimit();
    	}
    	//RenderShelfTileEntity renderShelfTileEntity = new RenderShelfTileEntity(this);
    	markDirty();
    }
    
    // This is the maximum number if items allowed in each slot
    // This only affects things such as hoppers trying to insert items you need to use the container to enforce this for players
    // inserting items via the gui
    @Override
    public int getInventoryStackLimit() {
    	return 64;
    }
    
    // Return true if the given player is able to use this block. In this case it checks that
    // 1) the world tileentity hasn't been replaced in the meantime, and
    // 2) the player isn't too far away from the centre of the block
    @Override
    public boolean isUseableByPlayer(EntityPlayer player) {
    	if (this.worldObj.getTileEntity(this.pos) != this) return false;
    	final double X_CENTRE_OFFSET = 0.5;
    	final double Y_CENTRE_OFFSET = 0.5;
    	final double Z_CENTRE_OFFSET = 0.5;
    	final double MAXIMUM_DISTANCE_SQ = 8.0 * 8.0;
    	return player.getDistanceSq(pos.getX() + X_CENTRE_OFFSET, pos.getY() + Y_CENTRE_OFFSET, pos.getZ() + Z_CENTRE_OFFSET) < MAXIMUM_DISTANCE_SQ;
    }
    
    //-----------------------------------------------------------------------------------------------------------
    //The following method is not needed for this example but are part of IInventory so must be implemented
    @Override
    public void openInventory(EntityPlayer player) {
        if (!player.isSpectator())
        {
            if (this.numPlayersUsing < 0)
            {
                this.numPlayersUsing = 0;
            }
    
            ++this.numPlayersUsing;
            this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing);
            this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType());
            this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType());
        	System.out.println("Called method: ShelfTitleEntity.openInventory");
        }
    }
    
    //-----------------------------------------------------------------------------------------------------------
    //The following method is not needed for this example but are part of IInventory so must be implemented
    @Override
    public void closeInventory(EntityPlayer player) {
        if (!player.isSpectator() && this.getBlockType() instanceof BlockChest)
        {
            --this.numPlayersUsing;
            this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing);
            this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType());
            this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType());
        }
    }
    
    // Return true if the given stack is allowed to go in the given slot.  In this case, we can insert anything.
    // This only affects things such as hoppers trying to insert items you need to use the container to enforce this for players
    // inserting items via the gui
    @Override
    public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) {
    	return true;
    }
    
    
    // This is where you save any data that you don't want to lose when the tile entity unloads
    // In this case, it saves the itemstacks stored in the container
    @Override
    public void writeToNBT(NBTTagCompound parentNBTTagCompound)
    {
    	super.writeToNBT(parentNBTTagCompound); // The super call is required to save and load the tileEntity's location
    
    	// to use an analogy with Java, this code generates an array of hashmaps
    	// The itemStack in each slot is converted to an NBTTagCompound, which is effectively a hashmap of key->value pairs such
    	//   as slot=1, id=2353, count=1, etc
    	// Each of these NBTTagCompound are then inserted into NBTTagList, which is similar to an array.
    	NBTTagList dataForAllSlots = new NBTTagList();
    	for (int i = 0; i < this.itemStacks.length; ++i) {
    		if (this.itemStacks[i] != null)	{
    			NBTTagCompound dataForThisSlot = new NBTTagCompound();
    			dataForThisSlot.setByte("Slot", (byte) i);
    			this.itemStacks[i].writeToNBT(dataForThisSlot);
    			dataForAllSlots.appendTag(dataForThisSlot);
    		}
    	}
    	// the array of hashmaps is then inserted into the parent hashmap for the container
    	parentNBTTagCompound.setTag("Items", dataForAllSlots);
    }
    
    // This is where you load the data that you saved in writeToNBT
    @Override
    public void readFromNBT(NBTTagCompound parentNBTTagCompound)
    {
    	super.readFromNBT(parentNBTTagCompound); // The super call is required to save and load the tiles location
    
    	final byte NBT_TYPE_COMPOUND = 10;       // See NBTBase.createNewByType() for a listing
    	NBTTagList dataForAllSlots = parentNBTTagCompound.getTagList("Items", NBT_TYPE_COMPOUND);
    
    	Arrays.fill(itemStacks, null);           // set all slots to empty
    	for (int i = 0; i < dataForAllSlots.tagCount(); ++i) {
    		NBTTagCompound dataForOneSlot = dataForAllSlots.getCompoundTagAt(i);
    		int slotIndex = dataForOneSlot.getByte("Slot") & 255;
    
    		if (slotIndex >= 0 && slotIndex < this.itemStacks.length) {
    			this.itemStacks[slotIndex] = ItemStack.loadItemStackFromNBT(dataForOneSlot);
    		}
    	}
    }
    
    public boolean receiveClientEvent(int id, int type)
    {
        if (id == 1)
        {
            this.numPlayersUsing = type;
            return true;
        }
        else
        {
            return super.receiveClientEvent(id, type);
        }
    }
    
    @Override
    public int getField(int id) {
    	return Item.getIdFromItem(itemStacks[id].getItem());
    }
    
    @Override
    public void setField(int id, int value) {
    	itemStacks[id].setItem(Item.getItemById(value));
    }
    
    @Override
    public int getFieldCount() {
    	return itemStacks.length;
    }
    
    // set all slots to empty
    @Override
    public void clear() {
    	Arrays.fill(itemStacks, null);
    }
    }
    

     

    package com.rosecotton.shelvesmod;
    
    
    
    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;
    
    /**
    * User: brandon3055
    * Date: 06/01/2015
    *
    * The container is used to link the client side gui to the server side inventory and it is where
    * you add the slots to your gui. It can also be used to sync server side data with the client but
    * that will be covered in a later tutorial
    */
    public class ContainerShelf extends Container {
    
    // Stores a reference to the tile entity instance for later use
    private ShelfTitleEntity ShelfTitleEntity;
    
    // must assign a slot number to each of the slots used by the GUI.
    // For this container, we can see both the tile inventory's slots as well as the player inventory slots and the hotbar.
    // Each time we add a Slot to the container, it automatically increases the slotIndex, which means
    //  0 - 8 = hotbar slots (which will map to the InventoryPlayer slot numbers 0 - 
    //  9 - 35 = player inventory slots (which map to the InventoryPlayer slot numbers 9 - 35)
    //  36 - 39 = TileInventory slots, which map to our TileEntity slot numbers 0 - 3)
    
    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 = 4;
    
    public ContainerShelf(InventoryPlayer invPlayer, ShelfTitleEntity ShelfTitleEntity) {
    	this.ShelfTitleEntity = ShelfTitleEntity;
    
    	final int SLOT_X_SPACING = 18;
    	final int SLOT_Y_SPACING = 18;
    	final int HOTBAR_XPOS = 8;
    	final int HOTBAR_YPOS = 109;
    	// Add the players hotbar to the gui - the [xpos, ypos] location of each item
    	for (int x = 0; x < HOTBAR_SLOT_COUNT; x++) {
    		int slotNumber = x;
    		addSlotToContainer(new Slot(invPlayer, slotNumber, HOTBAR_XPOS + SLOT_X_SPACING * x, HOTBAR_YPOS));
    	}
    
    	final int PLAYER_INVENTORY_XPOS = 8;
    	final int PLAYER_INVENTORY_YPOS = 51;
    	// Add the rest of the players inventory to the gui
    	for (int y = 0; y < PLAYER_INVENTORY_ROW_COUNT; y++) {
    		for (int x = 0; x < PLAYER_INVENTORY_COLUMN_COUNT; x++) {
    			int slotNumber = HOTBAR_SLOT_COUNT + y * PLAYER_INVENTORY_COLUMN_COUNT + x;
    			int xpos = PLAYER_INVENTORY_XPOS + x * SLOT_X_SPACING;
    			int ypos = PLAYER_INVENTORY_YPOS + y * SLOT_Y_SPACING;
    			addSlotToContainer(new Slot(invPlayer, slotNumber,  xpos, ypos));
    		}
    	}
    
    	if (TE_INVENTORY_SLOT_COUNT != ShelfTitleEntity.getSizeInventory()) {
    		System.err.println("Mismatched slot count in ContainerShelf(" + TE_INVENTORY_SLOT_COUNT
    											  + ") and TileInventory (" + ShelfTitleEntity.getSizeInventory()+")");
    	}
    	final int TILE_INVENTORY_XPOS = 8;
    	final int TILE_INVENTORY_YPOS = 20;
    	// Add the tile inventory container to the gui
    	for (int x = 0; x < TE_INVENTORY_SLOT_COUNT; x++) {
    		int slotNumber = x;
    		addSlotToContainer(new Slot(ShelfTitleEntity, slotNumber, TILE_INVENTORY_XPOS + SLOT_X_SPACING * x, TILE_INVENTORY_YPOS));
    	}
    }
    
    // Vanilla calls this method every tick to make sure the player is still able to access the inventory, and if not closes the gui
    @Override
    public boolean canInteractWith(EntityPlayer player)
    {
    	return ShelfTitleEntity.isUseableByPlayer(player);
    }
    
    // This is where you specify what happens when a player shift clicks a slot in the gui
    //  (when you shift click a slot in the TileEntity Inventory, it moves it to the first available position in the hotbar and/or
    //    player inventory.  When you you shift-click a hotbar or player inventory item, it moves it to the first available
    //    position in the TileEntity inventory)
    // At the very least you must override this and return null or the game will crash when the player shift clicks a slot
    // returns null if the source slot is empty, or if none of the the source slot items could be moved
    //   otherwise, returns a copy of the source stack
    @Override
    public ItemStack transferStackInSlot(EntityPlayer player, int sourceSlotIndex)
    {
    	Slot sourceSlot = (Slot)inventorySlots.get(sourceSlotIndex);
    	if (sourceSlot == null || !sourceSlot.getHasStack()) return null;
    	ItemStack sourceStack = sourceSlot.getStack();
    	ItemStack copyOfSourceStack = sourceStack.copy();
    
    	// Check if the slot clicked is one of the vanilla container slots
    	if (sourceSlotIndex >= VANILLA_FIRST_SLOT_INDEX && sourceSlotIndex < VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT) {
    		// This is a vanilla container slot so merge the stack into 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(player, sourceStack);
    	return copyOfSourceStack;
    }
    
    // pass the close container message to the tileEntityInventory (not strictly needed for this example)
    //  see ContainerChest and TileEntityChest
    @Override
    public void onContainerClosed(EntityPlayer playerIn)
    {
    	super.onContainerClosed(playerIn);
    	this.ShelfTitleEntity.closeInventory(playerIn);
    }
    }
    

     

    package com.rosecotton.shelvesmod;
    
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.world.World;
    import net.minecraftforge.fml.common.network.IGuiHandler;
    
    import java.util.HashMap;
    
    /**
    * User: brandon3055
    * Date: 06/01/2015
    *
    * This class is used to create the client and server gui elements when a player opens a gui. There can only be one gui handler registered per mod,
    *   so each GUI is given a unique GuiID which is used to create the correct element.
    * The GuiHandlerRegistry is registered with Forge using
    * 		NetworkRegistry.INSTANCE.registerGuiHandler(ReferenceMod.instance, new GuiHandlerRegistry());
    * Each of the examples, with its own GuiHandler, registers itself with the GuiHandlerRegistry.
    * When GuiHandlerRegistry receives a call from Forge, it passes it to the appropriate example's GuiHandler.
    */
    public class GuiHandlerRegistry implements IGuiHandler {
    
    public void registerGuiHandler(IGuiHandler hander, int guiID)
    {
    	registeredHandlers.put(guiID, hander);
    }
    
    public static GuiHandlerRegistry getInstance() {return guiHandlerRegistry;}
    
    private HashMap<Integer, IGuiHandler> registeredHandlers = new HashMap<Integer, IGuiHandler>();
    private static GuiHandlerRegistry guiHandlerRegistry = new GuiHandlerRegistry();
    
    // Gets the server side element for the given gui id- this should return a container
    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    	IGuiHandler handler = registeredHandlers.get(ID);
    	if (handler != null) {
    		return handler.getServerGuiElement(ID, player, world, x, y, z);
    	} else {
    		return null;
    	}
    }
    
    // Gets the client side element for the given gui id- this should return a gui
    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    	IGuiHandler handler = registeredHandlers.get(ID);
    	if (handler != null) {
    		return handler.getClientGuiElement(ID, player, world, x, y, z);
    	} else {
    		return null;
    	}
    }
    
    }
    

     

    package com.rosecotton.shelvesmod;
    
    
    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;
    
    /**
    * User: brandon3055
    * Date: 06/01/2015
    *
    * This class is used to get the client and server gui elements when a player opens a gui. There can only be one registered
    *   IGuiHandler instance handler per mod.
    */
    public class GuiHandlerShelf implements IGuiHandler {
    private static final int GUIID_SHELF = 30;
    public static int getGuiID() {    	System.out.println("Called method: GuiHandlerShelf.getGuiID"); return GUIID_SHELF;}
    
    
    // Gets the server side element for the given gui id- this should return a container
    @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 ShelfTitleEntity) {
    		ShelfTitleEntity ShelfTitleEntity = (ShelfTitleEntity) tileEntity;
    	   	System.out.println("Called method: GuiHandlerShelf.getServerGuiElement return good stuff");
    		return new ContainerShelf(player.inventory, ShelfTitleEntity);
    	}
        	System.out.println("Called method: GuiHandlerShelf.getServerGuiElement return null");
    	return null;
    } 
    
    // Gets the client side element for the given gui id- this should return a gui
    @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 ShelfTitleEntity) {
    		ShelfTitleEntity ShelfTitleEntity = (ShelfTitleEntity) tileEntity;
        	System.out.println("Called method: GuiHandlerShelf.getClientGuiElement return good stuff");
    		return new GuiInventoryShelf(player.inventory, ShelfTitleEntity);
    	}
        	System.out.println("Called method: GuiHandlerShelf.getClientGuiElement return null");
        	return null;
    
    }
    }
    

     

    package com.rosecotton.shelvesmod;
    
    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 net.minecraftforge.fml.relauncher.Side;
    import net.minecraftforge.fml.relauncher.SideOnly;
    
    import java.awt.*;
    
    /**
    * User: brandon3055
    * Date: 06/01/2015
    *
    * GuiInventoryShelf is a simple gui that does nothing but draw a background image and a line of text on the screen
    * everything else is handled by the vanilla container code
    */
    @SideOnly(Side.CLIENT)
    public class GuiInventoryShelf extends GuiContainer {
    
    // This is the resource location for the background image for the GUI
    private static final ResourceLocation texture = new ResourceLocation("shelvesmod", "textures/gui/shelf_inventory_bg.png");
    private ShelfTitleEntity shelfTitleEntity;
    
    public GuiInventoryShelf(InventoryPlayer invPlayer, ShelfTitleEntity tile) {
    	super(new ContainerShelf(invPlayer, tile));
    	shelfTitleEntity = tile;
    	// Set the width and height of the gui.  Should match the size of the texture!
    	xSize = 176;
    	ySize = 133;
    }
    
    // draw the background for the GUI - rendered first
    @Override
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int x, int y) {
    	// Bind the image texture of our custom container
    	Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
    	// Draw the image
    	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    	drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
    }
    
    // draw the foreground for the GUI - rendered after the slots, but before the dragged items and tooltips
    // renders relative to the top left corner of the background
    @Override
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
    	final int LABEL_XPOS = 5;
    	final int LABEL_YPOS = 5;
    	fontRendererObj.drawString(shelfTitleEntity.getDisplayName().getUnformattedText(), LABEL_XPOS, LABEL_YPOS, Color.darkGray.getRGB());
    }
    }
    

  8. hmmm...ok, I was hoping to get away from using that because it always led me down this trail of classes and methods until I got to arguments I couldn't figure out how to use, like RenderManager.

     

    So to render an Item (any) that represents an ItemStack (any) held in a slot in the TileEntity (for me, ShelfTitleEntity because I misspelled it) of a Block (mine is BlockShelf), I need to use ShelfRenderer.renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int i) which extends TileEntitySpecialRenderer.

    The example I found creates a model, so ModelShelf shelf = new ModelShelf() (which extends model base), and that has a render method, shelf.render(TileEntity te, double x, double y, double z) that's called in renderTileEntityAt.

     

    So where do I create a ShelfRenderer object and call its renderTileEntityAt method? 

    Do I do that when I close the GUI for the BlockShelf (i.e. after putting objects in or taking them out)?

  9. UPDATE:

    I just stopped my mod from crashing when there's a null slot on my shelfblock (i.e. trying to render an empty item) by checking to make sure it's not null before doing the render.

     

    however, it still doesn't render my items and when I remove them from my ShelfBlock storage slots, they disappear.  I must have broken something and not gotten the rendering right. 

     

    package com.rosecotton.shelvesmod;
    
    import net.minecraft.client.renderer.entity.RenderEntityItem;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.tileentity.TileEntity;
    
    public class RenderShelfTileEntity 
    {
    public RenderShelfTileEntity(ShelfTitleEntity shelfTileEntity)
    {
    	RenderEntityItem renderEntityItem = new RenderEntityItem(null, null);
    	double x = ((TileEntity)shelfTileEntity).getPos().getX();
    	double y = ((TileEntity)shelfTileEntity).getPos().getY();
    	double z = ((TileEntity)shelfTileEntity).getPos().getZ();
    	EntityItem shelfEntityItem[] = new EntityItem[4];
    	for (int n = 0; n <4; n++)
    	{
    		if (shelfEntityItem[n] != null)
    		{
    			shelfEntityItem[n].setEntityItemStack(shelfTileEntity.itemStacks[n]);
    			double xPlus = x + (double)((4+(n%2)*8)/16);
    			double yPlus = y + (double)((2+(n/2)*6)/16);
    			double zPlus = z + (double)((13-(n/2)*8)/16);
    
    			renderEntityItem.func_177075_a(shelfEntityItem[n], xPlus, yPlus, zPlus, 0.0625f, 1.05f);
    		}
    
    
    	}
    
    }
    }
    

  10. I just stopped my mod from crashing when there's a null slot on my shelfblock (i.e. trying to render an empty item) by checking to make sure it's not null before doing the render.

     

    however, it still doesn't render my items and when I remove them from my ShelfBlock storage slots, they disappear.  I must have broken something and not gotten the rendering right. 

  11. to insert code, type the following without the : 
    
    [co:de]
    your code here
    

     

    [spoi:ler]

    your console data here

    [/spoi:ler]

     

    it's bbcode, there are reference websites around.

     

    p.s. I am having crashes while trying to render items on blocks in 1.8, too.  It's hard.

  12. UPDATE:

    trying to update inventory in my shelf, which is where I call my EntityItem renderer code, definitely causes mc to crash.

     

     

     

    [11:05:06] [main/INFO] [GradleStart]: Extra: []

    [11:05:06] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Becky/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken, {REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker]

    [11:05:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

    [11:05:06] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

    [11:05:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

    [11:05:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

    [11:05:06] [main/INFO] [FML]: Forge Mod Loader version 8.0.20.1023 for Minecraft 1.8 loading

    [11:05:06] [main/INFO] [FML]: Java is Java HotSpot Client VM, version 1.8.0_31, running on Windows 7:x86:6.1, installed at C:\Program Files\Java\jre1.8.0_31

    [11:05:06] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

    [11:05:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

    [11:05:06] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

    [11:05:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

    [11:05:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

    [11:05:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

    [11:05:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

    [11:05:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

    [11:05:06] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

    [11:05:08] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

    [11:05:08] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

    [11:05:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

    [11:05:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

    [11:05:09] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

    [11:05:10] [Client thread/INFO]: Setting user: Player680

    [11:05:10] [Client thread/INFO]: (Session ID is token:FML:Player680)

    [11:05:14] [Client thread/INFO]: LWJGL Version: 2.9.1

    [11:05:15] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

    [11:05:15] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

    [11:05:15] [Client thread/INFO] [FML]: Searching C:\Users\Becky\Desktop\Forge ModLoader-1.8-8.0.20.1023-1.8-src\eclipse\mods for mods

    [11:05:20] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load

    [11:05:20] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, testmod01, oredetectmod, shelvesmod] at CLIENT

    [11:05:20] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, testmod01, oredetectmod, shelvesmod] at SERVER

    [11:05:20] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Test Mod 01, FMLFileResourcePack:Ore Detect Mod, FMLFileResourcePack:Shelves Mod

    [11:05:21] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

    [11:05:21] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations

    [11:05:21] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getGuiID:19]: Called method: GuiHandlerShelf.getGuiID

    [11:05:21] [Client thread/INFO] [FML]: Applying holder lookups

    [11:05:21] [Client thread/INFO] [FML]: Holder lookups applied

    [11:05:22] [sound Library Loader/INFO]: Starting up SoundSystem...

    [11:05:22] [Thread-7/INFO]: Initializing LWJGL OpenAL

    [11:05:22] [Thread-7/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

    [11:05:23] [Thread-7/INFO]: OpenAL initialized.

    [11:05:23] [sound Library Loader/INFO]: Sound engine started

    [11:05:37] [Client thread/INFO]: Created: 512x512 textures-atlas

    [11:05:38] [Client thread/INFO] [sTDOUT]: [com.becky.testmod01.Testmod01:postInit:142]: Called method: postInit

    [11:05:38] [Client thread/INFO] [sTDOUT]: [com.rosecotton.oredetect.OreDetectMod:postInit:120]: Called method: postInit

    [11:05:38] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.ShelvesMod:postInit:99]: Called method: postInit

    [11:05:38] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods

    [11:05:38] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Test Mod 01, FMLFileResourcePack:Ore Detect Mod, FMLFileResourcePack:Shelves Mod

    [11:05:38] [Client thread/INFO]: SoundSystem shutting down...

    [11:05:39] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

    [11:05:39] [sound Library Loader/INFO]: Starting up SoundSystem...

    [11:05:39] [Thread-9/INFO]: Initializing LWJGL OpenAL

    [11:05:39] [Thread-9/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

    [11:05:40] [Thread-9/INFO]: OpenAL initialized.

    [11:05:40] [sound Library Loader/INFO]: Sound engine started

    [11:05:41] [Client thread/INFO]: Created: 512x512 textures-atlas

    [11:06:03] [server thread/INFO]: Starting integrated minecraft server version 1.8

    [11:06:03] [server thread/INFO]: Generating keypair

    [11:06:03] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

    [11:06:03] [server thread/INFO] [FML]: Applying holder lookups

    [11:06:03] [server thread/INFO] [FML]: Holder lookups applied

    [11:06:03] [server thread/INFO]: Preparing start region for level 0

    [11:06:04] [server thread/INFO]: Preparing spawn area: 44%

    [11:06:06] [server thread/INFO]: Changing view distance to 8, from 10

    [11:06:06] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 1

    [11:06:06] [Netty Server IO #1/INFO] [FML]: Client protocol version 1

    [11:06:06] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : oredetectmod@1.0,FML@8.0.20.1023,shelvesmod@1.0,testmod01@1.0,mcp@9.05

    [11:06:06] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established

    [11:06:06] [server thread/INFO] [FML]: [server thread] Server side modded connection established

    [11:06:06] [server thread/INFO]: Player680[local:E:bc663994] logged in with entity id 312 at (-231.85697573168673, 77.0, 61.09418574985075)

    [11:06:07] [server thread/INFO]: Player680 joined the game

    [11:06:09] [server thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getGuiID:19]: Called method: GuiHandlerShelf.getGuiID

    [11:06:09] [server thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getGuiID:19]: Called method: GuiHandlerShelf.getGuiID

    [11:06:09] [server thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getServerGuiElement:33]: Called method: GuiHandlerShelf.getServerGuiElement return good stuff

    [11:06:09] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getGuiID:19]: Called method: GuiHandlerShelf.getGuiID

    [11:06:09] [Client thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.GuiHandlerShelf:getClientGuiElement:51]: Called method: GuiHandlerShelf.getClientGuiElement return good stuff

    [11:06:09] [server thread/INFO] [sTDOUT]: [com.rosecotton.shelvesmod.BlockShelf:onBlockActivated:283]: Called method: BlockShelf.onBlockActivated

    [11:06:09] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.NullPointerException

    java.util.concurrent.ExecutionException: java.lang.NullPointerException

    at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:677) [FMLCommonHandler.class:?]

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1006) [Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:346) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?]

    at GradleStart.main(GradleStart.java:45) [start/:?]

    Caused by: java.lang.NullPointerException

    at com.rosecotton.shelvesmod.RenderShelfTileEntity.<init>(RenderShelfTileEntity.java:18) ~[RenderShelfTileEntity.class:?]

    at com.rosecotton.shelvesmod.ShelfTitleEntity.setInventorySlotContents(ShelfTitleEntity.java:135) ~[shelfTitleEntity.class:?]

    at net.minecraft.inventory.Slot.putStack(Slot.java:67) ~[slot.class:?]

    at net.minecraft.inventory.Container.putStacksInSlots(Container.java:527) ~[Container.class:?]

    at net.minecraft.client.network.NetHandlerPlayClient.handleWindowItems(NetHandlerPlayClient.java:1079) ~[NetHandlerPlayClient.class:?]

    at net.minecraft.network.play.server.S30PacketWindowItems.func_180732_a(S30PacketWindowItems.java:61) ~[s30PacketWindowItems.class:?]

    at net.minecraft.network.play.server.S30PacketWindowItems.processPacket(S30PacketWindowItems.java:72) ~[s30PacketWindowItems.class:?]

    at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:18) ~[PacketThreadUtil$1.class:?]

    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:676) ~[FMLCommonHandler.class:?]

    ... 11 more

    [11:06:09] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.NullPointerException

    java.util.concurrent.ExecutionException: java.lang.NullPointerException

    at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:677) [FMLCommonHandler.class:?]

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1006) [Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:346) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?]

    at GradleStart.main(GradleStart.java:45) [start/:?]

    Caused by: java.lang.NullPointerException

    at com.rosecotton.shelvesmod.RenderShelfTileEntity.<init>(RenderShelfTileEntity.java:18) ~[RenderShelfTileEntity.class:?]

    at com.rosecotton.shelvesmod.ShelfTitleEntity.setInventorySlotContents(ShelfTitleEntity.java:135) ~[shelfTitleEntity.class:?]

    at net.minecraft.inventory.Slot.putStack(Slot.java:67) ~[slot.class:?]

    at net.minecraft.inventory.Container.putStackInSlot(Container.java:519) ~[Container.class:?]

    at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1042) ~[NetHandlerPlayClient.class:?]

    at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:30) ~[s2FPacketSetSlot.class:?]

    at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:55) ~[s2FPacketSetSlot.class:?]

    at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:18) ~[PacketThreadUtil$1.class:?]

    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:676) ~[FMLCommonHandler.class:?]

    ... 11 more

    [11:06:10] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.NullPointerException

    java.util.concurrent.ExecutionException: java.lang.NullPointerException

    at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:677) [FMLCommonHandler.class:?]

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1006) [Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:346) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?]

    at GradleStart.main(GradleStart.java:45) [start/:?]

    Caused by: java.lang.NullPointerException

    at com.rosecotton.shelvesmod.RenderShelfTileEntity.<init>(RenderShelfTileEntity.java:18) ~[RenderShelfTileEntity.class:?]

    at com.rosecotton.shelvesmod.ShelfTitleEntity.setInventorySlotContents(ShelfTitleEntity.java:135) ~[shelfTitleEntity.class:?]

    at net.minecraft.inventory.Slot.putStack(Slot.java:67) ~[slot.class:?]

    at net.minecraft.inventory.Container.putStackInSlot(Container.java:519) ~[Container.class:?]

    at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1042) ~[NetHandlerPlayClient.class:?]

    at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:30) ~[s2FPacketSetSlot.class:?]

    at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:55) ~[s2FPacketSetSlot.class:?]

    at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:18) ~[PacketThreadUtil$1.class:?]

    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:676) ~[FMLCommonHandler.class:?]

    ... 11 more

    [11:06:10] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.NullPointerException

    java.util.concurrent.ExecutionException: java.lang.NullPointerException

    at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:677) [FMLCommonHandler.class:?]

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1006) [Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:346) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?]

    at GradleStart.main(GradleStart.java:45) [start/:?]

    Caused by: java.lang.NullPointerException

    at com.rosecotton.shelvesmod.RenderShelfTileEntity.<init>(RenderShelfTileEntity.java:18) ~[RenderShelfTileEntity.class:?]

    at com.rosecotton.shelvesmod.ShelfTitleEntity.setInventorySlotContents(ShelfTitleEntity.java:135) ~[shelfTitleEntity.class:?]

    at net.minecraft.inventory.Slot.putStack(Slot.java:67) ~[slot.class:?]

    at net.minecraft.inventory.Container.putStackInSlot(Container.java:519) ~[Container.class:?]

    at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1042) ~[NetHandlerPlayClient.class:?]

    at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:30) ~[s2FPacketSetSlot.class:?]

    at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:55) ~[s2FPacketSetSlot.class:?]

    at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:18) ~[PacketThreadUtil$1.class:?]

    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:676) ~[FMLCommonHandler.class:?]

    ... 11 more

    [11:06:10] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.NullPointerException

    java.util.concurrent.ExecutionException: java.lang.NullPointerException

    at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:677) [FMLCommonHandler.class:?]

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1006) [Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:346) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?]

    at GradleStart.main(GradleStart.java:45) [start/:?]

    Caused by: java.lang.NullPointerException

    at com.rosecotton.shelvesmod.RenderShelfTileEntity.<init>(RenderShelfTileEntity.java:18) ~[RenderShelfTileEntity.class:?]

    at com.rosecotton.shelvesmod.ShelfTitleEntity.setInventorySlotContents(ShelfTitleEntity.java:135) ~[shelfTitleEntity.class:?]

    at net.minecraft.inventory.Slot.putStack(Slot.java:67) ~[slot.class:?]

    at net.minecraft.inventory.Container.putStackInSlot(Container.java:519) ~[Container.class:?]

    at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1042) ~[NetHandlerPlayClient.class:?]

    at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:30) ~[s2FPacketSetSlot.class:?]

    at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:55) ~[s2FPacketSetSlot.class:?]

    at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:18) ~[PacketThreadUtil$1.class:?]

    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31]

    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31]

    at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:676) ~[FMLCommonHandler.class:?]

    ... 11 more

    [11:06:16] [Client thread/FATAL]: Reported exception thrown!

    net.minecraft.util.ReportedException: Updating screen events

    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1667) ~[Minecraft.class:?]

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1016) ~[Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:346) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?]

    at GradleStart.main(GradleStart.java:45) [start/:?]

    Caused by: java.lang.NullPointerException

    at com.rosecotton.shelvesmod.RenderShelfTileEntity.<init>(RenderShelfTileEntity.java:18) ~[RenderShelfTileEntity.class:?]

    at com.rosecotton.shelvesmod.ShelfTitleEntity.setInventorySlotContents(ShelfTitleEntity.java:135) ~[shelfTitleEntity.class:?]

    at com.rosecotton.shelvesmod.ShelfTitleEntity.decrStackSize(ShelfTitleEntity.java:102) ~[shelfTitleEntity.class:?]

    at net.minecraft.inventory.Slot.decrStackSize(Slot.java:94) ~[slot.class:?]

    at net.minecraft.inventory.Container.slotClick(Container.java:320) ~[Container.class:?]

    at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:475) ~[PlayerControllerMP.class:?]

    at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:637) ~[GuiContainer.class:?]

    at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:387) ~[GuiContainer.class:?]

    at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:525) ~[GuiScreen.class:?]

    at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:497) ~[GuiScreen.class:?]

    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1653) ~[Minecraft.class:?]

    ... 11 more

    [11:06:16] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: ---- Minecraft Crash Report ----

    // Hey, that tickles! Hehehe!

     

    Time: 3/11/15 11:06 AM

    Description: Updating screen events

     

    java.lang.NullPointerException: Updating screen events

    at com.rosecotton.shelvesmod.RenderShelfTileEntity.<init>(RenderShelfTileEntity.java:18)

    at com.rosecotton.shelvesmod.ShelfTitleEntity.setInventorySlotContents(ShelfTitleEntity.java:135)

    at com.rosecotton.shelvesmod.ShelfTitleEntity.decrStackSize(ShelfTitleEntity.java:102)

    at net.minecraft.inventory.Slot.decrStackSize(Slot.java:94)

    at net.minecraft.inventory.Container.slotClick(Container.java:320)

    at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:475)

    at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:637)

    at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:387)

    at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:525)

    at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:497)

    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1653)

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1016)

    at net.minecraft.client.Minecraft.run(Minecraft.java:346)

    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(GradleStartCommon.java:85)

    at GradleStart.main(GradleStart.java:45)

     

     

    A detailed walkthrough of the error, its code path and all known details is as follows:

    ---------------------------------------------------------------------------------------

     

    -- Head --

    Stacktrace:

    at com.rosecotton.shelvesmod.RenderShelfTileEntity.<init>(RenderShelfTileEntity.java:18)

    at com.rosecotton.shelvesmod.ShelfTitleEntity.setInventorySlotContents(ShelfTitleEntity.java:135)

    at com.rosecotton.shelvesmod.ShelfTitleEntity.decrStackSize(ShelfTitleEntity.java:102)

    at net.minecraft.inventory.Slot.decrStackSize(Slot.java:94)

    at net.minecraft.inventory.Container.slotClick(Container.java:320)

    at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:475)

    at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:637)

    at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:387)

    at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:525)

    at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:497)

     

    -- Affected screen --

    Details:

    Screen name: com.rosecotton.shelvesmod.GuiInventoryShelf

     

    -- Affected level --

    Details:

    Level name: MpServer

    All players: 1 total; [EntityPlayerSP['Player680'/312, l='MpServer', x=-231.86, y=77.00, z=61.09]]

    Chunk stats: MultiplayerChunkCache: 289, 289

    Level seed: 0

    Level generator: ID 00 - default, ver 1. Features enabled: false

    Level generator options:

    Level spawn location: -228.00,64.00,60.00 - World: (-228,64,60), Chunk: (at 12,4,12 in -15,3; contains blocks -240,0,48 to -225,255,63), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

    Level time: 25509 game time, 25509 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: 61 total; [EntityChicken['Chicken'/135, l='MpServer', x=-262.53, y=71.00, z=-12.81], EntityChicken['Chicken'/136, l='MpServer', x=-262.50, y=78.00, z=14.44], EntityCow['Cow'/137, l='MpServer', x=-266.81, y=68.00, z=82.75], EntityChicken['Chicken'/138, l='MpServer', x=-262.50, y=66.00, z=91.28], EntityChicken['Chicken'/139, l='MpServer', x=-271.03, y=71.02, z=108.50], EntityChicken['Chicken'/140, l='MpServer', x=-271.38, y=75.00, z=114.41], EntityChicken['Chicken'/141, l='MpServer', x=-267.69, y=71.00, z=138.53], EntityChicken['Chicken'/142, l='MpServer', x=-263.50, y=70.00, z=139.09], EntityChicken['Chicken'/146, l='MpServer', x=-263.34, y=70.00, z=134.66], EntityChicken['Chicken'/147, l='MpServer', x=-265.47, y=70.00, z=134.59], EntityItem['item.item.egg'/2330, l='MpServer', x=-262.19, y=78.00, z=14.19], EntityChicken['Chicken'/157, l='MpServer', x=-245.72, y=67.00, z=-18.47], EntityChicken['Chicken'/158, l='MpServer', x=-253.66, y=71.00, z=-5.53], EntityBat['Bat'/160, l='MpServer', x=-253.72, y=16.06, z=130.00], EntityCow['Cow'/175, l='MpServer', x=-235.41, y=79.00, z=55.34], EntityBat['Bat'/177, l='MpServer', x=-234.63, y=20.28, z=132.25], EntityBat['Bat'/183, l='MpServer', x=-216.75, y=57.10, z=60.75], EntityChicken['Chicken'/190, l='MpServer', x=-207.31, y=64.00, z=-6.56], EntityChicken['Chicken'/191, l='MpServer', x=-202.50, y=64.00, z=-4.69], EntityChicken['Chicken'/192, l='MpServer', x=-201.59, y=64.00, z=12.09], EntityPig['Pig'/193, l='MpServer', x=-192.19, y=64.00, z=6.38], EntityPig['Pig'/194, l='MpServer', x=-201.03, y=64.00, z=9.00], EntityPig['Pig'/195, l='MpServer', x=-195.06, y=64.00, z=7.81], EntityChicken['Chicken'/196, l='MpServer', x=-206.63, y=64.00, z=4.84], EntityPig['Pig'/197, l='MpServer', x=-204.16, y=64.00, z=5.41], EntityChicken['Chicken'/69, l='MpServer', x=-311.41, y=82.00, z=9.59], EntityItem['item.item.egg'/198, l='MpServer', x=-200.66, y=64.00, z=12.50], EntityCow['Cow'/199, l='MpServer', x=-206.03, y=74.00, z=25.53], EntityChicken['Chicken'/200, l='MpServer', x=-202.66, y=67.00, z=21.50], EntityCow['Cow'/201, l='MpServer', x=-204.06, y=70.00, z=30.09], EntityChicken['Chicken'/75, l='MpServer', x=-308.50, y=78.00, z=87.50], EntityBat['Bat'/462, l='MpServer', x=-167.88, y=53.00, z=13.66], EntityChicken['Chicken'/78, l='MpServer', x=-311.31, y=73.00, z=102.34], EntityChicken['Chicken'/210, l='MpServer', x=-185.75, y=66.00, z=3.50], EntityChicken['Chicken'/211, l='MpServer', x=-188.63, y=64.00, z=12.41], EntityPlayerSP['Player680'/312, l='MpServer', x=-231.86, y=77.00, z=61.09], EntityChicken['Chicken'/216, l='MpServer', x=-163.28, y=70.00, z=2.56], EntityChicken['Chicken'/90, l='MpServer', x=-288.34, y=76.00, z=-17.56], EntityChicken['Chicken'/91, l='MpServer', x=-299.49, y=75.14, z=-3.53], EntityChicken['Chicken'/92, l='MpServer', x=-294.47, y=78.00, z=-7.38], EntityChicken['Chicken'/95, l='MpServer', x=-302.31, y=81.00, z=26.56], EntityItem['item.item.egg'/96, l='MpServer', x=-291.00, y=80.00, z=17.06], EntityChicken['Chicken'/97, l='MpServer', x=-291.44, y=80.00, z=17.31], EntityChicken['Chicken'/98, l='MpServer', x=-297.22, y=83.00, z=39.13], EntityChicken['Chicken'/100, l='MpServer', x=-296.41, y=83.00, z=39.75], EntityChicken['Chicken'/101, l='MpServer', x=-297.53, y=72.00, z=92.34], EntityChicken['Chicken'/229, l='MpServer', x=-151.88, y=68.00, z=-10.28], EntityChicken['Chicken'/102, l='MpServer', x=-291.69, y=71.00, z=99.34], EntityChicken['Chicken'/230, l='MpServer', x=-158.41, y=71.00, z=-12.34], EntityChicken['Chicken'/103, l='MpServer', x=-298.72, y=69.00, z=117.91], EntityBat['Bat'/489, l='MpServer', x=-168.52, y=47.82, z=68.06], EntityBat['Bat'/363, l='MpServer', x=-186.10, y=17.06, z=118.04], EntityChicken['Chicken'/115, l='MpServer', x=-274.66, y=77.00, z=12.34], EntityItem['item.item.egg'/116, l='MpServer', x=-273.75, y=79.00, z=16.19], EntityChicken['Chicken'/117, l='MpServer', x=-280.25, y=81.00, z=21.53], EntityChicken['Chicken'/118, l='MpServer', x=-282.66, y=74.00, z=81.66], EntityItem['item.item.egg'/119, l='MpServer', x=-283.31, y=70.00, z=106.88], EntityChicken['Chicken'/120, l='MpServer', x=-270.34, y=72.19, z=107.87], EntityChicken['Chicken'/121, l='MpServer', x=-283.66, y=70.00, z=106.50], EntitySquid['Squid'/379, l='MpServer', x=-172.38, y=56.06, z=110.97], EntityBat['Bat'/507, l='MpServer', x=-196.25, y=12.08, z=130.73]]

    Retry entities: 0 total; []

    Server brand: fml

    Server type: Integrated singleplayer server

    Stacktrace:

    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:350)

    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2586)

    at net.minecraft.client.Minecraft.run(Minecraft.java:368)

    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(GradleStartCommon.java:85)

    at GradleStart.main(GradleStart.java:45)

     

    -- System Details --

    Details:

    Minecraft Version: 1.8

    Operating System: Windows 7 (x86) version 6.1

    Java Version: 1.8.0_31, Oracle Corporation

    Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

    Memory: 802450408 bytes (765 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95

    FML: MCP v9.10 FML v8.0.20.1023 5 mods loaded, 5 mods active

    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    FML{8.0.20.1023} [Forge Mod Loader] (fmlSrc-1.8-8.0.20.1023-1.8.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    testmod01{1.0} [Test Mod 01] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    oredetectmod{1.0} [Ore Detect Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    shelvesmod{1.0} [shelves Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    Launched Version: 1.8

    LWJGL: 2.9.1

    OpenGL: ATI Radeon HD 4800 Series GL version 3.3.11672 Compatibility Profile Context, ATI Technologies Inc.

    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'

    Type: Client (map_client.txt)

    Resource Packs: []

    Current Language: English (US)

    Profiler Position: N/A (disabled)

    [11:06:16] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Becky\Desktop\Forge ModLoader-1.8-8.0.20.1023-1.8-src\eclipse\.\crash-reports\crash-2015-03-11_11.06.16-client.txt

    AL lib: (EE) alc_cleanup: 1 device not closed

    Java HotSpot Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

     

     

  13. I've put together something that I think might render my items (I at least want to see if it works) but I'm not sure from where to call my RenderShelfTileEntity class.

     

    package com.rosecotton.shelvesmod;
    
    import net.minecraft.client.renderer.entity.RenderEntityItem;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.tileentity.TileEntity;
    
    public class RenderShelfTileEntity 
    {
    public RenderShelfTileEntity(ShelfTitleEntity shelfTileEntity)
    {
    	RenderEntityItem renderEntityItem = new RenderEntityItem(null, null);
    	double x = ((TileEntity)shelfTileEntity).getPos().getX();
    	double y = ((TileEntity)shelfTileEntity).getPos().getY();
    	double z = ((TileEntity)shelfTileEntity).getPos().getZ();
    	EntityItem shelfEntityItem[] = new EntityItem[4];
    	for (int n = 0; n <4; n++)
    	{
    		shelfEntityItem[n].setEntityItemStack(shelfTileEntity.itemStacks[n]);
    
    		double xPlus = x + (double)((4+(n%2)*8)/16);
    		double yPlus = y + (double)((2+(n/2)*6)/16);
    		double zPlus = z + (double)((13-(n/2)*8)/16);
    
    		renderEntityItem.func_177075_a(shelfEntityItem[n], xPlus, yPlus, zPlus, 0.0625f, 1.05f);
    	}
    
    }
    }
    

     

    Should I call this from the BlockShelf class, the ShelvesEventHandler (which currently doese nothing), or the ShelfTitleEntity class?

     

    I know I need to rename everything that says TitleEntity to TileEntity.  :\

  14. after stumbling around, the code that eclipse hasn't complained much about is:

     

    double x = ((TileEntity)shelfTileEntity).getPos().getX();

    double y = ((TileEntity)shelfTileEntity).getPos().getY();

    double z = ((TileEntity)shelfTileEntity).getPos().getZ();

     

    we'll see if that works...  :P

     

    I can't believe I just realized yesterday that it's TileEntity, not TitleEntity.  I have a _lot_ of spelling errors in my code now.  :\

  15. Thanks, Draco; so, what I got out of that is that the position data is of type float.

     

    Right now I'm trying to figure out how to add in the block's coordinates but haven't found the translation between BlockPos and x, y, and z coordinates.

    I'll have a y offset for my items, too, so I'll add that into the for loop.

    I'm reading up on BlockPos and Entity and RenderEntityItem to figure out the position data.

     

    It's the rendering part I'm stuck on. 

  16. Hi, All.  :)

     

    I'm still working on my shelves mod: I have my shelf block behaving properly, rendering and able to hold up to four item stacks.

    I'm trying to make the item models render on the shelves in the proper location.

    I want to say,

    For each itemStacks[0 through 3],

    take the ItemStack, find it's item model, render the item model in the proper location[0 through 3] relative to the block.

     

    I was looking at EntityItem, and I can set an item stack, but I'm not sure how to render it.

    Looking at RenderEntityItem, there are arguments of types RenderManager and RenderItem (and I'm not sure how to create those), but I'm thinking I should be able to find something that says "render this item in this location of this block" or something.  sounds like something I might have to write... 

     

    What structure would you use to get this done?

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.