GL has a number of capabilities that can be enabled or disabled. Before you actually render anything you may need to change several of these. After you are done rendering, you should disable any capabilities you enabled and enable any capabilities you disabled. Doing this prevents strange behaviour when something else is rendered. The call to
enableLighting()
is present after OP finishes rendering because they called
disbleLighting()
before they started rendering.
Does it really matter if he calls GLStateManager.pushMatrix() and GLStateManager.popMatrix() though?
Why are you sending the packet there? You should be sending it after changing the value and did you update your registry to say Side.CLIENT instead of Side.SERVER?
Two things, when you register your packet it needs to be Side.CLIENT because the client should be receiving the packet and you will need to send this packet as shown in diesiebens tutorial everytime you change the mana.
Why is "cover" an [] and why are you writing "variant=oak".... take a look at the docs.
http://mcforge.readthedocs.io/en/latest/blockstates/forgeBlockstates/
You should be sending the message to the client and you just copied the code diesieben made... Look at that nice comment he left
// or Minecraft.getMinecraft() on the client
Plus you never check if the player has your capability anymore. Last thing I would name your message something like ManaSyncMessageClient. This way you know that it is a client recieved message and what it does specifically.
No not like that if you look at the tutorials message handler implementation you will see he uses a IThreadListener. This is because the game has its own thread and the network has its own thread. Also you should have a setMana method in your capability somewhere to do this. One last thing did you really make a IMessage implementation called Messages?
Packet#toBytes() is your write and Packet#fromBytes() is your read. So
ByteBufUtils.writeVarInt(to, toWrite, maxSize);
ByteBufUtils.readVarInt(buf, maxSize);
// OR
buf.writeInt(value);
buf.readInt();
It is indeed a networking thing, you will need to use packets. But don't worry packets are easy. Diesieben has a great tutorial on them and the network itself.
http://www.minecraftforge.net/forum/index.php?topic=20135.0
It is because you are using the IItemPropertyGetter inside your constructor, so the players spawn point wont change, because the constructor is only called once.
Your code won't work because you are checking to see if the worlds version of the te is invalid. Really the simplest way to do this would be to loop through like you are, but without the invalid check and only add. (Side note why do you need a map? The TE stores its BlockPos). Once you have added them check through the currently a map for TEs that are invalid. Or check if the TE still exists in the World by doing World#getTileEntity(listTE.getPos()) != null. Or similar.