Wear out tools if they dig things they arent supposed to dig; remove placing gunpowder on ground
parent
8fabf307c2
commit
fac77e01f3
|
@ -10,7 +10,7 @@ minetest.register_node("beds:bed_bottom", {
|
|||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
stack_max = 1,
|
||||
groups = {dig_immediate=2,flammable=3},
|
||||
groups = {dig=default.dig.bed,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
|
@ -122,7 +122,7 @@ minetest.register_node("beds:bed_top", {
|
|||
tiles = {"beds_bed_top_top.png^[transformR90", "beds_bed_empty.png", "beds_bed_side_top_r.png", "beds_bed_side_top_r.png^[transformfx", "beds_bed_side_top.png", "beds_bed_empty.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {dig_immediate=2,flammable=3},
|
||||
groups = {dig=default.dig.bed,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
|
|
|
@ -487,7 +487,7 @@ minetest.register_node(":default:rail", {
|
|||
-- but how to specify the dimensions for curved and sideways rails?
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||
},
|
||||
groups = {dig_immediate=2,attached_node=1,rail=1,connect_to_raillike=1},
|
||||
groups = {cracky=default.dig.rail,attached_node=1,rail=1,connect_to_raillike=1},
|
||||
})
|
||||
|
||||
minetest.register_node("carts:powerrail_off", {
|
||||
|
@ -504,7 +504,7 @@ minetest.register_node("carts:powerrail_off", {
|
|||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||
},
|
||||
groups = {dig_immediate=2,attached_node=1,rail=1,connect_to_raillike=1},
|
||||
groups = {cracky=default.dig.rail,attached_node=1,rail=1,connect_to_raillike=1},
|
||||
|
||||
after_place_node = function(pos)
|
||||
local level = redstone.level_at(pos)
|
||||
|
@ -538,7 +538,7 @@ minetest.register_node("carts:powerrail_on", {
|
|||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||
},
|
||||
groups = {dig_immediate=2,attached_node=1,rail=1,connect_to_raillike=1,not_in_creative_inventory=1},
|
||||
groups = {cracky=default.dig.rail,attached_node=1,rail=1,connect_to_raillike=1,not_in_creative_inventory=1},
|
||||
|
||||
redstone_update = function(pos)
|
||||
local level = redstone.level_at(pos)
|
||||
|
|
|
@ -149,7 +149,7 @@ if minetest.setting_getbool("creative_mode") then
|
|||
cracky = get_list(20),
|
||||
snappy = get_list(2),
|
||||
choppy = get_list(9),
|
||||
dig_immediate = get_list(3), -- TODO doesnt work
|
||||
dig = get_list(7),
|
||||
},
|
||||
damage_groups = {fleshy = 10},
|
||||
}
|
||||
|
|
|
@ -58,6 +58,15 @@ default.dig = {
|
|||
-- Snappy (shears)
|
||||
leaves = 1,
|
||||
wool = 2,
|
||||
|
||||
-- Dig (tool doesnt matter but count as a use)
|
||||
bed = 1,
|
||||
cactus = 2,
|
||||
glass = 3,
|
||||
ladder = 4,
|
||||
glowstone = 5,
|
||||
lever = 6,
|
||||
button = 7,
|
||||
}
|
||||
|
||||
-- Load files
|
||||
|
|
|
@ -253,7 +253,7 @@ minetest.register_node("default:cactus", {
|
|||
tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
|
||||
is_ground_content = true,
|
||||
stack_max = 64,
|
||||
groups = {dig_immediate=2,flammable=2},
|
||||
groups = {dig=default.dig.cactus},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
|
@ -291,7 +291,7 @@ minetest.register_node("default:glass", {
|
|||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
stack_max = 64,
|
||||
groups = {dig_immediate=2},
|
||||
groups = {dig=default.dig.glass},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
|
@ -350,7 +350,7 @@ minetest.register_node("default:ladder", {
|
|||
--wall_bottom = = <default>
|
||||
--wall_side = = <default>
|
||||
},
|
||||
groups = {dig_immediate=2,flammable=2,attached_node=1},
|
||||
groups = {dig=default.dig.ladder,flammable=2,attached_node=1},
|
||||
legacy_wallmounted = true,
|
||||
stack_max = 64,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
|
|
@ -1,40 +1,57 @@
|
|||
-- mods/default/tools.lua
|
||||
|
||||
local function get_groupcaps(uses, group, table)
|
||||
local tmp = {
|
||||
cracky = {times={
|
||||
[default.dig.ice] = 0.75,
|
||||
[default.dig.rail] = 1.05,
|
||||
}, uses=uses},
|
||||
crumbly = {times={
|
||||
[default.dig.dirt_with_grass] = 0.9,
|
||||
[default.dig.dirt] = 0.75,
|
||||
[default.dig.sand] = 0.75,
|
||||
[default.dig.gravel] = 0.9,
|
||||
[default.dig.clay] = 0.9,
|
||||
[default.dig.nethersand] = 0.75,
|
||||
}, uses=uses},
|
||||
choppy = {times={
|
||||
[default.dig.tree] = 3,
|
||||
[default.dig.wood] = 3,
|
||||
[default.dig.bookshelf] = 2.25,
|
||||
[default.dig.fence] = 3,
|
||||
[default.dig.sign] = 1.5,
|
||||
[default.dig.chest] = 3.75,
|
||||
[default.dig.wooden_door] = 4.5,
|
||||
[default.dig.workbench] = 3.75,
|
||||
[default.dig.pressure_plate_wood] = 0.75,
|
||||
}, uses=uses},
|
||||
snappy = {times={
|
||||
[default.dig.leaves] = 0.3,
|
||||
[default.dig.wool] = 1.2,
|
||||
}, uses=uses},
|
||||
dig = {times={
|
||||
[default.dig.bed] = 0.3,
|
||||
[default.dig.cactus] = 0.6,
|
||||
[default.dig.glass] = 0.45,
|
||||
[default.dig.ladder] = 0.6,
|
||||
[default.dig.glowstone] = 0.45,
|
||||
[default.dig.lever] = 0.75,
|
||||
[default.dig.button] = 0.75,
|
||||
}, uses=uses},
|
||||
}
|
||||
if group and table then
|
||||
tmp[group] = table
|
||||
end
|
||||
return tmp
|
||||
end
|
||||
|
||||
-- The hand
|
||||
minetest.register_item(":", {
|
||||
type = "none",
|
||||
wield_image = "wieldhand.png",
|
||||
wield_scale = {x=1,y=1,z=2.5},
|
||||
tool_capabilities = {
|
||||
groupcaps = {
|
||||
cracky = {times={
|
||||
[default.dig.ice] = 0.75,
|
||||
[default.dig.rail] = 1.05,
|
||||
}, uses=0},
|
||||
crumbly = {times={
|
||||
[default.dig.dirt_with_grass] = 0.9,
|
||||
[default.dig.dirt] = 0.75,
|
||||
[default.dig.sand] = 0.75,
|
||||
[default.dig.gravel] = 0.9,
|
||||
[default.dig.clay] = 0.9,
|
||||
[default.dig.nethersand] = 0.75,
|
||||
}, uses=0},
|
||||
choppy = {times={
|
||||
[default.dig.tree] = 3,
|
||||
[default.dig.wood] = 3,
|
||||
[default.dig.bookshelf] = 2.25,
|
||||
[default.dig.fence] = 3,
|
||||
[default.dig.sign] = 1.5,
|
||||
[default.dig.chest] = 3.75,
|
||||
[default.dig.wooden_door] = 4.5,
|
||||
[default.dig.workbench] = 3.75,
|
||||
[default.dig.pressure_plate_wood] = 0.75,
|
||||
}, uses=0},
|
||||
snappy = {times={
|
||||
[default.dig.leaves] = 0.3,
|
||||
[default.dig.wool] = 1.2,
|
||||
}, uses=0},
|
||||
},
|
||||
groupcaps = get_groupcaps(0),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
}
|
||||
|
@ -48,8 +65,8 @@ minetest.register_tool("default:pick_wood", {
|
|||
description = "Wooden Pickaxe",
|
||||
inventory_image = "default_tool_woodpick.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
cracky = {times={
|
||||
groupcaps = get_groupcaps(60, "cracky",
|
||||
{times={
|
||||
[default.dig.stone] = 1.15,
|
||||
[default.dig.cobble] = 1.5,
|
||||
[default.dig.coal] = 2.25,
|
||||
|
@ -62,8 +79,8 @@ minetest.register_tool("default:pick_wood", {
|
|||
[default.dig.netherbrick] = 1.5,
|
||||
[default.dig.brick] = 1.5,
|
||||
[default.dig.pressure_plate_stone] = 0.4,
|
||||
}, uses=60},
|
||||
},
|
||||
}, uses=60}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -72,8 +89,8 @@ minetest.register_tool("default:pick_stone", {
|
|||
description = "Stone Pickaxe",
|
||||
inventory_image = "default_tool_stonepick.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
cracky = {times={
|
||||
groupcaps = get_groupcaps(132, "cracky",
|
||||
{times={
|
||||
[default.dig.stone] = 0.6,
|
||||
[default.dig.cobble] = 0.75,
|
||||
[default.dig.coal] = 1.15,
|
||||
|
@ -88,8 +105,8 @@ minetest.register_tool("default:pick_stone", {
|
|||
[default.dig.netherbrick] = 0.75,
|
||||
[default.dig.brick] = 0.75,
|
||||
[default.dig.pressure_plate_stone] = 0.2,
|
||||
}, uses=132},
|
||||
},
|
||||
}, uses=132}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -98,8 +115,8 @@ minetest.register_tool("default:pick_iron", {
|
|||
description = "Iron Pickaxe",
|
||||
inventory_image = "default_tool_ironpick.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
cracky = {times={
|
||||
groupcaps = get_groupcaps(151, "cracky",
|
||||
{times={
|
||||
[default.dig.stone] = 0.4,
|
||||
[default.dig.cobble] = 0.5,
|
||||
[default.dig.coal] = 0.75,
|
||||
|
@ -119,8 +136,8 @@ minetest.register_tool("default:pick_iron", {
|
|||
[default.dig.redstone_ore] = 0.75,
|
||||
[default.dig.brick] = 0.5,
|
||||
[default.dig.pressure_plate_stone] = 0.15,
|
||||
}, uses=251},
|
||||
},
|
||||
}, uses=251}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -129,8 +146,8 @@ minetest.register_tool("default:pick_diamond", {
|
|||
description = "Diamond Pickaxe",
|
||||
inventory_image = "default_tool_diamondpick.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
cracky = {times={
|
||||
groupcaps = get_groupcaps(1562, "cracky",
|
||||
{times={
|
||||
[default.dig.stone] = 0.3,
|
||||
[default.dig.cobble] = 0.4,
|
||||
[default.dig.coal] = 0.6,
|
||||
|
@ -151,8 +168,8 @@ minetest.register_tool("default:pick_diamond", {
|
|||
[default.dig.redstone_ore] = 0.6,
|
||||
[default.dig.brick] = 0.4,
|
||||
[default.dig.pressure_plate_stone] = 0.1,
|
||||
}, uses=1562},
|
||||
},
|
||||
}, uses=1562}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -161,8 +178,8 @@ minetest.register_tool("default:pick_gold", {
|
|||
description = "Gold Pickaxe",
|
||||
inventory_image = "default_tool_goldpick.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
cracky = {times={
|
||||
groupcaps = get_groupcaps(33, "cracky",
|
||||
{times={
|
||||
[default.dig.stone] = 0.2,
|
||||
[default.dig.cobble] = 0.25,
|
||||
[default.dig.coal] = 0.4,
|
||||
|
@ -175,8 +192,8 @@ minetest.register_tool("default:pick_gold", {
|
|||
[default.dig.netherbrick] = 0.25,
|
||||
[default.dig.brick] = 0.25,
|
||||
[default.dig.pressure_plate_stone] = 0.1,
|
||||
}, uses=33},
|
||||
},
|
||||
}, uses=33}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -190,8 +207,8 @@ minetest.register_tool("default:shovel_wood", {
|
|||
description = "Wooden Shovel",
|
||||
inventory_image = "default_tool_woodshovel.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
crumbly = {times={
|
||||
groupcaps = get_groupcaps(60, "crumbly",
|
||||
{times={
|
||||
[default.dig.dirt_with_grass] = 0.45,
|
||||
[default.dig.dirt] = 0.4,
|
||||
[default.dig.sand] = 0.4,
|
||||
|
@ -200,8 +217,8 @@ minetest.register_tool("default:shovel_wood", {
|
|||
[default.dig.snow] = 0.1,
|
||||
[default.dig.snowblock] = 0.15,
|
||||
[default.dig.nethersand] = 0.4,
|
||||
}, uses=60},
|
||||
},
|
||||
}, uses=60}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -210,8 +227,8 @@ minetest.register_tool("default:shovel_stone", {
|
|||
description = "Stone Shovel",
|
||||
inventory_image = "default_tool_stoneshovel.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
crumbly = {times={
|
||||
groupcaps = get_groupcaps(132, "crumbly",
|
||||
{times={
|
||||
[default.dig.dirt_with_grass] = 0.25,
|
||||
[default.dig.dirt] = 0.2,
|
||||
[default.dig.sand] = 0.2,
|
||||
|
@ -220,8 +237,8 @@ minetest.register_tool("default:shovel_stone", {
|
|||
[default.dig.snow] = 0.05,
|
||||
[default.dig.snowblock] = 0.1,
|
||||
[default.dig.nethersand] = 0.2,
|
||||
}, uses=132},
|
||||
},
|
||||
}, uses=132}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -230,8 +247,8 @@ minetest.register_tool("default:shovel_iron", {
|
|||
description = "Iron Shovel",
|
||||
inventory_image = "default_tool_ironshovel.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
crumbly = {times={
|
||||
groupcaps = get_groupcaps(251, "crumbly",
|
||||
{times={
|
||||
[default.dig.dirt_with_grass] = 0.15,
|
||||
[default.dig.dirt] = 0.15,
|
||||
[default.dig.sand] = 0.15,
|
||||
|
@ -240,8 +257,8 @@ minetest.register_tool("default:shovel_iron", {
|
|||
[default.dig.snow] = 0.05,
|
||||
[default.dig.snowblock] = 0.05,
|
||||
[default.dig.nethersand] = 0.15,
|
||||
}, uses=251},
|
||||
},
|
||||
}, uses=251}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -250,8 +267,8 @@ minetest.register_tool("default:shovel_diamond", {
|
|||
description = "Diamond Shovel",
|
||||
inventory_image = "default_tool_diamondshovel.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
crumbly = {times={
|
||||
groupcaps = get_groupcaps(1562, "crumbly",
|
||||
{times={
|
||||
[default.dig.dirt_with_grass] = 0.15,
|
||||
[default.dig.dirt] = 0.1,
|
||||
[default.dig.sand] = 0.1,
|
||||
|
@ -260,8 +277,8 @@ minetest.register_tool("default:shovel_diamond", {
|
|||
[default.dig.snow] = 0.05,
|
||||
[default.dig.snowblock] = 0.05,
|
||||
[default.dig.nethersand] = 0.1,
|
||||
}, uses=1562},
|
||||
},
|
||||
}, uses=1562}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -270,8 +287,8 @@ minetest.register_tool("default:shovel_gold", {
|
|||
description = "Gold Shovel",
|
||||
inventory_image = "default_tool_goldshovel.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
crumbly = {times={
|
||||
groupcaps = get_groupcaps(33, "crumbly",
|
||||
{times={
|
||||
[default.dig.dirt_with_grass] = 0.1,
|
||||
[default.dig.dirt] = 0.1,
|
||||
[default.dig.sand] = 0.1,
|
||||
|
@ -280,8 +297,8 @@ minetest.register_tool("default:shovel_gold", {
|
|||
[default.dig.snow] = 0.05,
|
||||
[default.dig.snowblock] = 0.05,
|
||||
[default.dig.nethersand] = 0.1,
|
||||
}, uses=33},
|
||||
},
|
||||
}, uses=33}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -295,8 +312,8 @@ minetest.register_tool("default:axe_wood", {
|
|||
description = "Wooden Axe",
|
||||
inventory_image = "default_tool_woodaxe.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
choppy = {times={
|
||||
groupcaps = get_groupcaps(60, "choppy",
|
||||
{times={
|
||||
[default.dig.tree] = 1.5,
|
||||
[default.dig.wood] = 1.5,
|
||||
[default.dig.bookshelf] = 1.15,
|
||||
|
@ -306,8 +323,8 @@ minetest.register_tool("default:axe_wood", {
|
|||
[default.dig.wooden_door] = 2.25,
|
||||
[default.dig.workbench] = 1.9,
|
||||
[default.dig.pressure_plate_wood] = 0.4,
|
||||
}, uses=60},
|
||||
},
|
||||
}, uses=60}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -316,8 +333,8 @@ minetest.register_tool("default:axe_stone", {
|
|||
description = "Stone Axe",
|
||||
inventory_image = "default_tool_stoneaxe.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
choppy = {times={
|
||||
groupcaps = get_groupcaps(132, "choppy",
|
||||
{times={
|
||||
[default.dig.tree] = 0.75,
|
||||
[default.dig.wood] = 0.75,
|
||||
[default.dig.bookshelf] = 0.6,
|
||||
|
@ -327,8 +344,8 @@ minetest.register_tool("default:axe_stone", {
|
|||
[default.dig.wooden_door] = 1.15,
|
||||
[default.dig.workbench] = 0.95,
|
||||
[default.dig.pressure_plate_wood] = 0.2,
|
||||
}, uses=132},
|
||||
},
|
||||
}, uses=132}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -337,8 +354,8 @@ minetest.register_tool("default:axe_iron", {
|
|||
description = "Iron Axe",
|
||||
inventory_image = "default_tool_ironaxe.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
choppy = {times={
|
||||
groupcaps = get_groupcaps(251, "choppy",
|
||||
{times={
|
||||
[default.dig.tree] = 0.5,
|
||||
[default.dig.wood] = 0.5,
|
||||
[default.dig.bookshelf] = 0.4,
|
||||
|
@ -348,8 +365,8 @@ minetest.register_tool("default:axe_iron", {
|
|||
[default.dig.wooden_door] = 0.75,
|
||||
[default.dig.workbench] = 0.65,
|
||||
[default.dig.pressure_plate_wood] = 0.15,
|
||||
}, uses=251},
|
||||
},
|
||||
}, uses=251}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -358,8 +375,8 @@ minetest.register_tool("default:axe_diamond", {
|
|||
description = "Diamond Axe",
|
||||
inventory_image = "default_tool_diamondaxe.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
choppy = {times={
|
||||
groupcaps = get_groupcaps(1562, "choppy",
|
||||
{times={
|
||||
[default.dig.tree] = 0.4,
|
||||
[default.dig.wood] = 0.4,
|
||||
[default.dig.bookshelf] = 0.3,
|
||||
|
@ -369,8 +386,8 @@ minetest.register_tool("default:axe_diamond", {
|
|||
[default.dig.wooden_door] = 0.6,
|
||||
[default.dig.workbench] = 0.5,
|
||||
[default.dig.pressure_plate_wood] = 0.1,
|
||||
}, uses=1562},
|
||||
},
|
||||
}, uses=1562}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -379,8 +396,8 @@ minetest.register_tool("default:axe_gold", {
|
|||
description = "Gold Axe",
|
||||
inventory_image = "default_tool_goldaxe.png",
|
||||
tool_capabilities = {
|
||||
groupcaps={
|
||||
choppy = {times={
|
||||
groupcaps = get_groupcaps(33, "choppy",
|
||||
{times={
|
||||
[default.dig.tree] = 0.25,
|
||||
[default.dig.wood] = 0.25,
|
||||
[default.dig.bookshelf] = 0.2,
|
||||
|
@ -390,8 +407,8 @@ minetest.register_tool("default:axe_gold", {
|
|||
[default.dig.wooden_door] = 0.4,
|
||||
[default.dig.workbench] = 0.35,
|
||||
[default.dig.pressure_plate_wood] = 0.1,
|
||||
}, uses=33},
|
||||
},
|
||||
}, uses=33}
|
||||
),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
@ -405,6 +422,7 @@ minetest.register_tool("default:sword_wood", {
|
|||
description = "Wooden Sword",
|
||||
inventory_image = "default_tool_woodsword.png",
|
||||
tool_capabilities = {
|
||||
groupcaps = get_groupcaps(60),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=2},
|
||||
}
|
||||
|
@ -413,6 +431,7 @@ minetest.register_tool("default:sword_stone", {
|
|||
description = "Stone Sword",
|
||||
inventory_image = "default_tool_stonesword.png",
|
||||
tool_capabilities = {
|
||||
groupcaps = get_groupcaps(132),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=4},
|
||||
}
|
||||
|
@ -421,6 +440,7 @@ minetest.register_tool("default:sword_iron", {
|
|||
description = "Iron Sword",
|
||||
inventory_image = "default_tool_ironsword.png",
|
||||
tool_capabilities = {
|
||||
groupcaps = get_groupcaps(251),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=6},
|
||||
}
|
||||
|
@ -429,6 +449,7 @@ minetest.register_tool("default:sword_gold", {
|
|||
description = "Gold Sword",
|
||||
inventory_image = "default_tool_goldsword.png",
|
||||
tool_capabilities = {
|
||||
groupcaps = get_groupcaps(1562),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=6},
|
||||
}
|
||||
|
@ -437,6 +458,7 @@ minetest.register_tool("default:sword_diamond", {
|
|||
description = "Diamond Sword",
|
||||
inventory_image = "default_tool_diamondsword.png",
|
||||
tool_capabilities = {
|
||||
groupcaps = get_groupcaps(33),
|
||||
full_punch_interval = 1,
|
||||
damage_groups = {fleshy=8},
|
||||
}
|
||||
|
|
|
@ -356,7 +356,7 @@ minetest.register_node("nether:glowstone", {
|
|||
{items = {'nether:glowstone_dust'},rarity=0},
|
||||
}
|
||||
},
|
||||
groups = {dig_immediate=2},
|
||||
groups = {dig=default.dig.glowstone},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ minetest.register_node("redstone:lever_off", {
|
|||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
stack_max = 64,
|
||||
groups = {dig_immediate=3,attached_node=1},
|
||||
groups = {dig=default.dig.lever,attached_node=1},
|
||||
sounds = default.node_sound_defaults(),
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
|
@ -249,7 +249,7 @@ minetest.register_node("redstone:lever_on", {
|
|||
paramtype2 = "wallmounted",
|
||||
drop = "redstone:lever_off",
|
||||
walkable = false,
|
||||
groups = {dig_immediate=3,attached_node=1,not_in_creative_inventory=1},
|
||||
groups = {dig=default.dig.lever,attached_node=1,not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_defaults(),
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
|
@ -404,7 +404,7 @@ minetest.register_node("redstone:button", {
|
|||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {dig_immediate=2},
|
||||
groups = {dig=default.dig.button},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
|
|
|
@ -113,7 +113,7 @@ minetest.register_node("tnt:tnt", {
|
|||
description = "TNT",
|
||||
tiles = {"tnt_top.png", "tnt_bottom.png", "tnt_side.png"},
|
||||
stack_max = 64,
|
||||
groups = {dig_immediate=2, mesecon=2},
|
||||
groups = {dig_immediate=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_rightclick = function(pos, node, puncher)
|
||||
|
@ -138,8 +138,9 @@ minetest.register_node("tnt:tnt", {
|
|||
minetest.register_node("tnt:tnt_burning", {
|
||||
tiles = {{name="tnt_top_burning_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1}}, "tnt_bottom.png", "tnt_side.png"},
|
||||
light_source = 5,
|
||||
drop = "",
|
||||
drop = "tnt:tnt",
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
groups = {dig_immediate=3},
|
||||
})
|
||||
|
||||
minetest.register_node("tnt:boom", {
|
||||
|
@ -151,105 +152,10 @@ minetest.register_node("tnt:boom", {
|
|||
groups = {dig_immediate=3},
|
||||
})
|
||||
|
||||
burn = function(pos)
|
||||
if minetest.env:get_node(pos).name == "tnt:tnt" then
|
||||
minetest.sound_play("tnt_ignite", {pos=pos})
|
||||
minetest.env:set_node(pos, {name="tnt:tnt_burning"})
|
||||
boom(pos, 1)
|
||||
return
|
||||
end
|
||||
if minetest.env:get_node(pos).name ~= "tnt:gunpowder" then
|
||||
return
|
||||
end
|
||||
minetest.sound_play("tnt_gunpowder_burning", {pos=pos, gain=2})
|
||||
minetest.env:set_node(pos, {name="tnt:gunpowder_burning"})
|
||||
|
||||
minetest.after(1, function(pos)
|
||||
if minetest.env:get_node(pos).name ~= "tnt:gunpowder_burning" then
|
||||
return
|
||||
end
|
||||
minetest.after(0.5, function(pos)
|
||||
minetest.env:remove_node(pos)
|
||||
end, {x=pos.x, y=pos.y, z=pos.z})
|
||||
for dx=-1,1 do
|
||||
for dz=-1,1 do
|
||||
for dy=-1,1 do
|
||||
pos.x = pos.x+dx
|
||||
pos.y = pos.y+dy
|
||||
pos.z = pos.z+dz
|
||||
|
||||
if not (math.abs(dx) == 1 and math.abs(dz) == 1) then
|
||||
if dy == 0 then
|
||||
burn({x=pos.x, y=pos.y, z=pos.z})
|
||||
else
|
||||
if math.abs(dx) == 1 or math.abs(dz) == 1 then
|
||||
burn({x=pos.x, y=pos.y, z=pos.z})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
pos.x = pos.x-dx
|
||||
pos.y = pos.y-dy
|
||||
pos.z = pos.z-dz
|
||||
end
|
||||
end
|
||||
end
|
||||
end, pos)
|
||||
end
|
||||
|
||||
minetest.register_node("tnt:gunpowder", {
|
||||
minetest.register_craftitem("tnt:gunpowder", {
|
||||
description = "Gun Powder",
|
||||
drawtype = "raillike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
tiles = {"tnt_gunpowder.png",},
|
||||
inventory_image = "tnt_gunpowder_inventory.png",
|
||||
wield_image = "tnt_gunpowder_inventory.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||
},
|
||||
stack_max = 64,
|
||||
groups = {dig_immediate=2,attached_node=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_punch = function(pos, node, puncher)
|
||||
if puncher:get_wielded_item():get_name() == "default:torch" then
|
||||
burn(pos)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("tnt:gunpowder_burning", {
|
||||
drawtype = "raillike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
light_source = 5,
|
||||
tiles = {{name="tnt_gunpowder_burning_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1}}},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||
},
|
||||
drop = "",
|
||||
groups = {dig_immediate=2,attached_node=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"tnt:tnt", "tnt:gunpowder"},
|
||||
neighbors = {"fire:basic_flame"},
|
||||
interval = 2,
|
||||
chance = 10,
|
||||
action = function(pos, node)
|
||||
if node.name == "tnt:tnt" then
|
||||
minetest.env:set_node(pos, {name="tnt:tnt_burning"})
|
||||
boom({x=pos.x, y=pos.y, z=pos.z}, 0)
|
||||
else
|
||||
burn(pos)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
@ -266,7 +172,3 @@ minetest.register_craft({
|
|||
{"tnt:gunpowder", "group:sand", "tnt:gunpowder"}
|
||||
}
|
||||
})
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "tnt loaded")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue