Posted July 10, 201312 yr 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 This is the creator of the Rareores mod! Be sure to check it out at
July 10, 201312 yr Author That in a coremod? If not that may be your problem. What? I don't get what you are saying, please explain? This is the creator of the Rareores mod! Be sure to check it out at
July 11, 201312 yr Author 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. This is the creator of the Rareores mod! Be sure to check it out at
July 27, 201312 yr Maybe you should write the reflection code instead of relying on that ObfuscationReflexionHelper.
July 27, 201312 yr 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.
August 3, 201312 yr Author 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. This is the creator of the Rareores mod! Be sure to check it out at
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.