From 62f755f52aa955c8ee42c728d86bf61898690b36 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 11 Jun 2017 22:20:25 +0200 Subject: [PATCH] Remove heads and pumpkin from combat creative tab --- GROUPS.md | 1 + mods/HUD/mcl_inventory/creative.lua | 8 ++++---- mods/ITEMS/mcl_farming/pumpkin.lua | 2 +- mods/ITEMS/mcl_heads/init.lua | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/GROUPS.md b/GROUPS.md index 30ce52cfb..344868190 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -127,6 +127,7 @@ These groups are used mostly for informational purposes * `cocoa`: Node is a cocoa pod (rating is growth stage, ranging from 1 to 3) * `ammo=1`: Item is used as ammo for a weapon * `ammo_bow=1`: Item is used as ammo for bows +* `non_combat_armor=1`: Item can be equipped as armor, but is not made for combat (e.g. zombie head, pumpkin) * `container`: Node is a container which physically stores items within and has at least 1 inventory * `container=2`: Has one inventory with list name `"main"`. Items can be placed and taken freely * `container=3`: Same as `container=2`, but shulker boxes can not be inserted diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index a17bf0d3d..9d4c5dd11 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -22,8 +22,8 @@ do local is_tool = function(def) return def.groups.tool or (def.tool_capabilities ~= nil and def.tool_capabilities.damage_groups == nil) end - local is_weapon = function(def) - return def.groups.weapon or def.groups.weapon_ranged or def.groups.ammo or def.groups.armor_head or def.groups.armor_torso or def.groups.armor_legs or def.groups.armor_feet + local is_weapon_or_armor = function(def) + return def.groups.weapon or def.groups.weapon_ranged or def.groups.ammo or ((def.groups.armor_head or def.groups.armor_torso or def.groups.armor_legs or def.groups.armor_feet) and def.groups.non_combat_armor ~= 1) end if def.groups.building_block then table.insert(inventory_lists["blocks"], name) @@ -43,7 +43,7 @@ do if is_tool(def) then table.insert(inventory_lists["tools"], name) end - if is_weapon(def) then + if is_weapon_or_armor(def) then table.insert(inventory_lists["combat"], name) end if def.groups.brewitem then @@ -52,7 +52,7 @@ do if def.groups.craftitem then table.insert(inventory_lists["matr"], name) end - if not def.groups.building_block and not def.groups.deco_block and not is_redstone(def) and not def.groups.transport and not def.groups.food and not def.groups.eatable and not is_tool(def) and not is_weapon(def) and not def.groups.craftitem and not def.groups.brewitem then + if not def.groups.building_block and not def.groups.deco_block and not is_redstone(def) and not def.groups.transport and not def.groups.food and not def.groups.eatable and not is_tool(def) and not is_weapon_or_armor(def) and not def.groups.craftitem and not def.groups.brewitem then table.insert(inventory_lists["misc"], name) end diff --git a/mods/ITEMS/mcl_farming/pumpkin.lua b/mods/ITEMS/mcl_farming/pumpkin.lua index 0cb07eda0..0315ac93d 100644 --- a/mods/ITEMS/mcl_farming/pumpkin.lua +++ b/mods/ITEMS/mcl_farming/pumpkin.lua @@ -79,7 +79,7 @@ local pumpkin_base_def = { stack_max = 64, paramtype2 = "facedir", tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face.png"}, - groups = {handy=1,axey=1, plant=1,building_block=1, armor_head=1, dig_by_piston=1}, + groups = {handy=1,axey=1, plant=1,building_block=1, armor_head=1,non_combat_armor=1, dig_by_piston=1}, sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 5, _mcl_hardness = 1, diff --git a/mods/ITEMS/mcl_heads/init.lua b/mods/ITEMS/mcl_heads/init.lua index d810211d4..41962c8af 100644 --- a/mods/ITEMS/mcl_heads/init.lua +++ b/mods/ITEMS/mcl_heads/init.lua @@ -12,7 +12,7 @@ local function addhead(node, desc, longdesc) { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, }, }, }, - groups = {handy=1, armor_head=1, head=1, deco_block=1, dig_by_piston=1}, + groups = {handy=1, armor_head=1,non_combat_armor=1, head=1, deco_block=1, dig_by_piston=1}, tiles = { "head_"..node.."_top.png", "head_"..node.."_top.png",