I'd got some kind of anomaly during creation of my Forge 1.12.2 modification.
Short description: world.isRemote somehow returns true on server side.
Long description:
I have a class which extends Entity. I have put logic into onUpdate function and I was suprised when I figured out that this method is called on client side. I have added check to make sure that my logic is performed on server side. However, this check always fails. I have decided to test if I had accidentally called
world.spawnEntity
on client side (which is impossible!), so I put
logger.info(world.isRemote);
after that line (btw, what is the best method for testing?).
This check has returned "true", what means that it was executed at the client side, but console thread says that this text was printed from server thread. I am feeling competely lost.
The only one my proposition is that the problem is that I am using common logger for client and server sides, but I have never seen such
Github repository: https://github.com/mystery-coder/Souls-Industry/tree/dev
Problematical code parts:
forgemod.mystery.soulsindustry.tile.TileLamp.consume(...)
(Event is called from TickEvent.ServerTickEvent handler),
forgemod.mystery.soulsindustry.entity.EntityWisp.onUpdate()
Any help would be appreciated.