Jump to content

Recommended Posts

Posted

I want to edit the ToolMaterial on an item arbitrarily, is there any function that can update the ToolMaterial after it's been registered, or any method of working around this?

Posted

From the end of that post, it seems that reflection is only really needed for efficiency and harvest level?  What's the call for attack damage?  But that's very useful anyway, thanks for that.  :D

Posted

My material is created and registered in Main.class, so would I want

 

ReflectionHelper.setPrivateValue(Main.class, Main.material, x, y);

 

because when I try to do that, setPrivateValue errors, saying

 

The method setPrivateValue(Class<? super T>, T, E, int) in the type ReflectionHelper is not applicable for the arguments (Class<Main>, Item.ToolMaterial, float, int)

 

One more thing, when I do the field listing for Main, it doesn't give the fields for the tool material, just the tool material itself.

Posted

In this case you should use a Material as the second-to-last argument, not a float, since you are setting a Material variable.

You Only Live Once, So Win At Golf.

Sorry for my English, I'm American.

Posted

Do you mean that I should create a new ToolMaterial with the modified values and give it as the second to last argument?  That gives the same error, with Item.ToolMaterial instead of Float.

  • 2 weeks later...
Posted

You're not supplying it with the correct arguments. That's why it's "not applicable for the arguments".

-Mitchellbrine

 

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

I don't want your charity, I want your information

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.