|
|
|
|
@ -161,6 +161,29 @@ public class loot_chest_command implements CommandExecutor {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Parse CustomPotionEffects
|
|
|
|
|
if (custom_item_section.contains("CustomPotionEffects")) {
|
|
|
|
|
List<Map<?, ?>> potion_effects = custom_item_section.getMapList("CustomPotionEffects");
|
|
|
|
|
NBTList effects_NBT = new NBTList();
|
|
|
|
|
for (Map<?, ?> effect_map : potion_effects) {
|
|
|
|
|
NBTCompound effect_NBT = new NBTCompound();
|
|
|
|
|
if (effect_map.containsKey("Id")) {
|
|
|
|
|
effect_NBT.put("Id", ((Number) effect_map.get("Id")).byteValue());
|
|
|
|
|
}
|
|
|
|
|
if (effect_map.containsKey("Amplifier")) {
|
|
|
|
|
effect_NBT.put("Amplifier", ((Number) effect_map.get("Amplifier")).byteValue());
|
|
|
|
|
}
|
|
|
|
|
if (effect_map.containsKey("Duration")) {
|
|
|
|
|
effect_NBT.put("Duration", ((Number) effect_map.get("Duration")).intValue());
|
|
|
|
|
}
|
|
|
|
|
if (effect_map.containsKey("ShowParticles")) {
|
|
|
|
|
effect_NBT.put("ShowParticles", (Boolean) effect_map.get("ShowParticles"));
|
|
|
|
|
}
|
|
|
|
|
effects_NBT.add(effect_NBT);
|
|
|
|
|
}
|
|
|
|
|
tag_NBT.put("CustomPotionEffects", effects_NBT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ConfigurationSection enchantments_section = custom_item_section.getConfigurationSection("enchantments");
|
|
|
|
|
if (enchantments_section != null) {
|
|
|
|
|
NBTList ench_NBT = new NBTList();
|
|
|
|
|
@ -324,4 +347,4 @@ public class loot_chest_command implements CommandExecutor {
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|