Noah_Beech Posted July 10, 2013 Posted July 10, 2013 When updating to 1.6.2, an old variable I used to use was changed from public to private, landSpeedFactor. Hopefully I wold be able to use reflection to modify it accordingly, but I can't seem to get it to work. if(player.inventory.hasItem(mod_rareores.ItemEmblemFlight.itemID)){ landMovementFactor = landMovementFactor > 0.001F ? landMovementFactor : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityLivingBase.class, player, "landMovementFactor", "field_70746_aG"); landMovementFactor *=1.45; ObfuscationReflectionHelper.setPrivateValue(EntityLivingBase.class, player,landMovementFactor ,"landMovementFactor", "field_70746_aG"); player.jumpMovementFactor *=1.45; System.out.println(landMovementFactor); } The above code is what I did from what I know, I asked around on the IRC and everyone said they couldn't find a problem. Help is appreciated, thanks in advance! ~Noah Quote This is the creator of the Rareores mod! Be sure to check it out at
Chibill Posted July 10, 2013 Posted July 10, 2013 That in a coremod? If not that may be your problem. Quote
Noah_Beech Posted July 10, 2013 Author Posted July 10, 2013 That in a coremod? If not that may be your problem. What? I don't get what you are saying, please explain? Quote This is the creator of the Rareores mod! Be sure to check it out at
Noah_Beech Posted July 11, 2013 Author Posted July 11, 2013 Anyone know how to deal with a reflection problem as such? I haven't been able to figure much out and this is the only thing preventing me from updating to 1.6.2. And NO, no speed potion effect, I MUST use landMovementFactor solely because the code is ran each tick and other variables would be multiplied exponentially high because they are not reset every tick, however landmovementfactor does and it makes for a perfect variable to work with since it increases speed exactly the way you need it. Quote This is the creator of the Rareores mod! Be sure to check it out at
GamerAndAHalf Posted July 27, 2013 Posted July 27, 2013 Have you figured it out yet? I am having the same problem. Quote
GotoLink Posted July 27, 2013 Posted July 27, 2013 Maybe you should write the reflection code instead of relying on that ObfuscationReflexionHelper. Quote
GamerAndAHalf Posted July 27, 2013 Posted July 27, 2013 I was messing around in the code and I don't think that movement uses that variable anymore. With the new attribute system it uses attribute modifiers. I just edited the entityplayer base class as I have changed it a bit already due to the fact it adds in a whole new system. Quote
Noah_Beech Posted August 3, 2013 Author Posted August 3, 2013 If you are wondering the reflction was working, but the attribute system is giving me a few crude issues that I want to iron out. Quote This is the creator of the Rareores mod! Be sure to check it out at
Recommended Posts
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.