Home » » Player API 1.5.2 for Minecraft 1.5.2/1.6

Player API 1.5.2 for Minecraft 1.5.2/1.6



Player API is an API which gives mods access to the EntityPlayer class while minimizing conflicts between mods. To make a player API mod simpl a class that extends PlayerBase (much like extending BaseMod) and register with PlayerAPI.RegisterPlayerBase(PlayerBaseExample.class); in your mod_ file constructor. An example PlayerBaseMoods is included in the download.
Player API is an API which provides access to the client class “EntityPlayerSP” aka “bag” or the server class “EntityPlayerMP” aka iq” or the bukkit class “EntityPlayer” while minimizing conflicts between mods. This Player API is compatible with Minecraft Forge, just install Player API after Minecraft Forge.
Player API 1.4.7
Step by Step: Mod Adaption
One scenario of starting to develop with this mod is that you have a fully functional mod that overwrites theclient/server main player class, and you want your mod to be compatible with other mods that are allready using Player API.
In this case the following steps are recommended:
  • Outsource your mod specific code from EntityPlayerSP.java/EntityPlayerMP.java into a new mod specific class you create a single instance for each instance of the EntityPlayer class so that only the mod class field, some hook methods and some field accessors remain in EntityPlayerSP.java/EntityPlayerMP.java.
  • make sure your mod works correctly.
  • Embedd Player API into your development environment (in case of MCP that means to decompile the Player API classes using the MCP decompiling system)
  • In case of MCP replace your modded EntityPlayerSP.java with the EntityPlayerSP.java from Player APIclient. (and import all other Player API client classes)
    • Let your specific mod class extend the PlayerBase class
    • Make sure your mod class is registered at the PlayerAPI class before the first player instance is created. (a ModLoader mod would be a good choice here)
    • Adapt all your hook listeners in your mod class to overwrite their corresponding PlayerBase methods.
    • Adapt all your field accessor references with references to PlayerAPI field accessors.
  • Check whether required hooks are missing and send me a private message containing the the corresponding EntityPlayerSP/EntityPlayerMP method names (and wait until I updated Player API) if necessary.
  • Make sure your mod works correctly.
Step by Step: Mod Creation
Another scenario is that you want to develop a new mod with Player API.
In this case the following steps are recommended:
  • Embedd Player API into your development environment (in case of MCP that means to decompile the Player API classes using the MCP decompiling system)
  • Start creating a new class that extends your Player API’s PlayerBase class.
  • Make sure your mod’s PlayerBase class is registered at the PlayerAPI class before the first player instance is created. (a ModLoader mod would be a good choice here)
  • Overwrite the PlayerBase methods you need to make your mod work.


Player API 1.5.2 Step by Step Guide

  1. Go to the appdata folder and navigate to .minecraft/bin
  2. Open minecraft.jar in WinZip, WinRar or 7Zip
  3. Drag the three clas file from Player APi into the jar
  4. Delete the META-INF folder if you haven’t already



0 comments:

Post a Comment

popads