Okay. I've been working with Forge for a number of weeks now, slowly losing my sanity through exposure to the eldritch abominations in Minecraft's internal workings. For the most part, things are going pretty well, but I've finally hit a problem that several days of Googling and JavaDoc surfing and even reverse engineering has not yet solved.
My mod requires, client-side, some information that's only available server side. There are two classes of information it requires: static information, such as an entity's real persistent ID (not the "persistent" ID the client already has, which isn't even consistent over a single play session); and dynamic information, such as whether a Zombie Pigman is currently angry, or a Villager is currently playing.
For the static information, I have a simple protocol in place where the client requests the information the first time it's needed. That will not, however, work for the dynamic information. What I need is to perform my own synchronization in parallel with the normal entity sync process. This will require hooking into something so that I know which clients are currently interested in which entities. Unfortunately, aside from a vague idea that this will involve the
EntityTracker
class, I have no idea how to proceed.
Heck, I can't even figure out the best way to communicate about a specific entity. I haven't found a
getEntityById
-type method method anywhere but in
World
, and I can't seem to communicate a specific
World
---I tried going by dimension ID, but
DimensionManager.getWorld(...)
always seems to return
null
on the client in proper multiplayer (but not fake multiplayer, i.e. singleplayer?), despite the fact that the
Entity
instances somehow know what dimension they belong in... sigh.
Any help is appreciated greatly.