mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-28 19:39:11 +00:00
预防未启用基于纹饰盔甲时,锁链甲产生的网络问题
This commit is contained in:
@@ -501,10 +501,17 @@ public class ComponentItemFactory1_20_5 extends BukkitItemFactory<ComponentItemW
|
||||
if (trim == null) {
|
||||
item.resetComponent(DataComponentTypes.TRIM);
|
||||
} else {
|
||||
item.setJavaComponent(DataComponentTypes.TRIM, Map.of(
|
||||
"pattern", trim.pattern().asString(),
|
||||
"material", trim.material().asString()
|
||||
));
|
||||
try {
|
||||
item.setJavaComponent(DataComponentTypes.TRIM, Map.of(
|
||||
"pattern", trim.pattern().asString(),
|
||||
"material", trim.material().asString()
|
||||
));
|
||||
} catch (Exception e) {
|
||||
// 预防未启用基于纹饰盔甲时,锁链甲可能产生的网络问题(由用户配置决定)
|
||||
if (!trim.material().equals(Key.of("minecraft", "custom")) && !trim.pattern().equals(Key.of("minecraft", "chainmail"))) {
|
||||
this.plugin.logger().warn("Failed to apply trim " + trim, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,4 @@ author: XiaoMoMi
|
||||
version: 0.0.1
|
||||
description: Fix broken vanilla armor
|
||||
namespace: minecraft
|
||||
enable:
|
||||
$$>=1.21.2: false
|
||||
$$<1.21.2: true
|
||||
enable: false
|
||||
|
||||
Reference in New Issue
Block a user