Posted July 3, 201411 yr I have a gui which uses one of two containers, depending on wether the player has the right item in thier inventory. Everything works fine, except if I go back to the menu (without closing minecraft) and then go back into the world and try to open the gui. LOOK AT THE BOTTOM OF THE PAGE FOR THE NEW PROBLEM!!!!!! Error: 2014-07-02 20:12:16 [iNFO] [sTDERR] net.minecraft.util.ReportedException: Exception in world tick 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1946) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:910) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:838) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.client.main.Main.main(Main.java:93) 2014-07-02 20:12:16 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2014-07-02 20:12:16 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2014-07-02 20:12:16 [iNFO] [sTDERR] Caused by: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 2014-07-02 20:12:16 [iNFO] [sTDERR] at java.util.ArrayList.rangeCheck(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDERR] at java.util.ArrayList.get(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.inventory.Container.getSlot(Container.java:133) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.inventory.Container.putStacksInSlots(Container.java:562) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.client.multiplayer.NetClientHandler.handleWindowItems(NetClientHandler.java:1288) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.network.packet.Packet104WindowItems.processPacket(Packet104WindowItems.java:67) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:281) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:99) 2014-07-02 20:12:16 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1930) 2014-07-02 20:12:16 [iNFO] [sTDERR] ... 9 more 2014-07-02 20:12:16 [iNFO] [sTDOUT] ---- Minecraft Crash Report ---- 2014-07-02 20:12:16 [iNFO] [sTDOUT] // Oops. 2014-07-02 20:12:16 [iNFO] [sTDOUT] 2014-07-02 20:12:16 [iNFO] [sTDOUT] Time: 7/2/14 8:12 PM 2014-07-02 20:12:16 [iNFO] [sTDOUT] Description: Exception in world tick 2014-07-02 20:12:16 [iNFO] [sTDOUT] 2014-07-02 20:12:16 [iNFO] [sTDOUT] java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 2014-07-02 20:12:16 [iNFO] [sTDOUT] at java.util.ArrayList.rangeCheck(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at java.util.ArrayList.get(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.inventory.Container.getSlot(Container.java:133) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.inventory.Container.putStacksInSlots(Container.java:562) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.NetClientHandler.handleWindowItems(NetClientHandler.java:1288) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.network.packet.Packet104WindowItems.processPacket(Packet104WindowItems.java:67) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:281) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:99) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1930) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:910) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:838) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2014-07-02 20:12:16 [iNFO] [sTDOUT] 2014-07-02 20:12:16 [iNFO] [sTDOUT] 2014-07-02 20:12:16 [iNFO] [sTDOUT] A detailed walkthrough of the error, its code path and all known details is as follows: 2014-07-02 20:12:16 [iNFO] [sTDOUT] --------------------------------------------------------------------------------------- 2014-07-02 20:12:16 [iNFO] [sTDOUT] 2014-07-02 20:12:16 [iNFO] [sTDOUT] -- Head -- 2014-07-02 20:12:16 [iNFO] [sTDOUT] Stacktrace: 2014-07-02 20:12:16 [iNFO] [sTDOUT] at java.util.ArrayList.rangeCheck(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at java.util.ArrayList.get(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.inventory.Container.getSlot(Container.java:133) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.inventory.Container.putStacksInSlots(Container.java:562) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.NetClientHandler.handleWindowItems(NetClientHandler.java:1288) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.network.packet.Packet104WindowItems.processPacket(Packet104WindowItems.java:67) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:281) 2014-07-02 20:12:16 [iNFO] [sTDOUT] 2014-07-02 20:12:16 [iNFO] [sTDOUT] -- Affected level -- 2014-07-02 20:12:16 [iNFO] [sTDOUT] Details: 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level name: MpServer 2014-07-02 20:12:16 [iNFO] [sTDOUT] All players: 1 total; [EntityClientPlayerMP['Player859'/1645, l='MpServer', x=-53.00, y=78.62, z=248.00]] 2014-07-02 20:12:16 [iNFO] [sTDOUT] Chunk stats: MultiplayerChunkCache: 150 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level seed: 0 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level generator: ID 00 - default, ver 1. Features enabled: false 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level generator options: 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level spawn location: World: (-60,64,256), Chunk: (at 4,4,0 in -4,16; contains blocks -64,0,256 to -49,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level time: 485128 game time, 6000 day time 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level dimension: 0 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level storage version: 0x00000 - Unknown? 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false 2014-07-02 20:12:16 [iNFO] [sTDOUT] Forced entities: 53 total; [EntityClientPlayerMP['Player859'/1645, l='MpServer', x=-53.00, y=78.62, z=248.00], EntityCreeper['Creeper'/1634, l='MpServer', x=27.00, y=17.00, z=232.44], EntitySkeleton['Skeleton'/1632, l='MpServer', x=6.41, y=39.92, z=319.47], EntityBat['Bat'/1608, l='MpServer', x=-45.53, y=31.07, z=199.60], EntityZombie['Zombie'/1609, l='MpServer', x=-42.50, y=35.00, z=207.06], EntityBat['Bat'/1610, l='MpServer', x=-38.69, y=42.39, z=203.52], EntityBat['Bat'/1611, l='MpServer', x=-47.73, y=26.57, z=212.90], EntityZombie['Zombie'/1612, l='MpServer', x=-47.50, y=36.00, z=241.50], EntityManaCreeper['Mana Creeper'/1613, l='MpServer', x=-39.13, y=50.00, z=249.53], EntityBat['Bat'/1614, l='MpServer', x=-48.13, y=49.07, z=258.16], EntitySheep['Sheep'/1615, l='MpServer', x=-47.97, y=65.00, z=300.06], EntityPig['Pig'/1600, l='MpServer', x=-53.06, y=64.00, z=293.06], EntityCreeper['Creeper'/1606, l='MpServer', x=-33.63, y=29.00, z=187.22], EntityBat['Bat'/1607, l='MpServer', x=-47.66, y=21.10, z=185.84], EntityCreeper['Creeper'/1625, l='MpServer', x=-21.50, y=23.00, z=224.50], EntityZombie['Zombie'/1624, l='MpServer', x=-25.53, y=23.00, z=221.88], EntityCreeper['Creeper'/1626, l='MpServer', x=-20.50, y=16.00, z=237.50], EntityPig['Pig'/1629, l='MpServer', x=-5.94, y=65.00, z=228.44], EntitySquid['Squid'/1623, l='MpServer', x=-27.92, y=52.26, z=184.07], EntitySquid['Squid'/1622, l='MpServer', x=-23.48, y=51.38, z=185.54], EntitySkeleton['Skeleton'/1582, l='MpServer', x=-76.50, y=17.00, z=220.69], EntityCreeper['Creeper'/1583, l='MpServer', x=-73.50, y=25.00, z=241.50], EntityZombie['Zombie'/1580, l='MpServer', x=-70.50, y=17.00, z=222.03], EntityZombie['Zombie'/1581, l='MpServer', x=-76.47, y=17.00, z=219.84], EntitySquid['Squid'/1578, l='MpServer', x=-69.48, y=53.35, z=199.72], EntityCreeper['Creeper'/1579, l='MpServer', x=-73.31, y=25.00, z=218.35], EntitySquid['Squid'/1570, l='MpServer', x=-90.90, y=57.34, z=216.05], EntitySquid['Squid'/1571, l='MpServer', x=-89.95, y=57.74, z=221.67], EntitySquid['Squid'/1568, l='MpServer', x=-92.10, y=52.99, z=185.29], EntitySquid['Squid'/1569, l='MpServer', x=-93.84, y=46.31, z=192.16], EntityPig['Pig'/1599, l='MpServer', x=-51.94, y=63.00, z=224.59], EntityPig['Pig'/1598, l='MpServer', x=-63.19, y=63.00, z=229.84], EntityBat['Bat'/1597, l='MpServer', x=-52.47, y=24.26, z=216.59], EntitySkeleton['Skeleton'/1596, l='MpServer', x=-59.50, y=40.00, z=199.50], EntityBat['Bat'/1595, l='MpServer', x=-51.53, y=27.10, z=204.25], EntityBat['Bat'/1594, l='MpServer', x=-48.25, y=22.10, z=187.75], EntityBat['Bat'/1593, l='MpServer', x=-56.64, y=16.29, z=186.75], EntityBat['Bat'/1592, l='MpServer', x=-52.52, y=23.33, z=171.66], EntityBat['Bat'/1591, l='MpServer', x=-53.59, y=23.86, z=170.25], EntityZombie['Zombie'/1585, l='MpServer', x=-73.50, y=26.00, z=274.50], EntityZombie['Zombie'/1584, l='MpServer', x=-74.63, y=26.00, z=271.34], EntityPig['Pig'/1548, l='MpServer', x=-116.25, y=65.00, z=249.06], EntityPig['Pig'/1549, l='MpServer', x=-112.50, y=64.00, z=287.22], EntityPig['Pig'/1547, l='MpServer', x=-124.16, y=64.00, z=207.38], EntityPig['Pig'/1561, l='MpServer', x=-111.97, y=64.00, z=311.97], EntitySheep['Sheep'/1560, l='MpServer', x=-100.94, y=64.00, z=296.88], EntitySquid['Squid'/1557, l='MpServer', x=-98.48, y=49.69, z=193.41], EntitySquid['Squid'/1556, l='MpServer', x=-96.82, y=51.34, z=189.96], EntityBat['Bat'/1559, l='MpServer', x=-98.25, y=36.00, z=223.03], EntitySquid['Squid'/1558, l='MpServer', x=-97.15, y=57.04, z=211.84], EntitySquid['Squid'/1553, l='MpServer', x=-103.19, y=50.66, z=189.60], EntitySquid['Squid'/1555, l='MpServer', x=-98.03, y=50.26, z=189.01], EntitySquid['Squid'/1554, l='MpServer', x=-96.46, y=48.79, z=187.23]] 2014-07-02 20:12:16 [iNFO] [sTDOUT] Retry entities: 0 total; [] 2014-07-02 20:12:16 [iNFO] [sTDOUT] Server brand: fml,forge 2014-07-02 20:12:16 [iNFO] [sTDOUT] Server type: Integrated singleplayer server 2014-07-02 20:12:16 [iNFO] [sTDOUT] Stacktrace: 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:440) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1943) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:910) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:838) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) 2014-07-02 20:12:16 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2014-07-02 20:12:16 [iNFO] [sTDOUT] 2014-07-02 20:12:16 [iNFO] [sTDOUT] -- Affected level -- 2014-07-02 20:12:16 [iNFO] [sTDOUT] Details: 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level name: MpServer 2014-07-02 20:12:16 [iNFO] [sTDOUT] All players: 1 total; [EntityClientPlayerMP['Player859'/1645, l='MpServer', x=-53.00, y=78.62, z=248.00]] 2014-07-02 20:12:16 [iNFO] [sTDOUT] Chunk stats: MultiplayerChunkCache: 150 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level seed: 0 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level generator: ID 00 - default, ver 1. Features enabled: false 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level generator options: 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level spawn location: World: (-60,64,256), Chunk: (at 4,4,0 in -4,16; contains blocks -64,0,256 to -49,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level time: 485128 game time, 6000 day time 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level dimension: 0 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level storage version: 0x00000 - Unknown? 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) 2014-07-02 20:12:16 [iNFO] [sTDOUT] Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false 2014-07-02 20:12:16 [iNFO] [sTDOUT] Forced entities: 53 total; [EntityClientPlayerMP['Player859'/1645, l='MpServer', x=-53.00, y=78.62, z=248.00], EntityCreeper['Creeper'/1634, l='MpServer', x=27.00, y=17.00, z=232.44], EntitySkeleton['Skeleton'/1632, l='MpServer', x=6.41, y=39.92, z=319.47], EntityBat['Bat'/1608, l='MpServer', x=-45.53, y=31.07, z=199.60], EntityZombie['Zombie'/1609, l='MpServer', x=-42.50, y=35.00, z=207.06], EntityBat['Bat'/1610, l='MpServer', x=-38.69, y=42.39, z=203.52], EntityBat['Bat'/1611, l='MpServer', x=-47.73, y=26.57, z=212.90], EntityZombie['Zombie'/1612, l='MpServer', x=-47.50, y=36.00, z=241.50], EntityManaCreeper['Mana Creeper'/1613, l='MpServer', x=-39.13, y=50.00, z=249.53], EntityBat['Bat'/1614, l='MpServer', x=-48.13, y=49.07, z=258.16], EntitySheep['Sheep'/1615, l='MpServer', x=-47.97, y=65.00, z=300.06], EntityPig['Pig'/1600, l='MpServer', x=-53.06, y=64.00, z=293.06], EntityCreeper['Creeper'/1606, l='MpServer', x=-33.63, y=29.00, z=187.22], EntityBat['Bat'/1607, l='MpServer', x=-47.66, y=21.10, z=185.84], EntityCreeper['Creeper'/1625, l='MpServer', x=-21.50, y=23.00, z=224.50], EntityZombie['Zombie'/1624, l='MpServer', x=-25.53, y=23.00, z=221.88], EntityCreeper['Creeper'/1626, l='MpServer', x=-20.50, y=16.00, z=237.50], EntityPig['Pig'/1629, l='MpServer', x=-5.94, y=65.00, z=228.44], EntitySquid['Squid'/1623, l='MpServer', x=-27.92, y=52.26, z=184.07], EntitySquid['Squid'/1622, l='MpServer', x=-23.48, y=51.38, z=185.54], EntitySkeleton['Skeleton'/1582, l='MpServer', x=-76.50, y=17.00, z=220.69], EntityCreeper['Creeper'/1583, l='MpServer', x=-73.50, y=25.00, z=241.50], EntityZombie['Zombie'/1580, l='MpServer', x=-70.50, y=17.00, z=222.03], EntityZombie['Zombie'/1581, l='MpServer', x=-76.47, y=17.00, z=219.84], EntitySquid['Squid'/1578, l='MpServer', x=-69.48, y=53.35, z=199.72], EntityCreeper['Creeper'/1579, l='MpServer', x=-73.31, y=25.00, z=218.35], EntitySquid['Squid'/1570, l='MpServer', x=-90.90, y=57.34, z=216.05], EntitySquid['Squid'/1571, l='MpServer', x=-89.95, y=57.74, z=221.67], EntitySquid['Squid'/1568, l='MpServer', x=-92.10, y=52.99, z=185.29], EntitySquid['Squid'/1569, l='MpServer', x=-93.84, y=46.31, z=192.16], EntityPig['Pig'/1599, l='MpServer', x=-51.94, y=63.00, z=224.59], EntityPig['Pig'/1598, l='MpServer', x=-63.19, y=63.00, z=229.84], EntityBat['Bat'/1597, l='MpServer', x=-52.47, y=24.26, z=216.59], EntitySkeleton['Skeleton'/1596, l='MpServer', x=-59.50, y=40.00, z=199.50], EntityBat['Bat'/1595, l='MpServer', x=-51.53, y=27.10, z=204.25], EntityBat['Bat'/1594, l='MpServer', x=-48.25, y=22.10, z=187.75], EntityBat['Bat'/1593, l='MpServer', x=-56.64, y=16.29, z=186.75], EntityBat['Bat'/1592, l='MpServer', x=-52.52, y=23.33, z=171.66], EntityBat['Bat'/1591, l='MpServer', x=-53.59, y=23.86, z=170.25], EntityZombie['Zombie'/1585, l='MpServer', x=-73.50, y=26.00, z=274.50], EntityZombie['Zombie'/1584, l='MpServer', x=-74.63, y=26.00, z=271.34], EntityPig['Pig'/1548, l='MpServer', x=-116.25, y=65.00, z=249.06], EntityPig['Pig'/1549, l='MpServer', x=-112.50, y=64.00, z=287.22], EntityPig['Pig'/1547, l='MpServer', x=-124.16, y=64.00, z=207.38], EntityPig['Pig'/1561, l='MpServer', x=-111.97, y=64.00, z=311.97], EntitySheep['Sheep'/1560, l='MpServer', x=-100.94, y=64.00, z=296.88], EntitySquid['Squid'/1557, l='MpServer', x=-98.48, y=49.69, z=193.41], EntitySquid['Squid'/1556, l='MpServer', x=-96.82, y=51.34, z=189.96], EntityBat['Bat'/1559, l='MpServer', x=-98.25, y=36.00, z=223.03], EntitySquid['Squid'/1558, l='MpServer', x=-97.15, y=57.04, z=211.84], EntitySquid['Squid'/1553, l='MpServer', x=-103.19, y=50.66, z=189.60], EntitySquid['Squid'/1555, l='MpServer', x=-98.03, y=50.26, z=189.01], EntitySquid['Squid'/1554, l='MpServer', x=-96.46, y=48.79, z=187.23]] 2014-07-02 20:12:16 [iNFO] [sTDOUT] Retry entities: 0 total; [] 2014-07-02 20:12:16 [iNFO] [sTDOUT] Server brand: fml,forge 2014-07-02 20:12:16 [iNFO] [sTDOUT] Server type: Integrated singleplayer server 2014-07-02 20:12:16 [iNFO] [sTDOUT] 2014-07-02 20:12:16 [iNFO] [sTDOUT] -- System Details -- 2014-07-02 20:12:16 [iNFO] [sTDOUT] Details: 2014-07-02 20:12:16 [iNFO] [sTDOUT] Minecraft Version: 1.6.4 2014-07-02 20:12:16 [iNFO] [sTDOUT] Operating System: Windows 8 (amd64) version 6.2 2014-07-02 20:12:16 [iNFO] [sTDOUT] Java Version: 1.7.0_51, Oracle Corporation 2014-07-02 20:12:16 [iNFO] [sTDOUT] Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation 2014-07-02 20:12:16 [iNFO] [sTDOUT] Memory: 753343312 bytes (718 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) 2014-07-02 20:12:16 [iNFO] [sTDOUT] JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M 2014-07-02 20:12:16 [iNFO] [sTDOUT] AABB Pool Size: 17798 (996688 bytes; 0 MB) allocated, 652 (36512 bytes; 0 MB) used 2014-07-02 20:12:16 [iNFO] [sTDOUT] Suspicious classes: FML and Forge are installed 2014-07-02 20:12:16 [iNFO] [sTDOUT] IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63 2014-07-02 20:12:16 [iNFO] [sTDOUT] FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 8 mods loaded, 8 mods active 2014-07-02 20:12:16 [iNFO] [sTDOUT] mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-07-02 20:12:16 [iNFO] [sTDOUT] FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-07-02 20:12:16 [iNFO] [sTDOUT] Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-07-02 20:12:16 [iNFO] [sTDOUT] arsmagica2{1.1.2b} [Ars Magica 2] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-07-02 20:12:16 [iNFO] [sTDOUT] TechnologicalMagic{pre-alpha} [Technological Magic] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-07-02 20:12:16 [iNFO] [sTDOUT] WardingStones{pre-alfa} [Technological Magic:Ars Magica] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-07-02 20:12:16 [iNFO] [sTDOUT] Thaumcraft{4.1.0e} [Thaumcraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-07-02 20:12:16 [iNFO] [sTDOUT] ThaumicTech{pre-alfa} [Technological Magic:Thaumcraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-07-02 20:12:16 [iNFO] [sTDOUT] Launched Version: 1.6 2014-07-02 20:12:16 [iNFO] [sTDOUT] LWJGL: 2.9.0 2014-07-02 20:12:16 [iNFO] [sTDOUT] OpenGL: Intel(R) HD Graphics 4600 GL version 4.2.0 - Build 10.18.10.3412, Intel 2014-07-02 20:12:16 [iNFO] [sTDOUT] Is Modded: Definitely; Client brand changed to 'fml,forge' 2014-07-02 20:12:16 [iNFO] [sTDOUT] Type: Client (map_client.txt) 2014-07-02 20:12:16 [iNFO] [sTDOUT] Resource Pack: Default 2014-07-02 20:12:16 [iNFO] [sTDOUT] Current Language: English (US) 2014-07-02 20:12:16 [iNFO] [sTDOUT] Profiler Position: N/A (disabled) 2014-07-02 20:12:16 [iNFO] [sTDOUT] Vec3 Pool Size: 2255 (126280 bytes; 0 MB) allocated, 1254 (70224 bytes; 0 MB) used 2014-07-02 20:12:16 [iNFO] [sTDOUT] #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Jeneale\Desktop\Ryan\Minecraft\Making mods\forge-1.6.4-9.11.1.965 Mods (MCP 811)\forge-1.6.4-9.11.1.965-WardingStones\forge\mcp\jars\.\crash-reports\crash-2014-07-02_20.12.16-client.txt AL lib: (EE) alc_cleanup: 1 device not closed Gui: package Technomage3.both.Interfaces.guis; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import Technomage3.both.Blocks.tileentities.TileEntityMagicPathway; import Technomage3.both.Interfaces.containers.ContainerMagicPathwayBlocked; import Technomage3.both.Interfaces.containers.ContainerMagicPathwayOpen; import Technomage3.both.Items.ItemKeystone; import Technomage3.both.Items.ItemKeystone.KeyCode; public class GUIMagicPathway extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation("tn3", "textures/gui/magicPathway.png"); private ContainerMagicPathwayBlocked cont; private EntityPlayer player; public GUIMagicPathway(InventoryPlayer inventory, TileEntityMagicPathway t) { super(TileEntityMagicPathway.shouldPlayerSeeKeystone(inventory.player, t) ? new ContainerMagicPathwayOpen(inventory, t) : new ContainerMagicPathwayBlocked(inventory, t)); cont = (ContainerMagicPathwayBlocked) super.inventorySlots; player = inventory.player; xSize = 175; ySize = 176; } @Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1, 1, 1, 1); super.mc.renderEngine.bindTexture(texture); drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize); if(!cont.keySlot()){ drawTexturedModalRect(guiLeft + 5, guiTop + 5, 23, 5, 18, 18); } drawString(fontRenderer, cont.tile.getName(), guiLeft + 40, guiTop + 10, 0x404040); } protected void drawGuiContainerForegroundLayer(int x0, int y0) { GL11.glColor4f(1, 1, 1, 1); super.mc.renderEngine.bindTexture(texture); if(!cont.points.isEmpty()){ TileEntityMagicPathway tile = cont.points.get(cont.place); drawString(fontRenderer, tile.xCoord + ", " + tile.yCoord + ", " + tile.zCoord, 35, 55, 0x404040); } if(cont.place > 0 && !cont.points.isEmpty()) previous.enabled = true; else previous.enabled = false; if(cont.place < cont.points.size() - 1 && !cont.points.isEmpty()) next.enabled = true; else next.enabled = false; } private GuiButton next; private GuiButton previous; @Override public void initGui(){ super.initGui(); buttonList.clear(); next = new GuiButton(1, guiLeft + (xSize / 2) + 1, guiTop + 72, 50, 20, "Next"); previous = new GuiButton(0, guiLeft + (xSize / 2) - 52, guiTop + 72, 50, 20, "Previous"); // 43, 30 buttonList.add(new GuiButton(2, guiLeft + 54, guiTop + 26, 60, 20, "Travel Now!")); buttonList.add(next); buttonList.add(previous); } @Override protected void actionPerformed(GuiButton button){ if(button.id == 0 && cont.place > 0){ System.out.println("Went Back"); cont.place--; } if(button.id == 1 && cont.place < cont.points.size() - 1){ System.out.println("Went Forward"); cont.place++; } if(button.id == 2){ if(!cont.points.isEmpty()){ TileEntityMagicPathway tile = cont.points.get(cont.place); player.setPositionAndUpdate(tile.xCoord, tile.yCoord + 1, tile.zCoord); player.closeScreen(); } } System.out.println("Id pressed: " + button.id); } } Container 1 (no access): package Technomage3.both.Interfaces.containers; import java.util.ArrayList; import java.util.LinkedList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import Technomage3.both.Blocks.tileentities.TileEntityMagicPathway; import Technomage3.both.Interfaces.GUIUtils; import Technomage3.both.Interfaces.TN3Container; import Technomage3.both.Interfaces.slots.SlotGhost; import Technomage3.both.Items.ItemKeystone.KeyCode; public class ContainerMagicPathwayBlocked extends TN3Container { private KeyCode heldCode; public TileEntityMagicPathway tile; private EntityPlayer player; public ArrayList<TileEntityMagicPathway> points; public int place; public ContainerMagicPathwayBlocked(InventoryPlayer inventory, TileEntityMagicPathway t1) { this.heldCode = KeyCode.getHeldCode(inventory.player); tile = t1; player = inventory.player; points = tile.getOtherPoints(heldCode); GUIUtils.addPlayerSlots(this, 8, 95, inventory); place = 0; System.out.println("Closed Slot"); } @Override public boolean canInteractWith(EntityPlayer entityplayer) { return true; } public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed(par1EntityPlayer); tile.onInventoryChanged(); System.out.println("Container Closed"); } public boolean keySlot(){ return false; } } Container 2 (access): package Technomage3.both.Interfaces.containers; import java.util.ArrayList; import java.util.LinkedList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import Technomage3.both.Blocks.tileentities.TileEntityMagicPathway; import Technomage3.both.Interfaces.GUIUtils; import Technomage3.both.Interfaces.TN3Container; import Technomage3.both.Interfaces.slots.SlotGhost; import Technomage3.both.Items.ItemKeystone.KeyCode; public class ContainerMagicPathwayOpen extends ContainerMagicPathwayBlocked { public ContainerMagicPathwayOpen(InventoryPlayer inventory, TileEntityMagicPathway t1) { super(inventory, t1); this.addSlotToContainer(new SlotGhost(tile, 0, 6, 6)); System.out.println("Open Slot"); } public boolean keySlot(){ return true; } }
July 3, 201411 yr Author Update: It seems to only be saving the key code on the server side, because when I use another item to read the server-side code, it comes out correct. It would also explain the error since I would have different codes on different sides, and therefor the gui handeler would get out of sync. I still don't know how to fix it though!
July 3, 201411 yr Author I think it might be because in my block, I only open the gui on the server-side. I don't know though. EDIT: nope, that didn't fix it,
July 3, 201411 yr Author GUI handeler: package Technomage3.both.Interfaces; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import Technomage3.both.TechnologicalMagic; import Technomage3.both.Blocks.tileentities.TileEntityAncientSpellTable; import Technomage3.both.Blocks.tileentities.TileEntityMageForge; import Technomage3.both.Blocks.tileentities.TileEntityMagicPathway; import Technomage3.both.Blocks.tileentities.TileEntityPowerCharger; import Technomage3.both.Interfaces.containers.ContainerAncientSpellTable; import Technomage3.both.Interfaces.containers.ContainerKeystone; import Technomage3.both.Interfaces.containers.ContainerMageForge; import Technomage3.both.Interfaces.containers.ContainerMagicPathwayBlocked; import Technomage3.both.Interfaces.containers.ContainerMagicPathwayOpen; import Technomage3.both.Interfaces.containers.ContainerModularArmor; import Technomage3.both.Interfaces.containers.ContainerPowerCharger; import Technomage3.both.Interfaces.containers.ContainerSpellTalisman; import Technomage3.both.Interfaces.guis.GUIAncientSpellTable; import Technomage3.both.Interfaces.guis.GUIKeystone; import Technomage3.both.Interfaces.guis.GUIMageForge; import Technomage3.both.Interfaces.guis.GUIMagicPathway; import Technomage3.both.Interfaces.guis.GUIModularArmor; import Technomage3.both.Interfaces.guis.TN3GUIContainer; import Technomage3.both.Items.ItemKeystone; import Technomage3.both.Items.ItemKeystone.KeyCode; import Technomage3.both.Items.TMItems; import Technomage3.both.Items.armor.ItemModularArmor; import Technomage3.both.Spell.talismans.ItemTalisman; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; public class TMGUIHandeler implements IGuiHandler { public TMGUIHandeler() { NetworkRegistry.instance().registerGuiHandler(TechnologicalMagic.instance, this); } @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch(ID) { case TMGuis.mageForgeGui: // tile entity mage forge TileEntity te = world.getBlockTileEntity(x, y, z); if(te != null && te instanceof TileEntityMageForge) return new ContainerMageForge(player.inventory, (TileEntityMageForge) te); break; case TMGuis.modularArmorGui: // modular armor ItemStack stack = player.getHeldItem(); if(stack.getItem() instanceof ItemModularArmor) return new ContainerModularArmor(player.inventory, (ItemModularArmor) stack.getItem()); case TMGuis.powerChargerGui: TileEntity t = world.getBlockTileEntity(x, y, z); if(t != null && t instanceof TileEntityPowerCharger) return new ContainerPowerCharger(player.inventory, (TileEntityPowerCharger) t); case TMGuis.spellTalismanGui: ItemStack stack2 = player.getHeldItem(); if(stack2.getItem() instanceof ItemTalisman) return new ContainerSpellTalisman(player.inventory, (ItemTalisman) stack2.getItem()); case TMGuis.ancientSpellTableGui: TileEntity t1 = world.getBlockTileEntity(x, y, z); if(t1 != null && t1 instanceof TileEntityAncientSpellTable) return new ContainerAncientSpellTable(player.inventory, (TileEntityAncientSpellTable) t1); case TMGuis.magicPathwayGui: TileEntity t2 = world.getBlockTileEntity(x, y, z); System.out.println(KeyCode.getHeldCode(player)); if(t2 != null && t2 instanceof TileEntityMagicPathway) return TileEntityMagicPathway.shouldPlayerSeeKeystone(player, (TileEntityMagicPathway) t2) ? new ContainerMagicPathwayOpen(player.inventory, (TileEntityMagicPathway) t2) : new ContainerMagicPathwayBlocked(player.inventory, (TileEntityMagicPathway) t2); case TMGuis.keystoneGui: ItemStack stack1 = player.getHeldItem(); if(stack1.itemID == TMItems.keyStone.itemID) return new ContainerKeystone(stack1, player.inventory); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch(ID) { case TMGuis.mageForgeGui: TileEntity te = world.getBlockTileEntity(x, y, z); if(te != null && te instanceof TileEntityMageForge) return new GUIMageForge(player.inventory, (TileEntityMageForge) te); break; case TMGuis.modularArmorGui: // modular armor ItemStack stack = player.getHeldItem(); if(stack.getItem() instanceof ItemModularArmor) return new GUIModularArmor(player.inventory, stack); case TMGuis.powerChargerGui: TileEntity t = world.getBlockTileEntity(x, y, z); if(t != null && t instanceof TileEntityPowerCharger) return new TN3GUIContainer(player.inventory, new ContainerPowerCharger(player.inventory, (TileEntityPowerCharger) t), "powerCharger", 176, 130 ); case TMGuis.spellTalismanGui: ItemStack stack2 = player.getHeldItem(); if(stack2.getItem() instanceof ItemTalisman) return new TN3GUIContainer(player.inventory, new ContainerSpellTalisman(player.inventory, (ItemTalisman) stack2.getItem()), "spellTalisman", 176, 128 ); case TMGuis.ancientSpellTableGui: TileEntity t1 = world.getBlockTileEntity(x, y, z); if(t1 != null && t1 instanceof TileEntityAncientSpellTable) return new GUIAncientSpellTable(player.inventory, (TileEntityAncientSpellTable) t1); case TMGuis.magicPathwayGui: TileEntity t2 = world.getBlockTileEntity(x, y, z); if(t2 != null && t2 instanceof TileEntityMagicPathway) return new GUIMagicPathway(player.inventory, (TileEntityMagicPathway) t2, TileEntityMagicPathway.shouldPlayerSeeKeystone(player, (TileEntityMagicPathway) t2) ? new ContainerMagicPathwayOpen(player.inventory, (TileEntityMagicPathway) t2) : new ContainerMagicPathwayBlocked(player.inventory, (TileEntityMagicPathway) t2)); case TMGuis.keystoneGui: ItemStack stack1 = player.getHeldItem(); if(stack1.itemID == TMItems.keyStone.itemID) return new GUIKeystone(stack1, player.inventory); } return null; } } Block (where I open the gui): package Technomage3.both.Blocks; import cpw.mods.fml.common.network.FMLNetworkHandler; import net.minecraft.block.BlockContainer; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import Technomage3.Core.Blocks.TN3BlockContainer; import Technomage3.both.TechnologicalMagic; import Technomage3.both.Blocks.tileentities.TileEntityMagicPathway; import Technomage3.both.Items.ItemKeystone; import Technomage3.both.Items.TMItems; public class BlockMagicPathway extends TN3BlockContainer { public BlockMagicPathway(String realName, String unlocalizedName, CreativeTabs tab) { super(realName, unlocalizedName, tab); // TODO Auto-generated constructor stub } @Override public TileEntity createNewTileEntity(World world) { return new TileEntityMagicPathway(); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){ TileEntityMagicPathway tile = (TileEntityMagicPathway) world.getBlockTileEntity(x, y, z); if(!player.isSneaking()) if(player.getHeldItem() != null && player.getHeldItem().itemID == TMItems.debuger.itemID) System.out.println( (world.isRemote ? "Client Code: " : "Server Code: ") + tile.getCode()); else FMLNetworkHandler.openGui(player, TechnologicalMagic.instance, 5, world, x, y, z); else{ super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ); } return true; } } TileEntity: package Technomage3.both.Blocks.tileentities; import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.event.Event; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.world.ChunkEvent; import net.minecraftforge.event.world.WorldEvent; import Technomage3.both.Items.ItemKeystone; import Technomage3.both.Items.ItemKeystone.KeyCode; import Technomage3.both.Items.TMItems; import Technomage3.both.Power.TileEntityMagicMachine; public class TileEntityMagicPathway extends TileEntityMagicMachine implements IInventory { private static final String stackKey = "myKeyStack"; private String name = "none"; public ItemStack[] keystone = new ItemStack[1]; public void onUpdate(){ } /** * Reads a tile entity from NBT. */ public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); name = nbt.getString("Name"); keystone[0] = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag(stackKey)); onInventoryChanged(); } /** * Writes a tile entity to NBT. */ public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); nbt.setString("Name", name); NBTTagCompound tag = new NBTTagCompound(); if(keystone[0] != null) keystone[0].writeToNBT(tag); nbt.setCompoundTag(stackKey, tag); onInventoryChanged(); } public ArrayList<TileEntityMagicPathway> getOtherPoints(KeyCode code){ ArrayList<TileEntityMagicPathway> list = new ArrayList<TileEntityMagicPathway>(); for(TileEntityMagicPathway t : getPoints(worldObj, code)){ if(!t.equals(this) && t.getCode().isMatch(code)) list.add(t); } return list; } public static ArrayList<TileEntityMagicPathway> getPoints(World world, KeyCode path){ ArrayList<TileEntityMagicPathway> list = new ArrayList<TileEntityMagicPathway>(); for(Object o : world.loadedTileEntityList){ if(o instanceof TileEntityMagicPathway){ TileEntityMagicPathway t = (TileEntityMagicPathway) o; if(t.getCode().isMatch(path) && !list.contains(t)) list.add(t); } } return list; } public KeyCode getCode() { return keystone[0] == null ? KeyCode.blank : KeyCode.getCode(keystone[0]); } @Override public int getSizeInventory() { return 1; } @Override public ItemStack getStackInSlot(int i) { return keystone[i]; } @Override public ItemStack decrStackSize(int i, int j) { ItemStack itemstack = getStackInSlot(i); if (itemstack != null) { if (itemstack.stackSize <= j) { setInventorySlotContents(i, null); onInventoryChanged(); }else{ itemstack = itemstack.splitStack(j); onInventoryChanged(); } } return itemstack; } @Override public ItemStack getStackInSlotOnClosing(int i) { ItemStack s = getStackInSlot(i); setInventorySlotContents(i, null); onInventoryChanged(); return s; } @Override public void setInventorySlotContents(int i, ItemStack itemstack) { if(itemstack != null && itemstack.stackSize > getInventoryStackLimit()) itemstack.stackSize = getInventoryStackLimit(); if(this.isItemValidForSlot(0, itemstack)) keystone[i] = itemstack; onInventoryChanged(); } @Override public String getInvName() { return name; } @Override public boolean isInvNameLocalized() { return false; } @Override public int getInventoryStackLimit() { return 1; } @Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { return entityplayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) <= 64; } @Override public void openChest() { } @Override public void closeChest() { } @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { return itemstack == null || itemstack.itemID == TMItems.keyStone.itemID; } public String getName() { return name; } @Override public boolean equals(Object o){ if(!(o instanceof TileEntityMagicPathway)) return false; TileEntityMagicPathway t = (TileEntityMagicPathway) o; return t.xCoord == xCoord && t.yCoord == yCoord && t.zCoord == zCoord; } public static boolean shouldPlayerSeeKeystone(EntityPlayer player, TileEntityMagicPathway tile){ return KeyCode.getHeldCode(player).equals(tile.getCode()); } } My problem was that I would change the stack in the inventory, but I would only call onInventoryChanged() from the container (server side). My tileEntity used onInventoryChanged() to update it's keyCode from it's inventory. I fixed that, but now my problem is that minecraft seems to only save/load tileentities from nbt on the server side, so when I try to use different containers for different tile entity values, only the server side one has the correct data. That causes the guiHandeler to return different things on the server side than the client side. What I need, is a way to either update the client tile entity to have the same data as the server-side one, or access the server tileentity from getClientGuiElement().
July 3, 201411 yr Author I think I might be able to send an event with a boolean value, catch it on the server-side, set the boolean to the correct value, and then use that value in the getClientGuiElement().
July 3, 201411 yr Author I did that, but like I said, the problem is that I have to determine which container to open on the client and server side, but minecraft only saves tileEntity data on the server side, so I get different containers, and therefor different amounts of slots, on the client and server sides. I tried sending an event with a boolean data menber and seting it to the right value only if the world is server side, but that's not working. If anyone has a different way to conditionally display a slot, that is all I am trying to do!
July 3, 201411 yr Author OK. In the block, I used different gui IDs to specify wether I want the slot open or closed, and that worked, but I still need the client and server tile entities to sync. Example: The server keyCode is correct, but the client one gets reset every time. I need either a way to sync the tile entities, or a way to access the server tile entity from the client side. When I put a different keystone in, both the client and server codes update, but if I use Save And Quit To Title, when I come back, the client code has been reset!
July 3, 201411 yr Author I'm trying that. What happens, is that to find destinations, my tile entity searches through the world's loaded tile entities and returns the ones with the same key code. When it does this on the client side, it adds every one of my tile entities, since for some reason the key code is not saved on the client side. I am using this from the furnace: public void detectAndSendChanges() { for (int i = 0; i < this.crafters.size(); ++i) { ICrafting icrafting = (ICrafting)this.crafters.get(i); icrafting.sendContainerAndContentsToPlayer(this, points); } } This doen't work, it just gives the player an item.
July 3, 201411 yr Author To clairify, the values I need to sync are part of the tile entity, not the container.
July 3, 201411 yr Author Let me restate the promlem: My tile entity doesn't save it's key code on the client side, so when my client side container searches for destinations (others of my tile entities) it returns everything (all their codes were not saved), but when my server side container searches for destinations, it only returns the tile entities with the correct code. I either need to sync the codes accross client and server when the tile entities are loaded, or give the client side container the correct data. If I could get the data to save on the client side too, that would work. Is it suposed to save?
July 3, 201411 yr Author I put print statements in write and read to/from NBT, and for some reason, minecraft is calling writeToNbt twice for the server, and never calling it for the client.
July 3, 201411 yr Author I tried that, but I couldn't figure out how to send a packet from the server to the client. Do you know of a good tutorial?
July 3, 201411 yr Author Yes, but I tried useing some of those to send the key code, but it wouldn't work. Also, those are all client to server not server to client. Is there a build in TileEntity method for this? (I was thinking maby receiveClientEvent() or getDescriptionPacket() or onDataPacket())
July 3, 201411 yr Author It would also work if I could get info to the GUI handeler from where I open the gui.
July 4, 201411 yr Author I got it to work by writing the correct destination list to a staticc variable on the server side, and then useing it on the client side.
July 4, 201411 yr Author Sorry, I'm in 1.6.4. And I looked at the tutorials on the old wiki. When Intried to start a dedicated server to test it, I got this crash: Crash: 2014-07-04 09:07:58 [sEVERE] [ForgeModLoader] mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized arsmagica2{1.1.2b} [Ars Magica 2] (bin) Unloaded->Constructed->Pre-initialized TechnologicalMagic{pre-alpha} [Technological Magic] (bin) Unloaded->Constructed->Errored WardingStones{pre-alfa} [Technological Magic:Ars Magica] (bin) Unloaded->Constructed->Errored Thaumcraft{4.1.0e} [Thaumcraft] (bin) Unloaded->Constructed->Pre-initialized ThaumicTech{pre-alfa} [Technological Magic:Thaumcraft] (bin) Unloaded->Constructed->Errored 2014-07-04 09:07:58 [sEVERE] [ForgeModLoader] The following problems were captured during this phase 2014-07-04 09:07:58 [sEVERE] [ForgeModLoader] Caught exception from TechnologicalMagic java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP at Technomage3.both.Blocks.TMBlocks.blockInit(TMBlocks.java:87) at Technomage3.both.TechnologicalMagic.preInit(TechnologicalMagic.java:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:545) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112) at cpw.mods.fml.common.Loader.loadMods(Loader.java:522) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityClientPlayerMP at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 34 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/entity/EntityClientPlayerMP for invalid side SERVER at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:274) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:172) ... 36 more 2014-07-04 09:07:58 [iNFO] [sTDERR] cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.transition(LoadController.java:156) 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:523) 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) 2014-07-04 09:07:58 [iNFO] [sTDERR] at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) 2014-07-04 09:07:58 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445) 2014-07-04 09:07:58 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2014-07-04 09:07:58 [iNFO] [sTDERR] Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP 2014-07-04 09:07:58 [iNFO] [sTDERR] at Technomage3.both.Blocks.TMBlocks.blockInit(TMBlocks.java:87) 2014-07-04 09:07:58 [iNFO] [sTDERR] at Technomage3.both.TechnologicalMagic.preInit(TechnologicalMagic.java:62) 2014-07-04 09:07:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2014-07-04 09:07:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:545) 2014-07-04 09:07:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2014-07-04 09:07:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201) 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181) 2014-07-04 09:07:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2014-07-04 09:07:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2014-07-04 09:07:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112) 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:522) 2014-07-04 09:07:58 [iNFO] [sTDERR] ... 5 more 2014-07-04 09:07:58 [iNFO] [sTDERR] Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityClientPlayerMP 2014-07-04 09:07:58 [iNFO] [sTDERR] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) 2014-07-04 09:07:58 [iNFO] [sTDERR] at java.lang.ClassLoader.loadClass(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] at java.lang.ClassLoader.loadClass(Unknown Source) 2014-07-04 09:07:58 [iNFO] [sTDERR] ... 34 more 2014-07-04 09:07:58 [iNFO] [sTDERR] Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/entity/EntityClientPlayerMP for invalid side SERVER 2014-07-04 09:07:58 [iNFO] [sTDERR] at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) 2014-07-04 09:07:58 [iNFO] [sTDERR] at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:274) 2014-07-04 09:07:58 [iNFO] [sTDERR] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:172) 2014-07-04 09:07:58 [iNFO] [sTDERR] ... 36 more 2014-07-04 09:07:58 [sEVERE] [Minecraft-Server] Encountered an unexpected exception LoaderException cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP at cpw.mods.fml.common.LoadController.transition(LoadController.java:156) at cpw.mods.fml.common.Loader.loadMods(Loader.java:523) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP at Technomage3.both.Blocks.TMBlocks.blockInit(TMBlocks.java:87) at Technomage3.both.TechnologicalMagic.preInit(TechnologicalMagic.java:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:545) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112) at cpw.mods.fml.common.Loader.loadMods(Loader.java:522) ... 5 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityClientPlayerMP at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 34 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/entity/EntityClientPlayerMP for invalid side SERVER at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:274) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:172) ... 36 more 2014-07-04 09:07:58 [sEVERE] [Minecraft-Server] This crash report has been saved to: C:\Users\Jeneale\Desktop\Ryan\Minecraft\Making mods\forge-1.6.4-9.11.1.965 Mods (MCP 811)\forge-1.6.4-9.11.1.965-WardingStones\forge\mcp\jars\.\crash-reports\crash-2014-07-04_09.07.58-server.txt 2014-07-04 09:08:12 [iNFO] [Minecraft-Server] Stopping server 2014-07-04 09:08:12 [iNFO] [Minecraft-Server] Saving worlds 2014-07-04 09:08:12 [sEVERE] [WardingStones] Skipping event FMLServerStoppedEvent and marking errored mod WardingStones since required dependency TechnologicalMagic has errored 2014-07-04 09:08:12 [sEVERE] [ThaumicTech] Skipping event FMLServerStoppedEvent and marking errored mod ThaumicTech since required dependency TechnologicalMagic has errored 2014-07-04 09:08:12 [iNFO] [ForgeModLoader] The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED. Errors may have been discarded. 2014-07-04 09:08:12 [iNFO] [ForgeModLoader] The state engine was in incorrect state ERRORED and forced into state AVAILABLE. Errors may have been discarded. For 1.6.4, I want to send a packet with the right key code from the server to the client, so would I use NetworkHandeler.sendPacketToPlayer(Minecraft.getMinecraft().thePlayer) or NetworkHandeler.sendPacketToAllAround() or NetworkHandeler.sendPacketToAllPlayers() ?
July 4, 201411 yr Author Heres my code: Packet handeler: @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) { NBTTagCompound tag = TN3DataReader.readNBTPacket(packet); switch(tag.getInteger("PacketID")){ case TMPackets.magicPathwayRead: World world = Minecraft.getMinecraft().theWorld; int[] cords = tag.getIntArray("Cords"); TileEntityMagicPathway t = (TileEntityMagicPathway) world.getBlockTileEntity(cords[0], cords[1], cords[2]); t.readFromNBT(tag.getCompoundTag("ToRead")); } } TileEntity readFromNBT(): @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); name = compound.getString("Name"); NBTTagList items = compound.getTagList("Items"); for (int i = 0; i < items.tagCount(); i++) { NBTTagCompound item = (NBTTagCompound)items.tagAt(i); int slot = item.getByte("Slot"); if (slot >= 0 && slot < getSizeInventory()) { setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(item)); } } onInventoryChanged(); if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){ NBTTagCompound toSend = new NBTTagCompound(); toSend.setCompoundTag("ToRead", compound); toSend.setIntArray("Cords", new int[] {xCoord, yCoord, zCoord}); PacketDispatcher.sendPacketToAllPlayers(TN3DataWriter.getNBTPacket(TMPackets.magicPathwayRead, ModInfo.chanel, toSend)); } } getNBTPacket() and readNBTPacket(): public static Packet250CustomPayload getNBTPacket(int id, String channel, NBTTagCompound nbt){ ByteArrayOutputStream ex = new ByteArrayOutputStream(); DataOutputStream cData = new DataOutputStream(ex); ex.write(id); try { NBTTagCompound.writeNamedTag(nbt, cData); cData.writeInt(cData.size()); cData.close(); } catch (IOException var4) { FMLLog.severe("TN3DataWriter: " + var4.getMessage(), new Object[0]); } Packet250CustomPayload p = new Packet250CustomPayload(); p.channel = channel; p.data = ex.toByteArray(); p.length = ex.toByteArray().length; return p; } public static NBTTagCompound readNBTPacket(Packet250CustomPayload packet){ ByteArrayInputStream input = new ByteArrayInputStream(packet.data); DataInputStream data = new DataInputStream(input); int id = 0; try { id = data.readByte(); } catch (IOException e) { e.printStackTrace(); } NBTTagCompound nbt = null; try { int e = data.readInt(); byte[] bytes = new byte[e]; data.read(bytes); NBTTagCompound compound = new NBTTagCompound(); ByteArrayInputStream is = new ByteArrayInputStream(bytes); DataInputStream di = new DataInputStream(is); NBTBase base = NBTTagCompound.readNamedTag(di); if (base instanceof NBTTagCompound) { nbt = (NBTTagCompound)base; } } catch (IOException var8) { FMLLog.severe("AMDataReader getNBTTagCompound(): " + var8.toString(), new Object[0]); var8.printStackTrace(); } nbt.setInteger("PacketID", id); return nbt; }
July 4, 201411 yr Author It still won't work though!!! Update: I added print statements, and I'm sending the packets, but I'm never recieveing them. Does anyone know why? Main mod class: package Technomage3.both; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import Technomage3.both.AncientSpells.AncientSpellStaff; import Technomage3.both.AncientSpells.AncientSpells; import Technomage3.both.Blocks.TMBlocks; import Technomage3.both.Blocks.tileentities.TileEntityMageForge; import Technomage3.both.Blocks.tileentities.TileEntityMagicPathway; import Technomage3.both.Blocks.tileentities.recipies.MageForgeRecipie; import Technomage3.both.Common.ChatHandeler; import Technomage3.both.Common.TMEventHandeler; import Technomage3.both.Config.TMConfigHandeler; import Technomage3.both.Entities.TMEntities; import Technomage3.both.Interfaces.TMGUIHandeler; import Technomage3.both.Items.TMItems; import Technomage3.both.Network.TMPacketHandeler; import Technomage3.both.Proxies.TMCommonProxy; import Technomage3.both.Spell.SpellComponents; import Technomage3.both.Spell.SpellIconRegisterer; import Technomage3.both.World.TMGenerationHandeler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; @Mod(modid = ModInfo.id, name = ModInfo.name, version = ModInfo.version) @NetworkMod(channels = {ModInfo.channel}, clientSideRequired = true, serverSideRequired = false, packetHandler = TMPacketHandeler.class) public class TechnologicalMagic { @SidedProxy(clientSide = "Technomage3.both.Proxies.TMClientProxy", serverSide = "Technomage3.both.Proxies.TMCommonProxy") public static TMCommonProxy proxy; public boolean hasPerformedSucesfulLoad = false; @Instance(ModInfo.id) public static TechnologicalMagic instance; @EventHandler public void preInit(FMLPreInitializationEvent event) { TMConfigHandeler.init(event.getSuggestedConfigurationFile()); if(event.getSide() == Side.CLIENT) MinecraftForge.EVENT_BUS.register(new SpellIconRegisterer()); proxy.initRenderers(); proxy.initSounds(); NetworkRegistry.instance().registerChannel(new TMPacketHandeler(), ModInfo.channel); TMItems.init(); TMBlocks.blockInit(); TMEntities.init(); AncientSpells.init(); //SpellComponents.register(); } @EventHandler public void load(FMLInitializationEvent event) { addCraftingRecipies(); GameRegistry.registerWorldGenerator(new TMGenerationHandeler()); MinecraftForge.EVENT_BUS.register(new ChatHandeler()); MinecraftForge.EVENT_BUS.register(new TMEventHandeler()); new TMGUIHandeler(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } private static void addCraftingRecipies() { addMageForgeRecipies(); GameRegistry.addRecipe(AncientSpellStaff.getStaff(AncientSpells.teleport), " A ", " B ", " B ", 'A', Item.diamond, 'B', Item.blazeRod ); } private static void addMageForgeRecipies() { TileEntityMageForge.addRecipie( new MageForgeRecipie( new ItemStack(TMItems.metoroticIron), new ItemStack(Item.diamond), new ItemStack(TMItems.clestialCrystal), new ItemStack(Item.blazeRod), new ItemStack(Item.enderPearl), 100, 0, new ItemStack(TMItems.brightSteel)) ); } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.