Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit da31910

Browse files
author
david
committed
Version 1.2: Resource Difficulty
Now it's greatly difficult to get these tools/armor in MCL and MTG, as it now costs 9x9x9 leaves to make 1 piece of the tool or armor. Also reworked the MCL armor and tools so they should properly work regardless of MCL version. (I hope, :P)
1 parent 2352602 commit da31910

15 files changed

+132
-19
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ This mod supports MTG (via using 3d_armor) and also supports MineClone2. (Exclud
1919
Currently there are no easily adjustable settings... and the current settings I do have I manually fiddled with to make some what sane defaults.
2020

2121
I do have some very rudimentary debug abilities, it simply dumps what slot it is, and the new durability (in raw) to the logs. (Unfortunately you will need to change it in both renew_tools and renew_armor in their init.lua files)
22+
23+
24+
## News
25+
26+
* Changed the recipe for crafting all equipment due to the fact it is equal to diamond tools/armor thus the need for them to
27+
be expensive.

modpack.conf

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
name = minetest-renew
2-
description = Self Repairing tools and armor
2+
description = Self Repairing tools and armor
3+
optional_depends = default, mcl_core, 3d_armor, mcl_armor, mcl_farming, farming

renew_armor/init.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ renew_armor.da_armor = minetest.get_modpath("3d_armor") or nil
99

1010
-- The direct durability for the armors
1111
renew_armor.uses = 365
12-
renew_armor.heal = 1
12+
renew_armor.heal = 2
1313

1414
-- The amount repaired per global step
15-
renew_armor.factor = 35
15+
renew_armor.factor = 36
1616

1717
-- Do we log that we did something? (Specifically used for debug
18-
renew_armor.log = false
18+
renew_armor.log = true
1919

2020
-- Only support repairing armor when the player is wearing it
2121
local function check_player(player, timer)

renew_armor/mcl_support.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
local mcl_armor = rawget(_G, "mcl_armor") or nil
1+
local mcl_armor = armor
22

3-
local mat = "renew_plant:plant"
3+
local mat = "renew_plant:plant_tri"
44
local points = {
55
head = 3,
66
torso = 8,
77
legs = 6,
88
feet = 3,
99
}
10+
local renewal = {}
11+
renewal.usage = renew_armor.S("")
1012

1113
minetest.register_tool("renew_armor:helmet", {
1214
description = renew_armor.S("Renewable Helmet"),
1315
_doc_items_longdesc = renew_armor.S("A self-repairing peice of armor"),
14-
_doc_items_usagehelp = mcl_armor.usage,
16+
_doc_items_usagehelp = armor.usage,
1517
inventory_image = "renew_armor_inv_helmet.png",
1618
groups = {armor_head = 1, combat_armor_head = 1, armor = 1, combat_armor = 1, mcl_armor_points = points.head, mcl_armor_toughness = 2, mcl_armor_uses=renew_armor.uses, enchantablility = 20},
1719
sounds = {

renew_armor/mtg_support.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ armor:register_armor(":renew_armor:boots", {
3131
damage_groups = {cracky=2, snappy=1, choppy=1, level=3}
3232
})
3333

34-
local mat = "renew_plant:plant"
34+
local mat = "renew_plant:plant_tri"
3535

3636
minetest.register_craft({
3737
output = "renew_armor:helmet",

renew_plant/init.lua

+70-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ renew_plant.mcl = minetest.get_modpath("mcl_core") or nil
88

99
minetest.register_craftitem("renew_plant:plant", {
1010
description = renew_plant.S("Renewable Plant Fiber"),
11-
inventory_image = "renew_plant_plant.png"
11+
inventory_image = "renew_plant_plant1.png"
12+
})
13+
14+
minetest.register_craftitem("renew_plant:plant_duo", {
15+
description = renew_plant.S("Renewable Plant Mend"),
16+
inventory_image = "renew_plant_plant2.png"
17+
})
18+
19+
minetest.register_craftitem("renew_plant:plant_tri", {
20+
description = renew_plant.S("Renewable Plant Bond"),
21+
inventory_image = "renew_plant_plant3.png"
1222
})
1323

1424
minetest.register_craft({
@@ -18,10 +28,68 @@ minetest.register_craft({
1828
})
1929

2030
minetest.register_craft({
21-
output = "renew_plant:plant 1",
31+
type = "fuel",
32+
recipe = "renew_plant:plant_duo",
33+
burntime = 75
34+
})
35+
36+
minetest.register_craft({
37+
type = "fuel",
38+
recipe = "renew_plant:plant_tri",
39+
burntime = 145
40+
})
41+
42+
local p1 = "renew_plant:plant"
43+
local p2 = "renew_plant:plant_duo"
44+
local p3 = "renew_plant:plant_tri"
45+
46+
minetest.register_craft({
47+
output = p1.." 1",
2248
recipe = {
2349
{"group:leaves", "group:leaves", "group:leaves"},
2450
{"group:leaves", "group:leaves", "group:leaves"},
2551
{"group:leaves", "group:leaves", "group:leaves"}
2652
}
2753
})
54+
55+
minetest.register_craft({
56+
output = p2.." 1",
57+
recipe = {
58+
{p1, p1, p1},
59+
{p1, p1, p1},
60+
{p1, p1, p1}
61+
}
62+
})
63+
64+
minetest.register_craft({
65+
output = p3.." 1",
66+
recipe = {
67+
{p2, p2, p2},
68+
{p2, p2, p2},
69+
{p2, p2, p2}
70+
}
71+
})
72+
73+
minetest.register_craft({
74+
type = "shapeless",
75+
output = "default:leaves 9",
76+
recipe = {
77+
p1
78+
}
79+
})
80+
81+
minetest.register_craft({
82+
type = "shapeless",
83+
output = p1.." 9",
84+
recipe = {
85+
p2
86+
}
87+
})
88+
89+
minetest.register_craft({
90+
type = "shapeless",
91+
output = p2.." 9",
92+
recipe = {
93+
p3
94+
}
95+
})
3.35 KB
Loading
3.4 KB
Loading
3.37 KB
Loading
3.47 KB
Loading
3.46 KB
Loading

renew_tools/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ renew_tools.mcl = minetest.get_modpath("mcl_core") or nil
1010
renew_tools.uses = 365
1111

1212
-- The amount repaired per global step
13-
renew_tools.factor = 35
13+
renew_tools.factor = 36
1414

1515
-- Do we log when we repair? Used for debugging
1616
renew_tools.log = false

renew_tools/mcl_support.lua

+42-6
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,32 @@ local make_stripped_trunk = function(itemstack, placer, pointed_thing)
9797
return itemstack
9898
end
9999

100+
-- Assistant functions that really should have been placed into an API (Thus I have to lug it around)
101+
local function create_soil(pos, inv)
102+
if pos == nil then
103+
return false
104+
end
105+
local node = minetest.get_node(pos)
106+
local name = node.name
107+
local above = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})
108+
if minetest.get_item_group(name, "cultivatable") == 2 then
109+
if above.name == "air" then
110+
node.name = "mcl_farming:soil"
111+
minetest.set_node(pos, node)
112+
minetest.sound_play("default_dig_crumbly", { pos = pos, gain = 0.5 }, true)
113+
return true
114+
end
115+
elseif minetest.get_item_group(name, "cultivatable") == 1 then
116+
if above.name == "air" then
117+
node.name = "mcl_core:dirt"
118+
minetest.set_node(pos, node)
119+
minetest.sound_play("default_dig_crumbly", { pos = pos, gain = 0.6 }, true)
120+
return true
121+
end
122+
end
123+
return false
124+
end
125+
100126
-- Assistant functions that really should have been placed into an API (Thus I have to lug it around)
101127
local hoe_on_place_function = function(wear_divisor)
102128
return function(itemstack, user, pointed_thing)
@@ -133,9 +159,12 @@ minetest.register_tool("renew_tools:pick", {
133159
max_drop_level=5,
134160
damage_groups = {fleshy=5},
135161
punch_attack_uses=renew_tools.uses,
162+
groupcaps={
163+
pickaxey_dig_diamond = {times=mcl_autogroup.digtimes.pickaxey_dig_diamond, uses=renew_tools.uses, maxlevel=0},
164+
},
136165
},
137166
sound = { breaks = "default_tool_breaks" },
138-
--_repair_material = "mcl_core:diamond",
167+
-- _repair_material = "mcl_core:diamond",
139168
_mcl_toollike_wield = true,
140169
_mcl_diggroups = {
141170
pickaxey = { speed = 8, level = 5, uses=renew_tools.uses }
@@ -150,12 +179,14 @@ minetest.register_tool("renew_tools:shovel", {
150179
tool_capabilities = {
151180
full_punch_interval = 1,
152181
max_drop_level=5,
182+
groupcaps={
183+
shovely_dig_diamond = {times=mcl_autogroup.digtimes.shovely_dig_diamond, uses=renew_tools.uses, maxlevel=0},
184+
},
153185
damage_groups = {fleshy=5},
154186
punch_attack_uses=renew_tools.uses,
155187
},
156188
on_place = make_grass_path,
157189
sound = { breaks = "default_tool_breaks" },
158-
--_repair_material = "mcl_core:diamond",
159190
_mcl_toollike_wield = true,
160191
_mcl_diggroups = {
161192
shovely = { speed = 8, level = 5, uses=renew_tools.uses }
@@ -170,12 +201,14 @@ minetest.register_tool("renew_tools:axe", {
170201
tool_capabilities = {
171202
full_punch_interval = 1.0,
172203
max_drop_level=5,
204+
groupcaps={
205+
axey_dig_diamond = {times=mcl_autogroup.digtimes.axey_dig_diamond, uses=renew_tools.uses, maxlevel=0},
206+
},
173207
damage_groups = {fleshy=9},
174208
punch_attack_uses=renew_tools.uses,
175209
},
176210
on_place = make_stripped_trunk,
177211
sound = { breaks = "default_tool_breaks" },
178-
--_repair_material = "mcl_core:diamond",
179212
_mcl_toollike_wield = true,
180213
_mcl_diggroups = {
181214
axey = { speed = 8, level = 5, uses=renew_tools.uses }
@@ -190,11 +223,14 @@ minetest.register_tool("renew_tools:sword", {
190223
tool_capabilities = {
191224
full_punch_interval = 0.625,
192225
max_drop_level=5,
226+
groupcaps={
227+
swordy_dig = {times=mcl_autogroup.digtimes.swordy_dig , uses=renew_tools.uses, maxlevel=0},
228+
swordy_cobweb_dig = {times=mcl_autogroup.digtimes.swordy_cobweb_dig , uses=renew_tools.uses, maxlevel=0},
229+
},
193230
damage_groups = {fleshy=7},
194231
punch_attack_uses=renew_tools.uses,
195232
},
196233
sound = { breaks = "default_tool_breaks" },
197-
--_repair_material = "mcl_core:diamond",
198234
_mcl_toollike_wield = true,
199235
_mcl_diggroups = {
200236
swordy = { speed = 8, level = 5, uses=renew_tools.uses },
@@ -207,7 +243,7 @@ minetest.register_tool("renew_tools:hoe", {
207243
description = renew_tools.S("Renewable Hoe"),
208244
_tt_help = renew_tools.S("Uses: "..renew_tools.uses),
209245
inventory_image = "renew_tools_hoe.png",
210-
on_place = hoe_on_place_function(0),
246+
on_place = hoe_on_place_function(renew_tools.uses),
211247
groups = { tool=1, hoe=1, enchantability=10 },
212248
tool_capabilities = {
213249
full_punch_interval = 0.25,
@@ -220,7 +256,7 @@ minetest.register_tool("renew_tools:hoe", {
220256
},
221257
})
222258

223-
local mat = "renew_plant:plant"
259+
local mat = "renew_plant:plant_tri"
224260
local stk = "group:stick"
225261

226262
minetest.register_craft({

renew_tools/mod.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name = renew_tools
22
description = Self-Repairing tools
33
depends = renew_plant
4-
optional_depends = default, mcl_core, mcl_farming, farming
4+
optional_depends = default, mcl_core, mcl_farming, farming, _mcl_autogroup

renew_tools/mtg_support.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ minetest.register_tool("renew_tools:sword", {
6363
groups = {sword = 1}
6464
})
6565

66-
local mat = "renew_plant:plant"
66+
local mat = "renew_plant:plant_tri"
6767
local stk = "group:stick"
6868

6969
minetest.register_craft({

0 commit comments

Comments
 (0)