Ernio Posted June 25, 2015 Share Posted June 25, 2015 So I kinda touched piece of code I wrote long ago. Anyway: player.openGui, when called on: (logical side) * Client = will ONLY call #getClientGuiElement * Server = will call #getServerGuiElement and send packet to client that will call #getClientGuiElement. Yeah, all cool, so what's the problem? Try calling player.openGui in PlayerEvent.PlayerLoggedInEvent. Logically - it SHOULD open gui on client (given client has gui assigned to proper id). It doesn't. At first i though that maybe someone forgot about thread safety, but nope (OpenGuiHandler) - it is there. So question arises: Why does this work: @SubscribeEvent public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { Network.sendTo(new PacketSendGui((byte) 1), (EntityPlayerMP) event.player); } @Override public IMessage handleClientMessage(final EntityPlayer player, final PacketSendGui message, MessageContext ctx) { Minecraft.getMinecraft().addScheduledTask(new Runnable() { public void run() { player.openGui(RoAMain.instance, message.id, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); } }); return null; } And this doesn't: public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { event.player.openGui(Main.instance, 1, event.player.worldObj, (int) event.player.posX, (int) event.player.posY, (int) event.player.posZ); } I mean - it's literally same routine. <Looks at Guru diesieben> Quote 1.7.10 is no longer supported by forge, you are on your own. Link to comment Share on other sites More sharing options...
Ernio Posted June 26, 2015 Author Share Posted June 26, 2015 http://images-cdn.9gag.com/photo/azbp0MB_460sa_v1.gif[/img] Jesus christ. I totally missed that for the packet to actually be sent server->client - you need to NOT return null o server... Quote 1.7.10 is no longer supported by forge, you are on your own. Link to comment Share on other sites More sharing options...
Recommended Posts
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.