Is it possible to disable Minetest Repairing?

Rhys
Member
 
Posts: 379
Joined: Wed May 22, 2013 15:22

Is it possible to disable Minetest Repairing?

by Rhys » Tue Apr 08, 2014 18:36

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?
Last edited by Rhys on Tue Apr 08, 2014 18:46, edited 1 time in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Tue Apr 08, 2014 18:47

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
})
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Rhys
Member
 
Posts: 379
Joined: Wed May 22, 2013 15:22

by Rhys » Tue Apr 08, 2014 18:57

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?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Tue Apr 08, 2014 19:01

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)
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Rhys
Member
 
Posts: 379
Joined: Wed May 22, 2013 15:22

by Rhys » Tue Apr 08, 2014 19:05

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. :)
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Wed Apr 09, 2014 09:21

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.
 

Rhys
Member
 
Posts: 379
Joined: Wed May 22, 2013 15:22

by Rhys » Wed Apr 09, 2014 18:54

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.
Last edited by Rhys on Wed Apr 09, 2014 18:55, edited 1 time in total.
 

Rhys
Member
 
Posts: 379
Joined: Wed May 22, 2013 15:22

by Rhys » Mon Apr 14, 2014 09:29

Can modpacks override a mod if I have the same name for the mod as a mod which isn't in a modpack?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Mon Apr 14, 2014 09:31

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
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Rhys
Member
 
Posts: 379
Joined: Wed May 22, 2013 15:22

by Rhys » Mon Apr 14, 2014 10:07

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.
 

Rhys
Member
 
Posts: 379
Joined: Wed May 22, 2013 15:22

by Rhys » Mon Apr 14, 2014 13:33

I could just tell people to download a new default mod with my new mod which comes with it...
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 5 guests