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

Crafting table gui doesn't open


BlazeAxtrius
 Share

Recommended Posts

So now that I fixed my rails.

I tried to fix the crafting table but the Gui doesn't open.

 

Here is the GitHub page : https://github.com/BlazeAxtrius/ExpandedRailsMod/tree/master/src/main/java/com/expanded/rails/mod/gui

 

The Crafting Table : https://github.com/BlazeAxtrius/ExpandedRailsMod/tree/master/src/main/java/com/expanded/rails/mod/blocks

 

I tried a lot of tutorials and stuff but they didn't work.

Link to comment
Share on other sites

Sorry to say but seriously, your code is huge fu**ing mess. In your main mod class you do not register a GuiHandler (it's commented). Do you register one anywhere else? If not, that is your problem.

 

You shouldn't be sorry. I build this mod with a friend of mine just by watching tutorials.

After we made it I had to update it on my own cause he didn't want to.

And since I have absolutely no time, I try to fix everything as fast as possible, just so it can work for every version in minecraft.

 

Do i have to register it in the ClientProxy? because I only registered it in mod class.

Link to comment
Share on other sites

Register it in the main mod class.

 

It is registered in the main mod class.

 

public GuiHandlerRailsCraftingTable guiHandlerRailsCraftingTable = new GuiHandlerRailsCraftingTable(); 
NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandlerRailsCraftingTable);

 

Also I saw this "player.openGui(TutorialMain.instance, 3, world, (int) player.posX, (int) player.posY, (int) player.posZ);"

 

I don't have anything like that. Should I have it and where do I have to put it?

Link to comment
Share on other sites

 

Oh yeah sorry didn't check that class for it.

I removed the "NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandlerRailsCraftingTable);"

Doesn't really do anything as you said but I still don't get why the gui can't open.

Link to comment
Share on other sites

[me=diesieben07]bangs head against wall[/me]

 

Yes, you DO need the call to registerGuiHandler. Of course you do.

 

Ok, I managed to make it open but the game crashes with this error:

 

 

Exception caught executing FutureTask: java.util.concurrent.ExecutionException: net.minecraft.util.ReportedException: Ticking player

java.util.concurrent.ExecutionException: net.minecraft.util.ReportedException: Ticking player

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.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:655) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:598) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:164) [integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_31]

Caused by: net.minecraft.util.ReportedException: Ticking player

at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:394) ~[EntityPlayerMP.class:?]

at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:326) ~[NetHandlerPlayServer.class:?]

at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:33) ~[C03PacketPlayer.class:?]

at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:93) ~[C03PacketPlayer.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:?]

... 5 more

Caused by: java.lang.NullPointerException

at net.minecraft.world.World.isValid(World.java:216) ~[World.class:?]

at net.minecraft.world.World.getBlockState(World.java:822) ~[World.class:?]

at com.expanded.rails.mod.gui.ContainerRailsCraftingTable.canInteractWith(ContainerRailsCraftingTable.java:122) ~[ContainerRailsCraftingTable.class:?]

at net.minecraftforge.event.entity.player.PlayerOpenContainerEvent.<init>(PlayerOpenContainerEvent.java:27) ~[PlayerOpenContainerEvent.class:?]

at net.minecraftforge.common.ForgeHooks.canInteractWith(ForgeHooks.java:487) ~[ForgeHooks.class:?]

at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:295) ~[EntityPlayer.class:?]

at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:340) ~[EntityPlayerMP.class:?]

at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:326) ~[NetHandlerPlayServer.class:?]

at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:33) ~[C03PacketPlayer.class:?]

at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:93) ~[C03PacketPlayer.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:?]

... 5 more

[19:19:07] [server thread/ERROR]: Encountered an unexpected exception

net.minecraft.util.ReportedException: Ticking entity

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:709) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:598) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:164) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_31]

Caused by: java.lang.NullPointerException

at net.minecraft.world.World.isValid(World.java:216) ~[World.class:?]

at net.minecraft.world.World.getBlockState(World.java:822) ~[World.class:?]

at com.expanded.rails.mod.gui.ContainerRailsCraftingTable.canInteractWith(ContainerRailsCraftingTable.java:122) ~[ContainerRailsCraftingTable.class:?]

at net.minecraftforge.event.entity.player.PlayerOpenContainerEvent.<init>(PlayerOpenContainerEvent.java:27) ~[PlayerOpenContainerEvent.class:?]

at net.minecraftforge.common.ForgeHooks.canInteractWith(ForgeHooks.java:487) ~[ForgeHooks.class:?]

at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:231) ~[EntityPlayerMP.class:?]

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1865) ~[World.class:?]

at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:732) ~[WorldServer.class:?]

at net.minecraft.world.World.updateEntity(World.java:1835) ~[World.class:?]

at net.minecraft.world.World.updateEntities(World.java:1664) ~[World.class:?]

at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:571) ~[WorldServer.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703) ~[MinecraftServer.class:?]

... 4 more

[19:19:07] [server thread/ERROR]: This crash report has been saved to: C:\Users\BlazeAxtrius\Desktop\Minecraft\finallllll8\eclipse\.\crash-reports\crash-2015-02-16_19.19.07-server.txt

[19:19:07] [server thread/INFO]: Stopping server

[19:19:07] [server thread/INFO]: Saving players

[19:19:07] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: ---- Minecraft Crash Report ----

// Quite honestly, I wouldn't worry myself about that.

 

Time: 2/16/15 7:19 PM

Description: Ticking entity

 

java.lang.NullPointerException: Ticking entity

at net.minecraft.world.World.isValid(World.java:216)

at net.minecraft.world.World.getBlockState(World.java:822)

at com.expanded.rails.mod.gui.ContainerRailsCraftingTable.canInteractWith(ContainerRailsCraftingTable.java:122)

at net.minecraftforge.event.entity.player.PlayerOpenContainerEvent.<init>(PlayerOpenContainerEvent.java:27)

at net.minecraftforge.common.ForgeHooks.canInteractWith(ForgeHooks.java:487)

at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:231)

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1865)

at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:732)

at net.minecraft.world.World.updateEntity(World.java:1835)

at net.minecraft.world.World.updateEntities(World.java:1664)

at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:571)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:598)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:164)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478)

at java.lang.Thread.run(Unknown Source)

 

 

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

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

 

-- Head --

Stacktrace:

at net.minecraft.world.World.isValid(World.java:216)

at net.minecraft.world.World.getBlockState(World.java:822)

at com.expanded.rails.mod.gui.ContainerRailsCraftingTable.canInteractWith(ContainerRailsCraftingTable.java:122)

at net.minecraftforge.event.entity.player.PlayerOpenContainerEvent.<init>(PlayerOpenContainerEvent.java:27)

at net.minecraftforge.common.ForgeHooks.canInteractWith(ForgeHooks.java:487)

at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:231)

at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1865)

at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:732)

at net.minecraft.world.World.updateEntity(World.java:1835)

 

-- Entity being ticked --

Details:

Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)

Entity ID: 133

Entity Name: Player906

Entity's Exact location: 26.65, 4.00, -95.61

Entity's Block location: 26.00,4.00,-96.00 - World: (26,4,-96), Chunk: (at 10,0,0 in 1,-6; contains blocks 16,0,-96 to 31,255,-81), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)

Entity's Momentum: 0.00, -0.08, 0.00

Entity's Rider: ~~ERROR~~ NullPointerException: null

Entity's Vehicle: ~~ERROR~~ NullPointerException: null

Stacktrace:

at net.minecraft.world.World.updateEntities(World.java:1664)

at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:571)

 

-- Affected level --

Details:

Level name: New World

All players: 1 total; [EntityPlayerMP['Player906'/133, l='New World', x=26.65, y=4.00, z=-95.61]]

Chunk stats: ServerChunkCache: 692 Drop: 0

Level seed: 6370600445184247666

Level generator: ID 01 - flat, ver 0. Features enabled: true

Level generator options:

Level spawn location: 15.00,4.00,-106.00 - World: (15,4,-106), Chunk: (at 15,0,6 in 0,-7; contains blocks 0,0,-112 to 15,255,-97), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)

Level time: 80920 game time, 11985 day time

Level dimension: 0

Level storage version: 0x04ABD - Anvil

Level weather: Rain time: 13695 (now: false), thunder time: 27794 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true

Stacktrace:

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:598)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:164)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478)

at java.lang.Thread.run(Unknown Source)

 

Link to comment
Share on other sites

You call getBlockState with null as the BlockPos. That is because you never initialize "field_178145_h". Again: Just copying and pasting random bits and pieces of code will get you nowhere.

 

I didn't copy bits and pieces. I copied the full code from 1.7.10 to 1.8.

After that I try to fix it.

 

Also considering it worked for 1.7.10 and my horrible java skills. I just try to understand what you mean.

Link to comment
Share on other sites

Ok so i changed the code a little.

Here is the new GitHub https://github.com/BlazeAxtrius/ExpandedRailsMod

 

The problem is that the Gui doesn't open and the game doesn't show any errors.

I saw the GutHub of an other mod and tried to make my crafting table as in the other mod because i know it works there but i just managed to not get the gui again.

Also the purple/black texture disappeared but that is not the main issue.

 

Link to comment
Share on other sites

Can someone please look at my Github and try to see why the GUI doesn't open?

 

Here is the GitHub https://github.com/BlazeAxtrius/ExpandedRailsMod/tree/master/src/main/java/com/expanded/rails/mod

 

The crafting table is in "blocks" folder

The gui and everything about it are in "gui" folder

The IGuiHandler is in the CommonProxy.

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

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