mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-21 07:59:19 +00:00
添加全部物品分类
This commit is contained in:
@@ -509,11 +509,10 @@ items:
|
||||
textures:
|
||||
texture: minecraft:block/custom/palm_planks
|
||||
|
||||
items#pfence:
|
||||
items#fence:
|
||||
default:palm_fence:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.palm_fence>
|
||||
data::item-name: <!i><l10n:item.palm_fence>
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/palm_fence_inventory
|
||||
@@ -526,6 +525,7 @@ items#pfence:
|
||||
block: default:palm_fence
|
||||
default:palm_fence_post:
|
||||
material: nether_brick
|
||||
data::item-name: <!i><l10n:item.palm_fence_gate>
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:block/custom/palm_fence_post
|
||||
@@ -535,6 +535,7 @@ items#pfence:
|
||||
texture: minecraft:block/custom/palm_planks
|
||||
default:palm_fence_side:
|
||||
material: nether_brick
|
||||
data::item-name: <!i><l10n:item.palm_fence_gate>
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:block/custom/palm_fence_side
|
||||
@@ -593,6 +594,7 @@ items#button:
|
||||
block: default:palm_button
|
||||
default:palm_button_pressed:
|
||||
material: nether_brick
|
||||
data::item-name: <!i><l10n:item.palm_button>
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:block/custom/palm_button_pressed
|
||||
@@ -602,6 +604,7 @@ items#button:
|
||||
texture: minecraft:block/custom/palm_planks
|
||||
default:palm_button_not_pressed:
|
||||
material: nether_brick
|
||||
data::item-name: <!i><l10n:item.palm_button>
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:block/custom/palm_button_not_pressed
|
||||
|
||||
@@ -20,15 +20,15 @@ items:
|
||||
default:flower_basket_ground:
|
||||
material: nether_brick
|
||||
model: minecraft:item/custom/flower_basket_ground
|
||||
item-name: <!i><l10n:item.flower_basket>
|
||||
data::item-name: <!i><l10n:item.flower_basket>
|
||||
default:flower_basket_wall:
|
||||
material: nether_brick
|
||||
model: minecraft:item/custom/flower_basket_wall
|
||||
item-name: <!i><l10n:item.flower_basket>
|
||||
data::item-name: <!i><l10n:item.flower_basket>
|
||||
default:flower_basket_ceiling:
|
||||
material: nether_brick
|
||||
model: minecraft:item/custom/flower_basket_ceiling
|
||||
item-name: <!i><l10n:item.flower_basket>
|
||||
data::item-name: <!i><l10n:item.flower_basket>
|
||||
furniture:
|
||||
default:flower_basket:
|
||||
events:
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
categories:
|
||||
craftengine:all:
|
||||
priority: -1000
|
||||
name: <!i><white><l10n:category.all.name></white>
|
||||
icon: minecraft:command_block
|
||||
conditions:
|
||||
- type: permission
|
||||
permission: craftengine.admin
|
||||
all-items: true
|
||||
images:
|
||||
internal:item_browser:
|
||||
height: 140
|
||||
|
||||
@@ -12,6 +12,7 @@ translations:
|
||||
internal.cooking_info: Recipe Information
|
||||
internal.cooking_info.0: 'Time: <arg:cooking_time>ticks'
|
||||
internal.cooking_info.1: 'Experience: <arg:cooking_experience>'
|
||||
category.all.name: 'All Items'
|
||||
zh_cn:
|
||||
internal.next_page: 下一页
|
||||
internal.previous_page: 上一页
|
||||
@@ -25,6 +26,7 @@ translations:
|
||||
internal.cooking_info: 配方信息
|
||||
internal.cooking_info.0: '时间: <arg:cooking_time>刻'
|
||||
internal.cooking_info.1: '经验: <arg:cooking_experience>'
|
||||
category.all.name: '全部物品'
|
||||
de:
|
||||
internal.next_page: Nächste Seite
|
||||
internal.previous_page: Vorherige Seite
|
||||
|
||||
@@ -51,7 +51,7 @@ public abstract class AbstractItemManager<I> extends AbstractModelGenerator impl
|
||||
private final ItemParser itemParser;
|
||||
private final EquipmentParser equipmentParser;
|
||||
protected final Map<String, ExternalItemSource<I>> externalItemSources = new HashMap<>();
|
||||
protected final Map<Key, CustomItem<I>> customItemsById = new HashMap<>();
|
||||
protected final Map<Key, CustomItem<I>> customItemsById = new LinkedHashMap<>();
|
||||
protected final Map<String, CustomItem<I>> customItemsByPath = new HashMap<>();
|
||||
protected final Map<Key, List<UniqueKey>> customItemTags = new HashMap<>();
|
||||
protected final Map<Key, ModernItemModel> modernItemModels1_21_4 = new HashMap<>();
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.momirealms.craftengine.core.entity.player.Player;
|
||||
import net.momirealms.craftengine.core.item.Item;
|
||||
import net.momirealms.craftengine.core.item.ItemBuildContext;
|
||||
import net.momirealms.craftengine.core.item.ItemKeys;
|
||||
import net.momirealms.craftengine.core.item.ItemManager;
|
||||
import net.momirealms.craftengine.core.item.recipe.*;
|
||||
import net.momirealms.craftengine.core.pack.LoadingSequence;
|
||||
import net.momirealms.craftengine.core.pack.Pack;
|
||||
@@ -24,6 +25,7 @@ import net.momirealms.craftengine.core.util.*;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@SuppressWarnings("DuplicatedCode")
|
||||
public class ItemBrowserManagerImpl implements ItemBrowserManager {
|
||||
@@ -120,7 +122,13 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager {
|
||||
@Override
|
||||
public void parseSection(Pack pack, Path path, String node, Key id, Map<String, Object> section) {
|
||||
String name = section.getOrDefault("name", id).toString();
|
||||
List<String> members = MiscUtils.getAsStringList(section.getOrDefault("list", List.of()));
|
||||
List<String> members;
|
||||
if (ResourceConfigUtils.getAsBoolean(section.get("all-items"), "all-items")) {
|
||||
ItemManager<?> itemManager = ItemBrowserManagerImpl.this.plugin.itemManager();
|
||||
members = itemManager.loadedItems().keySet().stream().filter(it -> !itemManager.isVanillaItem(it)).map(Key::asString).collect(Collectors.toList());
|
||||
} else {
|
||||
members = MiscUtils.getAsStringList(section.getOrDefault("list", List.of()));
|
||||
}
|
||||
Key icon = Key.of(section.getOrDefault("icon", ItemKeys.STONE).toString());
|
||||
int priority = ResourceConfigUtils.getAsInt(section.getOrDefault("priority", 0), "priority");
|
||||
List<String> lore = MiscUtils.getAsStringList(section.getOrDefault("lore", List.of()));
|
||||
|
||||
Reference in New Issue
Block a user