Jump to content

Recommended Posts

Posted

java.lang.ArrayIndexOutOfBoundsException: 5
at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19) ~[forgeSrc-1.9-12.16.0.1858-1.9.jar:?]
at ...

 

Error is caused by a subclass of ItemAxe calling super(custom material)

 

Sword, Shovel and Pickaxe work fine.

Posted

You say this like I don't know it.

There should be no reason mods need to explicitly subclass ItemAxe, any item can be an axe, that class means nothing. Just subclass tool and do it yourself.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

There should be no reason mods need to explicitly subclass ItemAxe, any item can be an axe, that class means nothing. Just subclass tool and do it yourself.

 

So, its better to add all the axes to the ore dictionary than to add an if statement/alternative constructor? What is the point of object-orientation if you are not going to use it?

 

I fail to see how expecting to be able to have an axe extend ItemAxe, only to have it error is the fault of the modder, and not forge itself.

Posted

Again this is something that nobody has actually bothered to actually look into.

But what is the POINT of extending the ItemAxe?

Forge already has hooks in place to define what type of tool the item is, no matter what class it is.

So why do you need to extend this specific class.

I have yet to hear a SINGLE argument besides 'My 1.8 code errors in 1.9!!!!!!'

I'm not against adding a bypass constructor. But I need someone to articulate WHY beyond just bitching.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Forge already has hooks in place to define what type of tool the item is, no matter what class it is.

 

Oh, I see. I was just assuming that "an Axe is determined as anything that extends ItemAxe". I take it I would have to simply override getToolClasses?

 

I take it that this issue is why the constructor for ItemAxe is protected?

 

However, I think that the ability to create an axe without needing to add any more classes would be reason enough to add a second, public constructor. At least make ItemAxe final, to prevent this sort of issue from happening.

Posted

You can make an axe without making "any new classes".

 

Item myAxe = new Item();
myAxe.setHarvestLevel("axe", 3); // for diamond, see the javadocs for other values

 

I... did not know about that. Is that new in 1.9?

 

Still, I think that ItemAxe should be changed as not to error, or simply be final, so that people don't continuously make the same mistake that I did.

Posted

I... did not know about that. Is that new in 1.9?

 

No.

 

It looks like the current version of the harvest tool system was added in 1.7.2; but there was a slightly different version of the same system in place before that.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.