Remove a bunch of duplicate code

Remove a bunch of duplicate code
Remove a bunch of duplicate code
Remove a bunch of duplicate code
Remove a bunch of duplicate code
Remove a bunch of duplicate code
Remove a bunch of duplicate code
Remove a bunch of duplicate code
Remove a bunch of duplicate code
Remove a bunch of duplicate code
This commit is contained in:
jordan4ibanez 2023-11-07 19:49:46 -05:00
parent 57263e3526
commit 33487a9055
2 changed files with 9 additions and 53 deletions

View File

@ -4,11 +4,6 @@ minetest.register_node(":stone", {
drawtype = "normal",
tiles = {
"default_stone.png",
"default_stone.png",
"default_stone.png",
"default_stone.png",
"default_stone.png",
"default_stone.png",
},
sounds = sound_dispatcher.stone_sounds(),
groups = {
@ -20,11 +15,6 @@ minetest.register_node(":dirt", {
drawtype = "normal",
tiles = {
"default_dirt.png",
"default_dirt.png",
"default_dirt.png",
"default_dirt.png",
"default_dirt.png",
"default_dirt.png",
},
sounds = sound_dispatcher.dirt_sounds(),
groups = {
@ -38,25 +28,18 @@ minetest.register_node(":grass", {
"default_grass.png",
"default_dirt.png",
"default_dirt.png^default_grass_side.png",
"default_dirt.png^default_grass_side.png",
"default_dirt.png^default_grass_side.png",
"default_dirt.png^default_grass_side.png",
},
sounds = sound_dispatcher.grass_sounds(),
groups = {
soil = 1,
},
drop = "dirt",
})
minetest.register_node(":sand", {
drawtype = "normal",
tiles = {
"default_sand.png",
"default_sand.png",
"default_sand.png",
"default_sand.png",
"default_sand.png",
"default_sand.png",
},
sounds = sound_dispatcher.sand_sounds(),
groups = {
@ -68,11 +51,6 @@ minetest.register_node(":gravel", {
drawtype = "normal",
tiles = {
"default_gravel.png",
"default_gravel.png",
"default_gravel.png",
"default_gravel.png",
"default_gravel.png",
"default_gravel.png",
},
sounds = sound_dispatcher.gravel_sounds(),
groups = {
@ -86,9 +64,6 @@ minetest.register_node(":oak_tree", {
"default_tree_top.png",
"default_tree_top.png",
"default_tree.png",
"default_tree.png",
"default_tree.png",
"default_tree.png",
},
sounds = sound_dispatcher.wood_sounds(),
groups = {
@ -120,10 +95,12 @@ for i = 1, 5 do
tiles = {
"default_grass_" .. height .. ".png",
},
buildable_to = true,
sounds = sound_dispatcher.plant_sounds(),
groups = {
break_instant = 1,
},
drop = "",
})
end
@ -141,6 +118,7 @@ minetest.register_node(":glass", {
groups = {
glass = 1,
},
drop = "",
})
minetest.register_node(":wool", {

View File

@ -3,11 +3,6 @@ local sound_dispatcher: GameSoundDispatcher = get_game_sounds()
minetest.register_node(":stone", {
drawtype = "normal",
tiles = {
"default_stone.png",
"default_stone.png",
"default_stone.png",
"default_stone.png",
"default_stone.png",
"default_stone.png"
},
sounds = sound_dispatcher.stone_sounds(),
@ -19,11 +14,6 @@ minetest.register_node(":stone", {
minetest.register_node(":dirt", {
drawtype = "normal",
tiles = {
"default_dirt.png",
"default_dirt.png",
"default_dirt.png",
"default_dirt.png",
"default_dirt.png",
"default_dirt.png"
},
sounds = sound_dispatcher.dirt_sounds(),
@ -37,25 +27,18 @@ minetest.register_node(":grass", {
tiles = {
"default_grass.png",
"default_dirt.png",
"default_dirt.png^default_grass_side.png",
"default_dirt.png^default_grass_side.png",
"default_dirt.png^default_grass_side.png",
"default_dirt.png^default_grass_side.png"
},
sounds = sound_dispatcher.grass_sounds(),
groups = {
soil = 1
},
drop = "dirt"
})
minetest.register_node(":sand", {
drawtype = "normal",
tiles = {
"default_sand.png",
"default_sand.png",
"default_sand.png",
"default_sand.png",
"default_sand.png",
"default_sand.png"
},
sounds = sound_dispatcher.sand_sounds(),
@ -67,11 +50,6 @@ minetest.register_node(":sand", {
minetest.register_node(":gravel", {
drawtype = "normal",
tiles = {
"default_gravel.png",
"default_gravel.png",
"default_gravel.png",
"default_gravel.png",
"default_gravel.png",
"default_gravel.png"
},
sounds = sound_dispatcher.gravel_sounds(),
@ -85,9 +63,6 @@ minetest.register_node(":oak_tree", {
tiles = {
"default_tree_top.png",
"default_tree_top.png",
"default_tree.png",
"default_tree.png",
"default_tree.png",
"default_tree.png"
},
sounds = sound_dispatcher.wood_sounds(),
@ -120,10 +95,12 @@ for i = 1,5 do
tiles = {
"default_grass_" .. height .. ".png",
},
buildable_to = true,
sounds = sound_dispatcher.plant_sounds(),
groups = {
break_instant = 1
}
},
drop = ""
})
end
@ -141,6 +118,7 @@ minetest.register_node(":glass", {
groups = {
glass = 1
},
drop = "",
})
minetest.register_node(":wool", {