Posted October 18, 201312 yr I was trying out the IExtendedProperties for my mod when i started crashing well calling an instance in my class. I have been using this tutorial to http://www.minecraftforum.net/topic/1952901-eventhandler-and-iextendedentityproperties/ my error log is here: http://gw.minecraftforge.net/tRpo the lines of code in there error log: at com.jdb100.mod.player.ExtendedPlayerProperties.<init>(ExtendedPlayerProperties.java:42) this.currentMana = SpiritBase.instance.getMana(); at com.jdb100.mod.player.ExtendedPlayerProperties.register(ExtendedPlayerProperties.java:52) public static final void register(EntityPlayer player) { player.registerExtendedProperties(spirit, new ExtendedPlayerProperties(player)); } at com.jdb100.mod.events.EntityConstructingEvent.onEntityConstructing(EntityConstructingEvent.java:23) ExtendedPlayerProperties.register((EntityPlayer) event.entity); at com.jdb100.mod.player.ExtendedPlayerProperties.get(ExtendedPlayerProperties.java:57) return (ExtendedPlayerProperties) player.getExtendedProperties(spirit); at com.jdb100.mod.core.tech.SpiritBase.<init>(SpiritBase.java:10) ExtendedPlayerProperties props = ExtendedPlayerProperties.get(Core.mc.thePlayer); at com.jdb100.mod.core.tech.SpiritBase.<clinit>(SpiritBase.java:9) public static SpiritBase instance = new SpiritBase(); sorry i dont like doing this but since i am a noob with this topic i cant figure it out Creator of Jobo's ModLoader If I helped you could you please click the thank you button and applaud my karma.
October 18, 201312 yr public static SpiritBase instance = new SpiritBase(); If you have @Instance("modid"), you don't need to initialize. ExtendedPlayerProperties props = ExtendedPlayerProperties.get(Core.mc.thePlayer); What do you do with this ? Do you expect Core.mc.thePlayer to be a player, without any player being connected yet ? At best, "props" is going to be null. Then i suppose you registered your EntityContrusctionEvent class.
October 18, 201312 yr Looks like 'SpiritBase' is your mod? Why are you using your mod instance to getMana()? Shouldn't mana be from each instance of an EntityPlayer or some other Entity, rather than what looks like a static method with no parameters? Additionally, it looks like you're trying to make a call to getMana() in the constructor for the IExtendedEntityProperties, which is called while the parent entity is still loading - like GotoLink said, whatever player object you get at this point will not work. http://i.imgur.com/NdrFdld.png[/img]
October 18, 201312 yr Author Sorry for not being clear but my main mod file is called core which has an instance of minecraft i am calling to get the player. I get the instance using this method: Minecraft.getMinecraft(); Then I have a file that is called SpiritBase which holds all of the math calculation that I have the instance that I use to call all the math. From what I can tell is that it is probably with how I call the player or how I call the instance of SpiritBase. Creator of Jobo's ModLoader If I helped you could you please click the thank you button and applaud my karma.
October 18, 201312 yr I'd bet you anything that Core.mc.thePlayer is null. Drop that shit, you don't need it at all. Then Minecraft.getMinecraft() is client-side only. So drop it too, unless you don't want to be server compatible.
October 19, 201312 yr Author K i will try that soon and tell you if it works so i should just not use minecraft to get the player just use EntityPlayer. Creator of Jobo's ModLoader If I helped you could you please click the thank you button and applaud my karma.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.