From 8fdb520620fc66c152ac1b5ca686fbcd34e5f982 Mon Sep 17 00:00:00 2001 From: okx-code Date: Sun, 17 Nov 2024 04:59:49 +0000 Subject: [PATCH] add kb1 --- .../plugins/FactoryMod/config.yml | 18 ++++++++++++++++++ .../meteoriciron/MeteoricIronTools.java | 19 +++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/ansible/files/paper-config/plugins/FactoryMod/config.yml b/ansible/files/paper-config/plugins/FactoryMod/config.yml index d1af6d570..e49a1e77d 100644 --- a/ansible/files/paper-config/plugins/FactoryMod/config.yml +++ b/ansible/files/paper-config/plugins/FactoryMod/config.yml @@ -44,6 +44,7 @@ factories: recipes: - make_meteoric_iron_sword - make_meteoric_iron_sword_kb + - make_meteoric_iron_sword_kb1 - repair_meteoric_iron_sword_factory meteoric_iron_pickaxe: type: FCC @@ -14878,6 +14879,23 @@ recipes: meteoric_iron_sword_kb: custom-key: meteoric_iron_sword_knockback amount: 5 + make_meteoric_iron_sword_kb1: + production_time: 4s + name: Make Meteoric Iron Knockback 1 Sword + type: PRODUCTION + input: + meteoric_iron_ingot: + custom-key: meteoric_iron_ingot + amount: 6 + amesthyst_shard: + v: 3839 + ==: org.bukkit.inventory.ItemStack + type: AMETHYST_SHARD + amount: 5 + output: + meteoric_iron_sword_kb1: + custom-key: meteoric_iron_sword_knockback1 + amount: 5 repair_meteoric_iron_sword_factory: production_time: 4s name: Repair Factory diff --git a/plugins/heliodor-paper/src/main/java/net/civmc/heliodor/meteoriciron/MeteoricIronTools.java b/plugins/heliodor-paper/src/main/java/net/civmc/heliodor/meteoriciron/MeteoricIronTools.java index 14f0050d8..b0abf7ac0 100644 --- a/plugins/heliodor-paper/src/main/java/net/civmc/heliodor/meteoriciron/MeteoricIronTools.java +++ b/plugins/heliodor-paper/src/main/java/net/civmc/heliodor/meteoriciron/MeteoricIronTools.java @@ -129,7 +129,7 @@ public interface MeteoricIronTools { return axe; } - static ItemStack createSword(boolean knocback) { + static ItemStack createSword(int knocback) { ItemStack sword = new ItemStack(Material.IRON_SWORD); Damageable meta = (Damageable) sword.getItemMeta(); @@ -145,14 +145,16 @@ public interface MeteoricIronTools { meta.setMaxDamage(DURABILITY); meta.addEnchant(Enchantment.FIRE_ASPECT, 2, false); meta.addEnchant(Enchantment.SHARPNESS, 5, false); - if (knocback) { - meta.addEnchant(Enchantment.KNOCKBACK, 2, false); + if (knocback > 0) { + meta.addEnchant(Enchantment.KNOCKBACK, knocback, false); } meta.setFireResistant(true); AnvilRepairListener.setNoCombine(meta); sword.setItemMeta(meta); - if (knocback) { + if (knocback == 2) { CustomItem.registerCustomItem("meteoric_iron_sword_knockback", sword); + } else if (knocback == 1) { + CustomItem.registerCustomItem("meteoric_iron_sword_knockback1", sword); } else { CustomItem.registerCustomItem("meteoric_iron_sword", sword); } @@ -179,12 +181,17 @@ public interface MeteoricIronTools { .shape("xx ", "xs ", " s ") .setIngredient('x', MeteoricIron.createIngot()) .setIngredient('s', Material.STICK)), - categoryEquipment(new ShapedRecipe(new NamespacedKey(plugin, "meteoric_iron_sword_knockback"), MeteoricIronTools.createSword(true)) + categoryEquipment(new ShapedRecipe(new NamespacedKey(plugin, "meteoric_iron_sword_knockback"), MeteoricIronTools.createSword(2)) .shape("axa", " x ", " s ") .setIngredient('x', MeteoricIron.createIngot()) .setIngredient('a', Material.AMETHYST_SHARD) .setIngredient('s', Material.STICK)), - categoryEquipment(new ShapedRecipe(new NamespacedKey(plugin, "meteoric_iron_sword_sharpness"), MeteoricIronTools.createSword(false)) + categoryEquipment(new ShapedRecipe(new NamespacedKey(plugin, "meteoric_iron_sword_knockback1"), MeteoricIronTools.createSword(1)) + .shape("ax ", " x ", " s ") + .setIngredient('x', MeteoricIron.createIngot()) + .setIngredient('a', Material.AMETHYST_SHARD) + .setIngredient('s', Material.STICK)), + categoryEquipment(new ShapedRecipe(new NamespacedKey(plugin, "meteoric_iron_sword_sharpness"), MeteoricIronTools.createSword(0)) .shape(" x ", " x ", " s ") .setIngredient('x', MeteoricIron.createIngot()) .setIngredient('s', Material.STICK))