Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi everybody! (crowd: Hi doctor Nick!)

 

Well, I wanted to create some other material from which I could craft tools.

 

I don't want my new material to have the exact same properties as any of the other tool materials (wood, stone, iron, gold and diamond ). I'd like to customize things such as the combining the enchantability of gold with the max uses of diamond. Or even making it even more enchantable than gold. Basically, I'd like to have my own arbitrary values for my tool material properties.

 

Since I can't extend an Enum (and EnumToolMaterial is an Enum), I was thinking of extending each and every tool item (ItemSword, ItemSpade, ItemAxe, etc) with a version for my material (MyMaterialItemSword, MyMaterialItemSpade, etc) and then I would override any method that would make use of EnumToolMaterial. That's a very cumbersome approach, and some of those methods are really complicated, such as:

 

boolean ItemTool.getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)

 

That method is used in a most cryptic way by the unreadable method net.minecraft.inventory.ContainerRepair.updateRepairOutput()

 

So I have no idea of how to override ItemTool.getIsRepairable(...) just to mention one.

There must be a better way to simulate your own materials. Has anyone done that before? Any help is much appreciated.

 

Thanks in advance.

WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons

  • Author

MinecraftForge comes with the EnumHelper class which allows you to add new enum instances by using dirty reflection tricks.

You can create a new EnumToolMaterial with it.

 

That sounds just perfect! I'll look into that as soon as I have the time. Got to finish some homework and then get ready for school. Thank you diesieben07 and thank you Forge for what sounds like a neat feature.

WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.