Jump to content

Changing what Drops from Vanilla Ore


GeoDoX

Recommended Posts

Hello Modders!

 

I was wondering if there was a way to override (and not edit base classes) what Vanilla ore's drop?

I've done hours of googleing and nothing came to results, so please dont tell me to google it or something related.

 

If so could you point me in the direction of how to do that?

 

Thanks in Advance!

Link to comment
Share on other sites

You make a ore Block like normal (no generation or the like but), can probably just super-class the original ore block to make it quicker, but change the drop method(s) to do what you need, then when assigning ID's just use the ID of the ore you want to replace

Link to comment
Share on other sites

You make a ore Block like normal (no generation or the like but), can probably just super-class the original ore block to make it quicker, but change the drop method(s) to do what you need, then when assigning ID's just use the ID of the ore you want to replace

 

That's actually bad programming, very bad programming. Not to mention, it also wouldn't work. The vanilla ore would still generate, and mine would gen too. So I thank you for the reply, but I respectively decline. Your free to come back if you find the answer though!

 

Anyone else?

Link to comment
Share on other sites

You could try adding an event listener for EntityJoinWorld, check if the entity is instanceof EntityItem and then get the ID, comapre it to that of the ore block, and then spawn items there if its appropriate? I can see a few holes there (could result in item duplication), but that's the only thing I can think of

 

Or, you could use a coremod and override that class - you might want to look at NotEnoughItems and CodeChickenCore - chickenbones overrides a class in NEI, so you could learn from him...

Protip: try and find answers yourself before asking on the forum.

It's pretty likely that there is an answer.

 

Was I helpful? Give me a thank you!

 

 

width=635 height=903http://bit.ly/HZ03zy[/img]

 

 

Tired of waiting for mods to port to bukkit?

use BukkitForge! (now with a working version of WorldEdit!)

Link to comment
Share on other sites

That's actually bad programming, very bad programming. Not to mention, it also wouldn't work. The vanilla ore would still generate, and mine would gen too. So I thank you for the reply, but I respectively decline. Your free to come back if you find the answer though!

Debating as to weather or not something is a bad programing or not is beyond the scope of these boards

 

As to weather or not it works? How do you think Eloraam gets spreading mossy cobblestone? Take a look inside Redpower World and you'll see a file called BlockCobbleMossifier.class, it's a new mossy cobblestone block, when ID's are assigned she simply has Forge assign this block the normal mossy cobblestone ID. The reason this works is that when Minecraft does terrain generation it works on ID's, not actual objects

Link to comment
Share on other sites

Actually SCC's answer is not that bad... And it does work... although I don't know if you can succeed to assign a block an ID that is already being used... probably Eloraam has a way to go around it, given she's one of the Forge main devs (or was at least), and her skill levels are above those of the average modder.

 

At this moment, the core mod option sounds the best, or you can waste some hours looking at the code, searching for something that allows you to override a block the way Elo does with the Mossy cobble.

Did I help? Hitting 'Thank You' would be appreciated.

 

Soon, the lost city will rise from the bottom of the ocean, and spread it's technology across Minecraft.

Link to comment
Share on other sites

Oh, I didn't it ignored vanilla ID's. Nice.

So yeah, overriding the block by ID is pretty easy to do, and should be clean. I'd do it...

Did I help? Hitting 'Thank You' would be appreciated.

 

Soon, the lost city will rise from the bottom of the ocean, and spread it's technology across Minecraft.

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.