This repository was archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinit.lua
More file actions
124 lines (114 loc) · 3.68 KB
/
Copy pathinit.lua
File metadata and controls
124 lines (114 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
-------------------------------------------------------------
--Do files
-------------------------------------------------------------
dofile(minetest.get_modpath("earthbuild").."/earth.lua")
dofile(minetest.get_modpath("earthbuild").."/roofing.lua")
dofile(minetest.get_modpath("earthbuild").."/wattle.lua")
dofile(minetest.get_modpath("earthbuild").."/whitewash.lua")
dofile(minetest.get_modpath("earthbuild").."/drystack.lua")
dofile(minetest.get_modpath("earthbuild").."/earthship.lua")
dofile(minetest.get_modpath("earthbuild").."/tools.lua")
dofile(minetest.get_modpath("earthbuild").."/clay_pot.lua")
dofile(minetest.get_modpath("earthbuild").."/bed.lua")
dofile(minetest.get_modpath("earthbuild").."/furnace.lua")
dofile(minetest.get_modpath("earthbuild").."/doors.lua")
dofile(minetest.get_modpath("earthbuild").."/storage.lua")
dofile(minetest.get_modpath("earthbuild").."/weaving.lua")
dofile(minetest.get_modpath("earthbuild").."/hearth.lua")
dofile(minetest.get_modpath("earthbuild").."/farming.lua")
---------------------------------------------------------------
--MISC STUFF
----------------------------
-- DEGRADE
--Most of these construction need special care.
--they must be kept dry or they fall to bits.
--Therefore the degradation mechanism simulates how builders cope with that.
--Earthen blocks must be kept away from moisture/soil
-- simulates water, worms etc breaking it back up to dirt
--Therefore they must be kept off the ground/dry/whitewashed
-- A fairly slow process
--Some things are more durable than others...
--Fast. Things that are already dirt like, easily decomposed
minetest.register_abm({
label = "Fast degrade Earthbuild",
nodenames = {
"earthbuild:compacted_dirt",
"earthbuild:strawbale",
"earthbuild:thatch",
"stairs:thatch",
"stairs:slab_thatch",
"earthbuild:turf",
"stairs:stair_turf",
"stairs:slab_turf",
},
neighbors = {
"group:soil",
"group:water",
},
interval = 180,
chance = 250,
catch_up = false,
action = function(pos, node)
--turn back to dirt
minetest.set_node(pos, {name = "default:dirt"})
end
})
--Medium. Harder to degrade, but no special resistance.
minetest.register_abm({
label = "Degrade Earthbuild",
nodenames = {
"earthbuild:cob",
"earthbuild:mud_brick",
"stairs:stair_cob",
"stairs:stair_mud_brick",
"stairs:slab_cob",
"stairs:slab_mud_brick",
},
neighbors = {
"group:soil",
"group:water",
},
interval = 360,
chance = 500,
catch_up = false,
action = function(pos, node)
--turn back to dirt
minetest.set_node(pos, {name = "default:dirt"})
end
})
--Slow. Resistant, or partly protected
minetest.register_abm({
label = "Slow Degrade Earthbuild",
nodenames = {
"earthbuild:rammed_earth",
"stairs:stair_rammed_earth",
"stairs:slab_rammed_earth",
"earthbuild:wattle_and_daub",
"earthbuild:supported_rammed_earth",
"earthbuild:junglewood_supported_rammed_earth",
"earthbuild:pine_wood_supported_rammed_earth",
"earthbuild:acacia_wood_supported_rammed_earth",
"earthbuild:aspen_wood_supported_rammed_earth",
"earthbuild:supported_cob",
"earthbuild:junglewood_supported_cob",
"earthbuild:pine_wood_supported_cob",
"earthbuild:acacia_wood_supported_cob",
"earthbuild:aspen_wood_supported_cob"
},
neighbors = {
"group:soil",
"group:water",
},
interval = 720,
chance = 1000,
catch_up = false,
action = function(pos, node)
if node.name == "earthbuild:wattle_and_daub" then
--daub falls off
minetest.set_node(pos, {name = "earthbuild:wattle"})
else
--turn back to dirt
minetest.set_node(pos, {name = "default:dirt"})
end
end
})