Posted March 8, 20169 yr @SubscribeEvent public void entityJoinWorld(EntityJoinWorldEvent e) { ExtendedProperties data = null; if(e.entity instanceof EntityPlayerMP && LightDrafter.proxy.getWorld() != null) data = ExtendedProperties.get((EntityPlayer) e.entity); if (data != null) data.entitySpawned(); } CommonProxy public World getWorld() { return FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0]; } ClientProxy @Override public World getWorld() { return Minecraft.getMinecraft().theWorld; } In SMP this is catching only once and it is catching before the server has a world instance, which is stopping me from syncing player IEEP info. What can I do to trigger data.entitySpawned() when the server finishes loading? Current Project: Armerger Planned mods: Light Drafter | Ore Swords Looking for help getting a mod off the ground? Coding | Textures
March 8, 20169 yr you shouldnt be getting the world the way you do it there.. in most of the cases u want to be using the world the entity is in and not the overworld.
March 8, 20169 yr @SubscribeEvent public void entityJoinWorld(EntityJoinWorldEvent e) { if (e.entity instanceof EntityPlayer && !e.entity.worldObj.isRemote) // can be replaces by if (e.entity instanceof EntityPlayerMP) ExtendedProperties.get((EntityPlayer) e.entity).entitySpawned(); } That is all it takes. You don't need IEEP null check nor ANY "proxyfication" of code. For future: * Learn what Proxy does - there is difference between logical (world.isRemote) and application side (client.jar / dedic.jar). * Don't ever get world that way. 1.7.10 is no longer supported by forge, you are on your own.
March 8, 20169 yr Author After a little debugging this is now updating the player on join, thanks for the help! Current Project: Armerger Planned mods: Light Drafter | Ore Swords Looking for help getting a mod off the ground? Coding | Textures
March 11, 20169 yr Is EntityJoinWorldEvent, a server side event, or will the client fire this event upon joining a multiplayer server?
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.