-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit adcb18f
Showing
7 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
local c_lavastone = minetest.get_content_id("lavastone:lavastone") | ||
local c_air = minetest.get_content_id("air") | ||
|
||
local range = {x=32,y=32,z=32} | ||
|
||
minetest.register_chatcommand("lavastone_remove", { | ||
description = "removes lavastone in the current area", | ||
privs = { lavastone_remove = true }, | ||
func = function(name, param) | ||
local player = minetest.get_player_by_name(name) | ||
local pos = player:get_pos() | ||
|
||
local pos1 = vector.subtract(pos, range) | ||
local pos2 = vector.add(pos, range) | ||
|
||
local manip = minetest.get_voxel_manip() | ||
local e1, e2 = manip:read_from_map(pos1, pos2) | ||
local area = VoxelArea:new({MinEdge=e1, MaxEdge=e2}) | ||
local data = manip:get_data() | ||
|
||
for z=pos1.z, pos2.z do | ||
for y=pos1.y, pos2.y do | ||
for x=pos1.x, pos2.x do | ||
|
||
local index = area:index(x, y, z) | ||
if data[index] == c_lavastone then | ||
data[index] = c_air | ||
end | ||
|
||
end | ||
end | ||
end | ||
|
||
manip:set_data(data) | ||
manip:write_to_map() | ||
end | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
-- taken from https://github.com/minetest/minetest_game/blob/master/mods/default/functions.lua | ||
default.cool_lava = function(pos, node) | ||
if node.name == "default:lava_source" then | ||
minetest.set_node(pos, {name = "default:obsidian"}) | ||
else -- Lava flowing | ||
minetest.set_node(pos, {name = "lavastone:lavastone"}) | ||
end | ||
minetest.sound_play("default_cool_lava", | ||
{pos = pos, max_hear_distance = 16, gain = 0.25}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
local MP = minetest.get_modpath("lavastone") | ||
|
||
dofile(MP.."/lavastone.lua") | ||
dofile(MP.."/cooling.lua") | ||
dofile(MP.."/commands.lua") | ||
dofile(MP.."/privs.lua") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
-- taken from https://github.com/minetest/minetest_game/blob/master/mods/default/nodes.lua#L232 | ||
|
||
minetest.register_node("lavastone:lavastone", { | ||
description = "Stone (Cooled lava)", | ||
tiles = {"default_stone.png"}, | ||
groups = {cracky = 3, stone = 1}, | ||
drop = 'default:cobble', | ||
sounds = default.node_sound_stone_defaults(), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
minetest.register_privilege("lavastone_remove", { | ||
description = "Can remove lavastone in an area" | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
Overrides the lava cooling with a generated lavastone that can be removed with /remove_lavastone | ||
|
||
# License | ||
|
||
Media: CC BY-SA 3.0 | ||
Code: GPL |