9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-26 10:29:20 +00:00

允许重叠的物品

This commit is contained in:
XiaoMoMi
2025-09-11 02:15:09 +08:00
parent e1fdc17fd2
commit b817426575
4 changed files with 9 additions and 7 deletions

View File

@@ -44,7 +44,8 @@ public class BukkitWorld implements World {
@Override
public WorldHeight worldHeight() {
if (this.worldHeight == null) {
this.worldHeight = WorldHeight.create(platformWorld().getMinHeight(), platformWorld().getMaxHeight() - platformWorld().getMinHeight());
org.bukkit.World bWorld = platformWorld();
this.worldHeight = WorldHeight.create(bWorld.getMinHeight(), bWorld.getMaxHeight() - bWorld.getMinHeight());
}
return this.worldHeight;
}

View File

@@ -72,6 +72,8 @@ categories:
- default:solid_gunpowder_block
- default:ender_pearl_flower_seeds
- default:gui_head_size_1
- default:gui_head_size_4
- minecraft:air
- default:copper_coil
- default:flame_elytra
- default:cap
@@ -79,5 +81,6 @@ categories:
- default:chessboard_block
- default:safe_block
- default:sofa
- default:connectable_sofa
- default:gui_head_size_4
- minecraft:air
- minecraft:air
- default:connectable_sofa

View File

@@ -26,9 +26,7 @@ public class Category implements Comparable<Category> {
}
public void addMember(String member) {
if (!this.members.contains(member)) {
this.members.add(member);
}
this.members.add(member);
}
public Key id() {

View File

@@ -114,7 +114,7 @@ public class ItemBrowserManagerImpl implements ItemBrowserManager {
List<String> 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");
Category category = new Category(id, name, MiscUtils.getAsStringList(section.getOrDefault("lore", List.of())), icon, members.stream().distinct().toList(), priority,
Category category = new Category(id, name, MiscUtils.getAsStringList(section.getOrDefault("lore", List.of())), icon, new ArrayList<>(members), priority,
ResourceConfigUtils.getAsBoolean(section.getOrDefault("hidden", false), "hidden"));
if (ItemBrowserManagerImpl.this.byId.containsKey(id)) {
ItemBrowserManagerImpl.this.byId.get(id).merge(category);