Jump to content

Editing base classes/coremods


SparcMan

Recommended Posts

I wanted to know if there were any good tutorials out there that show how to do this properly since with 1.6.x, it's now the only way to do so with Forge.

I've looked at this one: http://www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/

I can probably manage to use the ASM method editing for some of the things I need to do like change a couple values, but for changing out an entire class is not well explained and following the example did not even work for me.

Some of the changes I want to make are:

Adding a loot chest to witch huts

Endermen drop the block they are holding as an item when killed

Reduce the rate of cave spider spawners in mineshafts

Rare drops from digging dirt

Water buckets work in the Nether, but cannot change lava to cobble/obsidian

Coal blocks work like netherrack when lit

 

I'm not a professional programmer, but I'm no beginner either although I have very little recent experience in Java programming other than what I've managed to accomplish in my mod.

I've only recently started using Eclipse, but I'm liking it a lot so far.

Link to comment
Share on other sites

1/Register in MapGenScatteredFeature a structure extending ComponentScatteredFeatureSwampHut which set a chest

2/Use LivingDeathEvent, check for Enderman...

3/Register new MineshaftGenerator (with less spider spawners) with InitMapGenEvent ?

4/Use HarvestDropsEvent, check for dirt block...

5/ & 6/ ? Not precise enough to guess a solution

Link to comment
Share on other sites

1/Register in MapGenScatteredFeature a structure extending ComponentScatteredFeatureSwampHut which set a chest

2/Use LivingDeathEvent, check for Enderman...

3/Register new MineshaftGenerator (with less spider spawners) with InitMapGenEvent ?

4/Use HarvestDropsEvent, check for dirt block...

5/ & 6/ ? Not precise enough to guess a solution

 

Won't creating an extending class just add a 2nd type of witch hut that has chests? Witch huts are pretty rare and should probably stay that way - I want to get rid of all witch huts without chests

Same thing with the Mineshafts right?

I'll have to brush up on event handling. I haven't really messed with it for ages.

 

Is there a good way to find all of the various events generated for different situations? Once I get a good handle on events (programming pun?), knowing what events are available should help a lot.

Link to comment
Share on other sites

You can use IWorldGenerator to look for huts, actually.  They are built with a material that appears no where else in worldgen, IIRC (spruce planks).  Generate a bunch of worlds and figure out the Chunk coordinates* of a unique block position of the hut (e.g. the block that makes the door).  Because huts are in swamps and at sea level, you will also want the Y coordinate.

 

Check out how I look for pyramids: in this class.  Line 63ish.

 

*By which I mean the block's coordinates inside a chunk.  0-16.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.