make the_bridge_stone mineable

This commit is contained in:
chmodsayshello 2022-10-08 21:38:14 +02:00
parent a664e57f84
commit 6f0349fa0c
2 changed files with 23 additions and 25 deletions

View File

@ -65,27 +65,4 @@ arena_lib.on_quit("the_bridge", function(arena, p_name, is_spectator, reason)
player = minetest.get_player_by_name(p_name)
player:hud_remove(arena.huds[p_name].blue)
player:hud_remove(arena.huds[p_name].red)
end)
-- Ersetze die zwei leerzeichen mit \t
minetest.register_on_dignode(function(pos, oldnode, digger)
if not minetest.check_player_privs(digger, {build=true}) then
arena = arena_lib.get_arena_by_player(digger:get_player_name())
if not arena then return end
local wielded = digger and digger:get_wielded_item()
local drops = minetest.get_node_drops(oldnode, wielded and wielded:get_name())
minetest.handle_node_drops(pos, drops, oldnode)
end
end)
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
if not minetest.check_player_privs(digger, {build=true}) then
arena = arena_lib.get_arena_by_player(digger:get_player_name())
if not arena then return end
if pointed_thing.type == "node" then
local pos = pointed_thing.above
minetest.set_node(pos , newnode)
end
end
end)
end)

View File

@ -1,7 +1,7 @@
local S = minetest.get_translator("the_bridge")
local function set_player_inventory(player)
local stonestack = ItemStack("default:stone 99")
local stonestack = ItemStack("the_bridge:stone 99")
local pickstack = ItemStack("the_bridge:diapick")
local swordstack = ItemStack("the_bridge:stonesword")
local gapplestack = ItemStack("the_bridge:gapple 16")
@ -112,6 +112,27 @@ minetest.register_node("the_bridge:goal_area_red",{
on_walk_over=goalfunc,
})
minetest.register_node("the_bridge:stone", {
description = S("Stone"),
tiles = {"default_stone.png"},
groups = {cracky = 3, stone = 1},
drop = "default:cobble",
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
local pos = pointed_thing.above
minetest.set_node(pos , {name="the_bridge:stone"}
end
end,
on_dig = function(pos, node, digger)
local wielded = digger and digger:get_wielded_item()
local drops = minetest.get_node_drops(node, wielded and wielded:get_name())
minetest.handle_node_drops(pos, drops, digger)
end,
})
minetest.register_node("the_bridge:goal_area_blue",{
description = S("Blue Goal"),
drawtype = "glasslike",