Page 1 of 1

Is it possible to disable Minetest Repairing?

PostPosted: Tue Apr 08, 2014 18:36
by Rhys
I'm making a mod that allows the player to repair tools. Problem is, CraigyDavi found out something for me - in crafting.lua, Line #553, I found this:
Image
This allows the user to create a tool with normal crafting, like this:
Image
This also works with my enchanted tools:
Image
This shows that any tool can be repaired this way. What I am trying to figure out is; how the heck do I disable this by a mod?

PostPosted: Tue Apr 08, 2014 18:47
by Krock
Override it.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_craft({
   type = "toolrepair",
   additional_wear = 0.8, -- for 80% additional wear
})

PostPosted: Tue Apr 08, 2014 18:57
by Rhys
Krock wrote:Override it.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_craft({
   type = "toolrepair",
   additional_wear = 0.8, -- for 80% additional wear
})


Will this work within a new mod?

PostPosted: Tue Apr 08, 2014 19:01
by Krock
Rhys wrote:
Krock wrote:Override it.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_craft({
   type = "toolrepair",
   additional_wear = 0.8, -- for 80% additional wear
})


Will this work within a new mod?

moreblocks did it too, so I guess it works.
(Well, it just prevents players from repairing their tools)

PostPosted: Tue Apr 08, 2014 19:05
by Rhys
Krock wrote:
Rhys wrote:
Krock wrote:Override it.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_craft({
   type = "toolrepair",
   additional_wear = 0.8, -- for 80% additional wear
})


Will this work within a new mod?

moreblocks did it too, so I guess it works.
(Well, it just prevents players from repairing their tools)


Thanks alot, worked really well. :)

PostPosted: Wed Apr 09, 2014 09:21
by Calinou
More Blocks buffs the repairing from 2% bonus to 15% bonus, for that, it replaces -0.02 with -0.15. A positive value damages tools upon repairing.

PostPosted: Wed Apr 09, 2014 18:54
by Rhys
Calinou wrote:More Blocks buffs the repairing from 2% bonus to 15% bonus, for that, it replaces -0.02 with -0.15. A positive value damages tools upon repairing.


I need to replace the original repairing code with this new code WITHIN default mod - doesn't seem to override within a new mod, how strange.

PostPosted: Mon Apr 14, 2014 09:29
by Rhys
Can modpacks override a mod if I have the same name for the mod as a mod which isn't in a modpack?

PostPosted: Mon Apr 14, 2014 09:31
by Krock
Rhys wrote:Can modpacks override a mod if I have the same name for the mod as a mod which isn't in a modpack?

What does this have to do with repairing tools?
Well, it shoudn't be possible because "world.mt" saves every mod, also those in modpacks

PostPosted: Mon Apr 14, 2014 10:07
by Rhys
Krock wrote:
Rhys wrote:Can modpacks override a mod if I have the same name for the mod as a mod which isn't in a modpack?

What does this have to do with repairing tools?
Well, it shoudn't be possible because "world.mt" saves every mod, also those in modpacks


Like I said before:
Rhys wrote:I need to replace the original repairing code with this new code WITHIN default mod - doesn't seem to override within a new mod, how strange.


Just seeing if modpacks override mods with the same name.

PostPosted: Mon Apr 14, 2014 13:33
by Rhys
I could just tell people to download a new default mod with my new mod which comes with it...