Posted June 27, 201312 yr so... could any1 eplain this to me: okay you know in the function "handle(INetworkManager manager, Packet250CustomPayload packet, Player player)" cast the Player reference to a EntityPlayerMP and its THIS reference to write stuff to the nbt i have thepackethandler but what does he mean by saying: cast the Player reference to a EntityPlayerMP and its THIS reference to write stuff to the nbt
June 28, 201312 yr Casting in a nutshell: String sNumber = (String)number; would cast the int number to a string object called sNumber; so probably ... player = (EntityPlayerMP)player; ... this might work but I'm unfamiliar with the relationship between Player and EntityPlayerMP. (you shouldn't cast anything in a nutshell, it's a tight space and you could hurt someone...)
June 28, 201312 yr the object type Player is pretty much just an empty object, I think that maybe it is used over EntityPlayer as there is not always a player involved... or something, you probably wont ever have to worry about this, just cast it. Anyway packet handling:https://github.com/Yagoki/MTech/blob/master/MTech/mtech/handler/packet/MyPacketHandler.java github
June 28, 201312 yr @OP can i at least be quoted properly ?, specially if you're making a whole new thread for this. how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
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.