From 505cdb9d43656d2cb8dddba32a82f5a81885ec0e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 30 Aug 2017 21:51:27 +0200 Subject: [PATCH] Hide minecart with command block from Creative --- README.md | 7 ++++--- mods/ENTITIES/mcl_minecarts/init.lua | 16 +++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4b5790b93..105c42814 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,15 @@ Or you can play in “creative mode” in which you can build almost anything in More help about the gameplay, blocks items and much more can be found from inside the game. You can access the help from your inventory menu. -### Special blocks -The following blocks are interesting for Creative Mode and for adventure +### Special items +The following items are interesting for Creative Mode and for adventure map builders. They can not be obtained in-game or in the creative inventory. * Barrier: `mcl_core:barrier` * Command Block: `mesecons_commandblock:commandblock_off` -* Monster Spawner (WIP): `mcl_mobspawners:spawner` +* Monster Spawner: `mcl_mobspawners:spawner` * Huge mushroom blocks: See `mods/ITEMS/mcl_mushrooms/README.md` +* Minecart with Command Block: `mcl_minecarts:command_block_minecart` Use the `/giveme` chat command to obtain them. See the in-game help for an explanation. diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 76141a1b7..c9df0cfd1 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -328,9 +328,13 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing) return itemstack end -local register_craftitem = function(itemstring, entity_id, description, longdesc, usagehelp, icon) +local register_craftitem = function(itemstring, entity_id, description, longdesc, usagehelp, icon, creative) entity_mapping[itemstring] = entity_id + local groups = { minecart = 1, transport = 1 } + if creative == false then + groups.not_in_creative_inventory = 1 + end local def = { stack_max = 1, on_place = function(itemstack, placer, pointed_thing) @@ -348,7 +352,7 @@ local register_craftitem = function(itemstring, entity_id, description, longdesc return mcl_minecarts.place_minecart(itemstack, pointed_thing) end, - groups = { minecart = 1, transport = 1}, + groups = groups, } def.description = description def._doc_items_longdesc = longdesc @@ -358,9 +362,9 @@ local register_craftitem = function(itemstring, entity_id, description, longdesc minetest.register_craftitem(itemstring, def) end -local function register_minecart(itemstring, entity_id, description, longdesc, usagehelp, mesh, textures, icon, drop, on_rightclick) +local function register_minecart(itemstring, entity_id, description, longdesc, usagehelp, mesh, textures, icon, drop, on_rightclick, creative) register_entity(entity_id, mesh, textures, drop, on_rightclick) - register_craftitem(itemstring, entity_id, description, longdesc, usagehelp, icon) + register_craftitem(itemstring, entity_id, description, longdesc, usagehelp, icon, creative) if minetest.get_modpath("doc_identifier") ~= nil then doc.sub.identifier.register_object(entity_id, "craftitems", itemstring) end @@ -468,7 +472,9 @@ register_minecart( "mcl_minecarts_minecart.png", }, "mcl_minecarts_minecart_command_block.png", - {"mcl_minecarts:minecart"} + {"mcl_minecarts:minecart"}, + nil, + false ) -- Minecart with Hopper