Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all nodes un-blastable, increase stack size to 65535 #32

Merged
merged 1 commit into from
Jul 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading