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

Okay so first off I know what I'am trying to do is WRONG you don't have to remind me.

 

One of my mods I'am trying to port from 1.6.4 I had it get the vanilla ores from the block list and set them to null "Block.blocksList[block.oreIron.blockID] = null;" like that, then I re added my own version of the ore with a custom texture etc.. and added it to the forge oreDict. Everything worked out fine no crashes, all the ores I changed worked with every mod etc..

 

I can't seem to figure out how to do the same in [1.7.2].

Since ID's are "gone" now I realize that other mods might not like how I did that before, now. So if I can somehow change the vanilla ore's texture without having to give out a resource pack with my mod, that could work for now if its possable.

 

But I still wouldn't mind figuring out how to do what I did before, now.

 

 

P.S. Sorry if I explained this weird.

  • Author

Well I had some other changes before besides the textures, and  I can work around that kind-of, but I wouldn't mind a built in way to do it instead of a separate resource pack.

Well I had some other changes before besides the textures, and  I can work around that kind-of, but I wouldn't mind a built in way to do it instead of a separate resource pack.

Ok. Well, the Block list no longer exists as it was, but it's much easier since you can access the blocks directly using "Blocks.{block_name}". I suppose you could say that "Blocks" IS "blocksList", just not in array form.

  • Author

Okay so I figured out what I did wrong on how to just change the texture.

But as for completely replacing the block, I got nothing. I probable will end up not needing to do it but it would be nice to learn how it would be done.

Well I had some other changes before besides the textures, and  I can work around that kind-of, but I wouldn't mind a built in way to do it instead of a separate resource pack.

Ok. Well, the Block list no longer exists as it was, but it's much easier since you can access the blocks directly using "Blocks.{block_name}". I suppose you could say that "Blocks" IS "blocksList", just not in array form.

 

however, you can't set them to null, since every field in there is final.

The only way I see here is to utilize ASM transformers and hook into RegistrySimple.getObject(Object par1Obj)

Block.registerBlocks() and replace the constructor calls with your own ones.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

  • Author

however, you can't set them to null, since every field in there is final.

The only way I see here is to utilize ASM transformers and hook into RegistrySimple.getObject(Object par1Obj)

Block.registerBlocks() and replace the constructor calls with your own ones.

 

Yeah I kinda had a hunch I would have to use something like that.. Way over my head xD. I will have to go read up on transformers. But its not in my top list of priorities atm, but Thank you for showing me were to start!

You can still do quite a lot to change the fields of vanilla blocks without reassigning them:

// change texture name:
Blocks.acacia_stairs.setBlockTextureName("modid:new_texture_name");

// set new hardness:
block.setHardness(10.0F);

// etc. lots of public setter methods are available

Well I had some other changes before besides the textures, and  I can work around that kind-of, but I wouldn't mind a built in way to do it instead of a separate resource pack.

You can change vanilla textures inside your mod package.

Mods are loaded like resource packs.

Just add assets/minecraft/...

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.