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

测试家具配置

This commit is contained in:
XiaoMoMi
2025-04-27 22:46:00 +08:00
parent 1136170fae
commit 99bc0b3117
5 changed files with 28 additions and 9 deletions

View File

@@ -22,6 +22,7 @@ import org.bukkit.*;
import org.bukkit.entity.*;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataType;
import org.jetbrains.annotations.NotNull;
import org.joml.Vector3f;
@@ -205,7 +206,17 @@ public class BukkitFurnitureManager extends AbstractFurnitureManager {
e.setId(id);
throw e;
}
CustomFurniture furniture = new CustomFurniture(id, settings, placements, lootMap == null ? null : LootTable.fromMap(lootMap));
// get loot table
LootTable<ItemStack> lootTable;
try {
lootTable = lootMap == null ? null : LootTable.fromMap(lootMap);
} catch (LocalizedResourceConfigException e) {
e.setPath(path);
e.setId(id);
throw e;
}
CustomFurniture furniture = new CustomFurniture(id, settings, placements, lootTable);
byId.put(id, furniture);
}
}