Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

[Modloader 1.1] How to edit block properties and remove recipes?


  • Please log in to reply
11 replies to this topic

#1

randomraccoon

Posted 01 February 2012 - 02:34 PM

Hi, I've been working on my first mod, and I've found some great tutorials out there for modding using Modloader for 1.1. However, I can't find one that talks about how to
1) edit block properties, such as making leaves drop sticks, or renaming dirt to "brown ground stuff";
2) remove or override existing recipes; and
3) do that without editing the original classes themselves, if possible.

Anybody know how to do that, or where to look for a good tutorial on that? Any help will get reputation and a shout out (and link to your mod page) on my mod, when I finish it of course.

Thanks!
Posted Image

Register or log in to remove.

#2

ottoguy2
    ottoguy2

    Void Walker

  • Members
  • 1857 posts

Posted 01 February 2012 - 05:12 PM

You could override recipes by just make a new recipe with the same recipe.
But you can't remove recipes.
Posted Image
This picture will not do the above.

#3

randomraccoon

Posted 01 February 2012 - 05:40 PM

View Postottoguy2, on 01 February 2012 - 05:12 PM, said:

You could override recipes by just make a new recipe with the same recipe.
But you can't remove recipes.

Yeah, that was the conclusion I was coming to. (Sigh). Well, it looks like I'll be editing base classes. Yippee...

Any idea on editing block properties, like adding drops or changing tool effectiveness?
Posted Image

#4

chupybara
  • Location: Germany

Posted 13 March 2012 - 02:44 PM

When I attempt to override the original minecraft recipe for Leather Boots,

ModLoader.addRecipe(new ItemStack(SapphireBoots, 1), new Object[] {"   ", "s s", "s s", Character.valueOf('s'), Item.leather});

nothing changes; the recipe still creates leather boots.  The rest of the code is working properly - ie., if I change "Item.leather" above to "Block.dirt", the recipe produces the proper new item.

Is it actually possible to override a vanilla recipe without modfiying any of the base classes to preserve compatibility with other mods?

#5

pigalot
    pigalot

    Diamond Miner

  • Members
  • 734 posts

Posted 13 March 2012 - 03:37 PM

You can remove recipes here is a link on how to do it

You can rename blocks but you cant change what they drop without changing them, same with chaning tool effectiveness.

Well i say that you can change the behavor without editing them, you can you just need to use reflection but i wouldnt sugest that unless you are very familiar with the subject.

#6

chupybara
  • Location: Germany

Posted 13 March 2012 - 03:52 PM

Thanks a ton - I'll give it a go in the next day or so and post back up with my success...

#7

xTwilight3
  • Minecraft: xTwilight

Posted 13 March 2012 - 05:20 PM

View Postpigalot, on 13 March 2012 - 03:37 PM, said:

You can remove recipes here is a link on how to do it

You can rename blocks but you cant change what they drop without changing them, same with chaning tool effectiveness.

Well i say that you can change the behavor without editing them, you can you just need to use reflection but i wouldnt sugest that unless you are very familiar with the subject.


The striked text isn't true. You can use the block array inside of Block.class to override and replace blocks, same with items, biomes, anything
Did my post help? Click the Posted Image on my post. It's 110% optional Popcorn smelting, old removed feature, new mod. :D

#8

pigalot
    pigalot

    Diamond Miner

  • Members
  • 734 posts

Posted 13 March 2012 - 05:25 PM

View PostxTwilight3, on 13 March 2012 - 05:20 PM, said:

The striked text isn't true. You can use the block array inside of Block.class to override and replace blocks, same with items, biomes, anything

You can set the name using modloader if you have to and replacing blocks isnt the best idea its as bad as editing the base class.

#9

xTwilight3
  • Minecraft: xTwilight

Posted 13 March 2012 - 05:50 PM

View Postpigalot, on 13 March 2012 - 05:25 PM, said:

You can set the name using modloader if you have to and replacing blocks isnt the best idea its as bad as editing the base class.

If it wasn't for the arrays, what would we do about new biomes. :P Etc.
Did my post help? Click the Posted Image on my post. It's 110% optional Popcorn smelting, old removed feature, new mod. :D

#10

pigalot
    pigalot

    Diamond Miner

  • Members
  • 734 posts

Posted 14 March 2012 - 07:21 AM

View PostxTwilight3, on 13 March 2012 - 05:50 PM, said:

If it wasn't for the arrays, what would we do about new biomes. Posted Image Etc.

Its fine to add things to arrays but there is no point in avoiding editing a base class just to make it so the class is never used by replacing it in the array, in fact i would say its far worse as you have no idea that the mod is overriding the class like you do when you just edit it.

#11

OnyxianSoul

Posted 02 February 2014 - 12:18 AM

View Postpigalot, on 14 March 2012 - 07:21 AM, said:

Its fine to add things to arrays but there is no point in avoiding editing a base class just to make it so the class is never used by replacing it in the array, in fact i would say its far worse as you have no idea that the mod is overriding the class like you do when you just edit it.
You are wrong, if you edit base clases, your mod instantly turns incompatible with any other mc versions. That is something you should avoid, you dont wanna have to compile your mod in 10 enviroments, not worth it

#12

jcm2606
    jcm2606

    Lapis Lazuli Collector

  • Members
  • 1034 posts
  • Location: Australia

Posted 02 February 2014 - 05:47 AM

View PostOnyxianSoul, on 02 February 2014 - 12:18 AM, said:

You are wrong, if you edit base clases, your mod instantly turns incompatible with any other mc versions. That is something you should avoid, you dont wanna have to compile your mod in 10 enviroments, not worth it
Don't bring nearly 2 year old threads back, it results in a lot of annoyance and can start a flame war.
Derpin da herp.