public PlayerData getPlayerData(EntityPlayer player) { PlayerData data = (PlayerData) player.getExtendedProperties("CustomNpcsData"); if (data == null) { player.registerExtendedProperties("CustomNpcsData", data = new PlayerData()); data.player = player; data.loadNBTData((NBTTagCompound) null); } return data; }
/** * Used to register these extended properties for the player during EntityConstructing event This * method is for convenience only; it will make your code look nicer */ public static final void register(EntityPlayer player) { player.registerExtendedProperties(ExtendedPlayer.EXT_PROP_NAME, new ExtendedPlayer(player)); }
public static final void register(EntityPlayer player) { player.registerExtendedProperties(EXT_PROP_NAME, new HarvestRodPlayerProps(player)); }
public static final void register(EntityPlayer player) { player.registerExtendedProperties(PlayerResearch.tagName, new PlayerResearch(player)); }