From 29b5d4880910054098fa4196655db40bcfa8f974 Mon Sep 17 00:00:00 2001 From: XiaoMoMi Date: Mon, 28 Jul 2025 20:30:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=A9=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=97=A0=E6=95=88=E4=B8=8D=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- .../bukkit/item/BukkitItemManager.java | 9 +++----- .../default/configuration/furniture.yml | 21 +++++++------------ 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 4c6e8fa0b..535c1c54d 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ repositories { ``` ```kotlin dependencies { - compileOnly("net.momirealms:craft-engine-core:0.0.59") - compileOnly("net.momirealms:craft-engine-bukkit:0.0.59") + compileOnly("net.momirealms:craft-engine-core:0.0.61") + compileOnly("net.momirealms:craft-engine-bukkit:0.0.61") } ``` \ No newline at end of file diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/item/BukkitItemManager.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/item/BukkitItemManager.java index 64e8735e5..9a060037f 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/item/BukkitItemManager.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/item/BukkitItemManager.java @@ -12,10 +12,7 @@ import net.momirealms.craftengine.bukkit.item.listener.DebugStickListener; import net.momirealms.craftengine.bukkit.item.listener.ItemEventListener; import net.momirealms.craftengine.bukkit.nms.FastNMS; import net.momirealms.craftengine.bukkit.plugin.BukkitCraftEngine; -import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.CoreReflections; -import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MBuiltInRegistries; -import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MRegistries; -import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MRegistryOps; +import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.*; import net.momirealms.craftengine.bukkit.util.ItemStackUtils; import net.momirealms.craftengine.bukkit.util.KeyUtils; import net.momirealms.craftengine.core.entity.player.Player; @@ -380,10 +377,10 @@ public class BukkitItemManager extends AbstractItemManager { protected CustomItem.Builder createPlatformItemBuilder(UniqueKey id, Key materialId, Key clientBoundMaterialId) { Object item = FastNMS.INSTANCE.method$Registry$getValue(MBuiltInRegistries.ITEM, KeyUtils.toResourceLocation(materialId)); Object clientBoundItem = materialId == clientBoundMaterialId ? item : FastNMS.INSTANCE.method$Registry$getValue(MBuiltInRegistries.ITEM, KeyUtils.toResourceLocation(clientBoundMaterialId)); - if (item == null) { + if (item == MItems.AIR) { throw new LocalizedResourceConfigException("warning.config.item.invalid_material", materialId.toString()); } - if (clientBoundItem == null) { + if (clientBoundItem == MItems.AIR) { throw new LocalizedResourceConfigException("warning.config.item.invalid_material", clientBoundMaterialId.toString()); } return BukkitCustomItem.builder(item, clientBoundItem) diff --git a/common-files/src/main/resources/resources/default/configuration/furniture.yml b/common-files/src/main/resources/resources/default/configuration/furniture.yml index c1c8402fe..23212868d 100644 --- a/common-files/src/main/resources/resources/default/configuration/furniture.yml +++ b/common-files/src/main/resources/resources/default/configuration/furniture.yml @@ -150,24 +150,18 @@ items#flower_basket: default:flower_basket_ground: material: nether_brick custom-model-data: 2004 - data: - item-name: model: type: minecraft:model path: minecraft:item/custom/flower_basket_ground default:flower_basket_wall: material: nether_brick custom-model-data: 2005 - data: - item-name: model: type: minecraft:model path: minecraft:item/custom/flower_basket_wall default:flower_basket_ceiling: material: nether_brick custom-model-data: 2006 - data: - item-name: model: type: minecraft:model path: minecraft:item/custom/flower_basket_ceiling @@ -186,7 +180,7 @@ furniture#flower_basket: placement: ground: rules: - rotation: FOUR + rotation: ANY alignment: ANY elements: - item: default:flower_basket_ground @@ -200,12 +194,11 @@ furniture#flower_basket: can-be-hit-by-projectile: true blocks-building: true position: 0,0,0 - width: 0.9 - height: 0.75 + width: 0.7 + height: 0.5 interactive: true wall: rules: - rotation: FOUR alignment: ANY elements: - item: default:flower_basket_wall @@ -232,7 +225,7 @@ furniture#flower_basket: interactive: true ceiling: rules: - rotation: FOUR + rotation: ANY alignment: ANY elements: - item: default:flower_basket_ceiling @@ -245,7 +238,7 @@ furniture#flower_basket: can-use-item-on: true can-be-hit-by-projectile: true blocks-building: true - position: 0,-0.9,0 - width: 0.85 - height: 0.9 + position: 0,-0.7,0 + width: 0.7 + height: 0.7 interactive: true \ No newline at end of file