Jump to content

Player Speed issues. (dealing with reflection)


Noah_Beech

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 weeks later...

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.