Sunday 20 October 2013

Client-side Class linkage map

The diagram below shows the cross-references between the various Client-side vanilla classes.  For example:
  • Minecraft.thePlayer contains an EntityClientPlayerMP.
  • Entity.worldObj refers to WorldClient
  • WorldClient.loadedTileEntityList contains a collection of TileEntity
The map can be used to find a way to access the particular Class you need, starting with the Classe(s) your code has been provided with.

Minecraft and RenderManager are designed as Singletons (there is only ever one instance of the Class).  They can be accessed by
  • Minecraft.getMinecraft()
  • RenderManager.instance
Minecraft holds an IntegratedServer but this is a server side object and shouldn't be accessed from the client side.  If you do, your code might work when the server and client are on the same computer, however it will almost certainly break when  the client is on a different computer.

Client-side Class Linkage Map for reference between the major vanilla Classes.  Fields which are public are designated by solid arrows; private fields are in curly brackets and have dotted arrows.  Minecraft and RenderManager are accessible using .getMinecraft() and .instance respectively.  IntegratedServer is stored in Minecraft but is actually Server side - i.e. must not be accessed from client side.