Skip to content

Commit

Permalink
Make all nodes un-blastable, increase stack size to 65535 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxionary committed Jul 2, 2022
1 parent f3464f5 commit 2100ca0
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 187 deletions.
2 changes: 1 addition & 1 deletion craftitems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ end
minetest.register_craftitem("maptools:infinitefuel", {
description = S("Infinite Fuel"),
inventory_image = "maptools_infinitefuel.png",
stack_max = 10000,
stack_max = 65535,
groups = {not_in_creative_inventory = maptools.creative},
})

Expand Down
18 changes: 1 addition & 17 deletions default_nodes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,10 @@ Licensed under the zlib license. See LICENSE.md for more information.
--]]

local S = maptools.S
local register_node = maptools.register_node

maptools.creative = maptools.config["hide_from_creative_inventory"]

local function register_node(name, def)
-- Increase the interaction range when holding Map Tools nodes to make building easier.
def.range = 12
def.stack_max = 10000
def.drop = ""
if def.groups then
def.groups.unbreakable = 1
def.groups.not_in_creative_inventory = maptools.creative
else
def.groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative}
end
def.on_drop = maptools.drop_msg
-- Prevent Map Tools nodes from being exploded by TNT.
def.on_blast = function() end
minetest.register_node(name, def)
end

register_node("maptools:stone", {
description = S("Unbreakable Stone"),
tiles = {"default_stone.png"},
Expand Down
19 changes: 19 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ maptools.drop_msg = function(itemstack, player)
minetest.chat_send_player(name, S("[maptools] tools/nodes do not drop!"))
end

function maptools.register_node(name, def)
-- Increase the interaction range when holding Map Tools nodes to make building easier.
def.range = 12
def.stack_max = 65535
def.drop = ""
if def.groups then
if not def.groups.dig_immediate then
def.groups.unbreakable = 1
end
def.groups.not_in_creative_inventory = maptools.creative
else
def.groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative}
end
def.on_drop = maptools.drop_msg
-- Prevent Map Tools nodes from being exploded by TNT.
def.on_blast = function() end
minetest.register_node(name, def)
end

dofile(modpath .. "/config.lua")
dofile(modpath .. "/aliases.lua")
dofile(modpath .. "/craftitems.lua")
Expand Down

0 comments on commit 2100ca0

Please sign in to comment.