Respect config settings and remove glue from creative

This commit is contained in:
stujones11 2016-12-31 19:33:21 +00:00
parent b2397014c6
commit c56f2fa17f
1 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@ end
dofile(minetest.get_modpath(minetest.get_current_modname()).."/api.lua") dofile(minetest.get_modpath(minetest.get_current_modname()).."/api.lua")
local ctrl_groups = {choppy=2, oddly_breakable_by_hand=2}
local has_worldedit = minetest.global_exists("worldedit") local has_worldedit = minetest.global_exists("worldedit")
local is_singleplayer = minetest.is_singleplayer() local is_singleplayer = minetest.is_singleplayer()
local control_textures = { local control_textures = {
@ -44,6 +45,10 @@ if meshnode.config.autoconf == true then
minetest.setting_set("max_objects_per_block", "4096") minetest.setting_set("max_objects_per_block", "4096")
end end
if meshnode.config.show_in_creative == false then
ctrl_groups.not_in_creative_inventory = 1
end
local function has_privilege(name) local function has_privilege(name)
if is_singleplayer then if is_singleplayer then
return true return true
@ -308,7 +313,7 @@ minetest.register_node("meshnode:controller", {
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
tiles = control_textures, tiles = control_textures,
groups = {choppy=2, oddly_breakable_by_hand=2}, groups = ctrl_groups,
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -366,6 +371,7 @@ minetest.register_tool("meshnode:glue", {
description = S("Meshnode Glue"), description = S("Meshnode Glue"),
inventory_image = "meshnode_glue.png", inventory_image = "meshnode_glue.png",
liquids_pointable = true, liquids_pointable = true,
groups = {not_in_creative_inventory=1},
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local meta = itemstack:get_metadata() local meta = itemstack:get_metadata()
local parent = meshnode.get_luaentity(meta) local parent = meshnode.get_luaentity(meta)