mirror of
https://github.com/BlazingGames/blazing-games-plugin.git
synced 2025-02-03 21:26:41 -05:00
made custom enchantments use the exact same way of specifying recipes as vanilla enchantments
(a list of AltarRecipe) also made the required altar tier be a part of the recipe and made getMaxLevel use that list of recipes
This commit is contained in:
parent
aed4e4b20b
commit
8642ae7234
20 changed files with 243 additions and 457 deletions
|
@ -28,6 +28,8 @@ import org.bukkit.entity.Illager;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BaneOfIllagersEnchantment extends CustomEnchantment {
|
||||
@Override
|
||||
public @NotNull NamespacedKey getKey() {
|
||||
|
@ -43,10 +45,6 @@ public class BaneOfIllagersEnchantment extends CustomEnchantment {
|
|||
return PaperEnchantmentTarget.WEAPON;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
public double getDamageIncrease(Entity victim, int level) {
|
||||
if(victim instanceof Illager) {
|
||||
return level*2.5;
|
||||
|
@ -54,29 +52,19 @@ public class BaneOfIllagersEnchantment extends CustomEnchantment {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
return altarTier + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPreIcon() {
|
||||
return new ItemStack(Material.IRON_AXE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(
|
||||
level, level, switch(level) {
|
||||
case 3, 4 -> 16;
|
||||
default -> 1;
|
||||
}, switch(level) {
|
||||
case 2 -> new MaterialItemPredicate(Material.IRON_AXE);
|
||||
case 3 -> new MaterialItemPredicate(Material.EMERALD);
|
||||
case 4 -> new MaterialItemPredicate(Material.EMERALD_BLOCK);
|
||||
case 5 -> new MaterialItemPredicate(Material.TOTEM_OF_UNDYING);
|
||||
default -> new MaterialItemPredicate(Material.SADDLE);
|
||||
}
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(
|
||||
new AltarRecipe(1, 1, 1, 1, new MaterialItemPredicate(Material.SADDLE)),
|
||||
new AltarRecipe(2, 2, 2, 1, new MaterialItemPredicate(Material.IRON_AXE)),
|
||||
new AltarRecipe(3, 3, 3, 16, new MaterialItemPredicate(Material.EMERALD)),
|
||||
new AltarRecipe(4, 4, 4, 16, new MaterialItemPredicate(Material.EMERALD_BLOCK)),
|
||||
new AltarRecipe(4, 5, 5, 1, new MaterialItemPredicate(Material.TOTEM_OF_UNDYING))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ import org.bukkit.NamespacedKey;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CapturingEnchantment extends CustomTreasureEnchantment {
|
||||
@Override
|
||||
public @NotNull NamespacedKey getKey() {
|
||||
|
@ -38,13 +40,11 @@ public class CapturingEnchantment extends CustomTreasureEnchantment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(
|
||||
level, level*4, 16, switch(level) {
|
||||
case 2 -> new MaterialItemPredicate(Material.SPIDER_EYE);
|
||||
case 3 -> new MaterialItemPredicate(Material.EGG);
|
||||
default -> new MaterialItemPredicate(Material.GUNPOWDER);
|
||||
}
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(
|
||||
new AltarRecipe(3, 1, 4, 16, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(3, 2, 8, 16, new MaterialItemPredicate(Material.EGG)),
|
||||
new AltarRecipe(4, 3, 12, 16, new MaterialItemPredicate(Material.GUNPOWDER))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -56,15 +56,4 @@ public class CapturingEnchantment extends CustomTreasureEnchantment {
|
|||
public ItemPredicate getItemTarget() {
|
||||
return PaperEnchantmentTarget.WEAPON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
if(altarTier <= 2) return 0;
|
||||
if (altarTier == 4) return 3;
|
||||
return altarTier - 1;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,8 +38,8 @@ public class CollectableEnchantment extends CustomSingleLeveledEnchantment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(1, 2, 4, new MaterialItemPredicate(Material.ENDER_PEARL));
|
||||
public AltarRecipe getRecipe() {
|
||||
return new AltarRecipe(2,1, 2, 4, new MaterialItemPredicate(Material.ENDER_PEARL));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,9 +50,4 @@ public class CollectableEnchantment extends CustomSingleLeveledEnchantment {
|
|||
public ItemPredicate getItemTarget() {
|
||||
return PaperEnchantmentTarget.TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean allowAltarTier(int altarTier) {
|
||||
return altarTier >= 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,8 +39,8 @@ public class FlameTouchEnchantment extends CustomSingleLeveledEnchantment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(1, 4, 16, new MaterialItemPredicate(Material.BLAZE_POWDER));
|
||||
public AltarRecipe getRecipe() {
|
||||
return new AltarRecipe(3,1, 4, 16, new MaterialItemPredicate(Material.BLAZE_POWDER));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,9 +55,4 @@ public class FlameTouchEnchantment extends CustomSingleLeveledEnchantment {
|
|||
public @NotNull CustomEnchantmentType getEnchantmentType() {
|
||||
return CustomEnchantmentType.TWISTED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean allowAltarTier(int altarTier) {
|
||||
return altarTier >= 3;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@ import org.bukkit.entity.Entity;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HellInfusionEnchantment extends CustomEnchantment {
|
||||
@Override
|
||||
public @NotNull NamespacedKey getKey() {
|
||||
|
@ -45,10 +47,6 @@ public class HellInfusionEnchantment extends CustomEnchantment {
|
|||
return PaperEnchantmentTarget.WEAPON;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public double getDamageIncrease(Entity victim, int level) {
|
||||
if(victim.getWorld().getEnvironment() == World.Environment.NETHER) {
|
||||
return level*level*0.5;
|
||||
|
@ -67,25 +65,17 @@ public class HellInfusionEnchantment extends CustomEnchantment {
|
|||
|| enchantment == CustomEnchantments.BANE_OF_ILLAGERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
if(altarTier <= 1) return 0;
|
||||
return altarTier - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPreIcon() {
|
||||
return new ItemStack(Material.MAGMA_BLOCK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(
|
||||
level, level * 4, level == 3 ? 64 : 32, switch(level) {
|
||||
case 2 -> new MaterialItemPredicate(Material.MAGMA_BLOCK);
|
||||
case 3 -> new MaterialItemPredicate(Material.BLAZE_POWDER);
|
||||
default -> new MaterialItemPredicate(Material.MAGMA_CREAM);
|
||||
}
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(
|
||||
new AltarRecipe(2, 1, 4, 32, new MaterialItemPredicate(Material.MAGMA_CREAM)),
|
||||
new AltarRecipe(3, 2, 8, 32, new MaterialItemPredicate(Material.MAGMA_BLOCK)),
|
||||
new AltarRecipe(4, 3, 12, 64, new MaterialItemPredicate(Material.BLAZE_POWDER))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,9 +38,9 @@ public class NatureBlessingEnchantment extends CustomSingleLeveledEnchantment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
public AltarRecipe getRecipe() {
|
||||
return new AltarRecipe(
|
||||
1, 4, 32, new MaterialItemPredicate(Material.BONE_BLOCK)
|
||||
1, 1, 4, 32, new MaterialItemPredicate(Material.BONE_BLOCK)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -52,9 +52,4 @@ public class NatureBlessingEnchantment extends CustomSingleLeveledEnchantment {
|
|||
public ItemPredicate getItemTarget() {
|
||||
return BlazingEnchantmentTarget.HOE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean allowAltarTier(int altarTier) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import de.blazemcworld.blazinggames.enchantments.sys.PaperEnchantmentTarget;
|
|||
import de.blazemcworld.blazinggames.enchantments.sys.altar.AltarRecipe;
|
||||
import de.blazemcworld.blazinggames.items.predicates.ItemPredicate;
|
||||
import de.blazemcworld.blazinggames.items.predicates.MaterialItemPredicate;
|
||||
import de.blazemcworld.blazinggames.utils.Triple;
|
||||
import de.blazemcworld.blazinggames.utils.Pair;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -31,10 +31,10 @@ import org.jetbrains.annotations.NotNull;
|
|||
import java.util.List;
|
||||
|
||||
public class PatternEnchantment extends CustomEnchantment {
|
||||
public static List<Triple<Integer, Integer, Material>> dimensions = List.of(
|
||||
new Triple<>(1,2, Material.WOODEN_PICKAXE),
|
||||
new Triple<>(2,2, Material.STONE_PICKAXE),
|
||||
new Triple<>(3,3, Material.IRON_PICKAXE)
|
||||
public static List<Pair<Integer, Integer>> dimensions = List.of(
|
||||
new Pair<>(1,2),
|
||||
new Pair<>(2,2),
|
||||
new Pair<>(3,3)
|
||||
);
|
||||
|
||||
@Override
|
||||
|
@ -48,16 +48,12 @@ public class PatternEnchantment extends CustomEnchantment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
if(level <= 0) {
|
||||
return getRecipe(1);
|
||||
}
|
||||
|
||||
if(level > dimensions.size()) {
|
||||
return getRecipe(dimensions.size());
|
||||
}
|
||||
|
||||
return new AltarRecipe(level, level * 4, new MaterialItemPredicate(dimensions.get(level-1).right));
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(
|
||||
new AltarRecipe(1, 1, 4, new MaterialItemPredicate(Material.WOODEN_PICKAXE)),
|
||||
new AltarRecipe(1, 2, 8, new MaterialItemPredicate(Material.STONE_PICKAXE)),
|
||||
new AltarRecipe(1, 3, 12, new MaterialItemPredicate(Material.IRON_PICKAXE))
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -70,17 +66,13 @@ public class PatternEnchantment extends CustomEnchantment {
|
|||
return super.getDisplayLevel(level);
|
||||
}
|
||||
|
||||
return dimensions.get(level-1).left + "x" + dimensions.get(level-1).middle;
|
||||
return dimensions.get(level-1).left + "x" + dimensions.get(level-1).right;
|
||||
}
|
||||
|
||||
public ItemPredicate getItemTarget() {
|
||||
return PaperEnchantmentTarget.TOOL;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public boolean conflictsWith(@NotNull CustomEnchantment enchantment) {
|
||||
return enchantment == CustomEnchantments.TREE_FELLER;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ import org.bukkit.NamespacedKey;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ReflectiveDefensesEnchantment extends CustomEnchantment {
|
||||
@Override
|
||||
public @NotNull NamespacedKey getKey() {
|
||||
|
@ -41,33 +43,19 @@ public class ReflectiveDefensesEnchantment extends CustomEnchantment {
|
|||
return BlazingEnchantmentTarget.SHIELD;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
return altarTier + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPreIcon() {
|
||||
return new ItemStack(Material.SHIELD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(
|
||||
level,
|
||||
level * 2,
|
||||
level == 5 ? 1 : 16,
|
||||
switch(level) {
|
||||
case 2 -> new MaterialItemPredicate(Material.SWEET_BERRIES);
|
||||
case 3 -> new MaterialItemPredicate(Material.PRISMARINE_SHARD);
|
||||
case 4 -> new MaterialItemPredicate(Material.PRISMARINE_CRYSTALS);
|
||||
case 5 -> new MaterialItemPredicate(Material.DIAMOND_BLOCK);
|
||||
default -> new MaterialItemPredicate(Material.CACTUS);
|
||||
}
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(
|
||||
new AltarRecipe(1, 1, 2, 16, new MaterialItemPredicate(Material.CACTUS)),
|
||||
new AltarRecipe(1, 2, 4, 16, new MaterialItemPredicate(Material.SWEET_BERRIES)),
|
||||
new AltarRecipe(2, 3, 6, 16, new MaterialItemPredicate(Material.PRISMARINE_SHARD)),
|
||||
new AltarRecipe(3, 4, 8, 16, new MaterialItemPredicate(Material.PRISMARINE_CRYSTALS)),
|
||||
new AltarRecipe(4, 5, 10, 1, new MaterialItemPredicate(Material.DIAMOND_BLOCK))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ import org.bukkit.NamespacedKey;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ScavengerEnchantment extends CustomTreasureEnchantment {
|
||||
@Override
|
||||
public @NotNull NamespacedKey getKey() {
|
||||
|
@ -38,14 +40,11 @@ public class ScavengerEnchantment extends CustomTreasureEnchantment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(
|
||||
level, level*8,
|
||||
level == 3 ? 1 : 16, switch(level) {
|
||||
case 2 -> new MaterialItemPredicate(Material.DIAMOND);
|
||||
case 3 -> new MaterialItemPredicate(Material.NETHERITE_SCRAP);
|
||||
default -> new MaterialItemPredicate(Material.GOLD_INGOT);
|
||||
}
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(
|
||||
new AltarRecipe(3, 1, 8, 16, new MaterialItemPredicate(Material.GOLD_INGOT)),
|
||||
new AltarRecipe(3, 2, 16, 16, new MaterialItemPredicate(Material.DIAMOND)),
|
||||
new AltarRecipe(4, 3, 24, 1, new MaterialItemPredicate(Material.NETHERITE_SCRAP))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -57,15 +56,4 @@ public class ScavengerEnchantment extends CustomTreasureEnchantment {
|
|||
public ItemPredicate getItemTarget() {
|
||||
return PaperEnchantmentTarget.WEAPON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
if(altarTier < 2) return 0;
|
||||
|
||||
return altarTier - 1;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ import org.bukkit.entity.Entity;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SeaInfusionEnchantment extends CustomEnchantment {
|
||||
@Override
|
||||
public @NotNull NamespacedKey getKey() {
|
||||
|
@ -44,10 +46,6 @@ public class SeaInfusionEnchantment extends CustomEnchantment {
|
|||
return BlazingEnchantmentTarget.WEAPON_TRIDENT;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public double getDamageIncrease(Entity victim, int level) {
|
||||
if(victim.isInWaterOrRainOrBubbleColumn()) {
|
||||
return level*level*0.5;
|
||||
|
@ -66,25 +64,17 @@ public class SeaInfusionEnchantment extends CustomEnchantment {
|
|||
|| enchantment == CustomEnchantments.BANE_OF_ILLAGERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
if(altarTier <= 1) return 0;
|
||||
return altarTier - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPreIcon() {
|
||||
return new ItemStack(Material.TUBE_CORAL_BLOCK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(
|
||||
level, level * 4, level == 3 ? 32 : 16, switch(level) {
|
||||
case 2 -> new MaterialItemPredicate(Material.TUBE_CORAL_BLOCK);
|
||||
case 3 -> new MaterialItemPredicate(Material.SPONGE);
|
||||
default -> new MaterialItemPredicate(Material.TUBE_CORAL);
|
||||
}
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(
|
||||
new AltarRecipe(2, 1, 4, 16, new MaterialItemPredicate(Material.TUBE_CORAL)),
|
||||
new AltarRecipe(3, 2, 8, 16, new MaterialItemPredicate(Material.TUBE_CORAL_BLOCK)),
|
||||
new AltarRecipe(4, 3, 12, 32, new MaterialItemPredicate(Material.SPONGE))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ import org.bukkit.NamespacedKey;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TreeFellerEnchantment extends CustomEnchantment {
|
||||
@Override
|
||||
public @NotNull NamespacedKey getKey() {
|
||||
|
@ -42,39 +44,23 @@ public class TreeFellerEnchantment extends CustomEnchantment {
|
|||
return BlazingEnchantmentTarget.AXE;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
public boolean conflictsWith(@NotNull CustomEnchantment enchantment) {
|
||||
return enchantment == CustomEnchantments.PATTERN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
if(altarTier >= 4) return 5;
|
||||
|
||||
return altarTier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPreIcon() {
|
||||
return new ItemStack(Material.OAK_SAPLING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(
|
||||
level,
|
||||
level * 3,
|
||||
32,
|
||||
switch(level) {
|
||||
case 2 -> new MaterialItemPredicate(Material.JUNGLE_LOG);
|
||||
case 3 -> new MaterialItemPredicate(Material.CHERRY_LOG);
|
||||
case 4 -> new MaterialItemPredicate(Material.WARPED_STEM);
|
||||
case 5 -> new MaterialItemPredicate(Material.CHORUS_FLOWER);
|
||||
default -> new MaterialItemPredicate(Material.OAK_LOG);
|
||||
}
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(
|
||||
new AltarRecipe(1, 1, 3, 32, new MaterialItemPredicate(Material.OAK_LOG)),
|
||||
new AltarRecipe(2, 2, 6, 32, new MaterialItemPredicate(Material.JUNGLE_LOG)),
|
||||
new AltarRecipe(3, 3, 9, 32, new MaterialItemPredicate(Material.CHERRY_LOG)),
|
||||
new AltarRecipe(4, 4, 12, 32, new MaterialItemPredicate(Material.WARPED_STEM)),
|
||||
new AltarRecipe(4, 5, 15, 32, new MaterialItemPredicate(Material.CHORUS_FLOWER))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,8 +39,8 @@ public class UnshinyEnchantment extends CustomTreasureSingleLeveledEnchantment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(1, 0, new MaterialItemPredicate(Material.INK_SAC));
|
||||
public AltarRecipe getRecipe() {
|
||||
return new AltarRecipe(1, 1, 0, new MaterialItemPredicate(Material.INK_SAC));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,9 +55,4 @@ public class UnshinyEnchantment extends CustomTreasureSingleLeveledEnchantment {
|
|||
public @NotNull CustomEnchantmentType getEnchantmentType() {
|
||||
return CustomEnchantmentType.COSMETIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean allowAltarTier(int altarTier) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ import org.bukkit.NamespacedKey;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UpdraftEnchantment extends CustomTreasureEnchantment {
|
||||
@Override
|
||||
public @NotNull NamespacedKey getKey() {
|
||||
|
@ -38,10 +40,10 @@ public class UpdraftEnchantment extends CustomTreasureEnchantment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
return new AltarRecipe(
|
||||
level, level * 8, 16, new MaterialItemPredicate(
|
||||
level == 2 ? Material.SOUL_CAMPFIRE : Material.CAMPFIRE)
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(
|
||||
new AltarRecipe(2, 1, 8, 16, new MaterialItemPredicate(Material.CAMPFIRE)),
|
||||
new AltarRecipe(3, 2, 16, 16, new MaterialItemPredicate(Material.SOUL_CAMPFIRE))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -53,14 +55,4 @@ public class UpdraftEnchantment extends CustomTreasureEnchantment {
|
|||
public ItemPredicate getItemTarget() {
|
||||
return BlazingEnchantmentTarget.ELYTRA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
if(altarTier <= 1) return 0;
|
||||
return altarTier - 1;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,11 +45,6 @@ public abstract class CustomEnchantment implements EnchantmentWrapper {
|
|||
return EnchantmentHelper.getCustomEnchantmentLevel(tool, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public ItemPredicate getItemTarget() {
|
||||
return PaperEnchantmentTarget.BREAKABLE;
|
||||
}
|
||||
|
@ -96,14 +91,6 @@ public abstract class CustomEnchantment implements EnchantmentWrapper {
|
|||
|| tool.getType() == Material.ENCHANTED_BOOK;
|
||||
}
|
||||
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
if(altarTier == 4) {
|
||||
return getMaxLevel();
|
||||
}
|
||||
|
||||
return Math.min(getMaxLevel(), altarTier);
|
||||
}
|
||||
|
||||
public boolean canUpgradeLevel(int currentLevel) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -15,18 +15,21 @@
|
|||
*/
|
||||
package de.blazemcworld.blazinggames.enchantments.sys;
|
||||
|
||||
import de.blazemcworld.blazinggames.enchantments.sys.altar.AltarRecipe;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class CustomSingleLeveledEnchantment extends CustomEnchantment {
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
return allowAltarTier(altarTier) ? 1 : 0;
|
||||
}
|
||||
|
||||
protected abstract boolean allowAltarTier(int altarTier);
|
||||
|
||||
@Override
|
||||
public @NotNull String getDisplayLevel(int level) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public abstract AltarRecipe getRecipe();
|
||||
|
||||
@Override
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return List.of(getRecipe());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ import java.util.List;
|
|||
public interface EnchantmentWrapper {
|
||||
ItemStack apply(ItemStack tool, int level);
|
||||
int getLevel(ItemStack tool);
|
||||
int getMaxLevel();
|
||||
boolean canEnchantItem(ItemStack tool);
|
||||
boolean canGoOnItem(ItemStack tool);
|
||||
|
||||
|
@ -63,7 +62,7 @@ public interface EnchantmentWrapper {
|
|||
return null;
|
||||
}
|
||||
|
||||
int maxLevelAvailableInAltar(int altarTier);
|
||||
//int maxLevelAvailableInAltar(int altarTier);
|
||||
|
||||
ItemStack getPreIcon();
|
||||
|
||||
|
@ -75,7 +74,9 @@ public interface EnchantmentWrapper {
|
|||
List<Component> lore = new ArrayList<>();
|
||||
|
||||
if(level < getMaxLevel()) {
|
||||
if(level >= maxLevelAvailableInAltar(tier)) {
|
||||
AltarRecipe recipe = getRecipe(level + 1);
|
||||
|
||||
if(tier < recipe.tier()) {
|
||||
lore.add(Component.text("Can't upgrade any more with this tier of altar!")
|
||||
.color(NamedTextColor.RED).decoration(TextDecoration.ITALIC, false));
|
||||
}
|
||||
|
@ -86,8 +87,6 @@ public interface EnchantmentWrapper {
|
|||
.color(NamedTextColor.YELLOW).decoration(TextDecoration.ITALIC, false)
|
||||
);
|
||||
|
||||
AltarRecipe recipe = getRecipe(level + 1);
|
||||
|
||||
Component name = recipe.itemRequirement().getDescription();
|
||||
|
||||
lore.add(Component.text(recipe.expAmount() + " Experience Levels")
|
||||
|
@ -137,5 +136,17 @@ public interface EnchantmentWrapper {
|
|||
|
||||
boolean isTreasure();
|
||||
|
||||
AltarRecipe getRecipe(int level);
|
||||
List<AltarRecipe> getRecipes();
|
||||
default AltarRecipe getRecipe(int level) {
|
||||
List<AltarRecipe> recipes = getRecipes();
|
||||
|
||||
if(level < 1) return recipes.getFirst();
|
||||
|
||||
if(level > recipes.size()) return recipes.getLast();
|
||||
|
||||
return recipes.get(level - 1);
|
||||
}
|
||||
default int getMaxLevel() {
|
||||
return getRecipes().size();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
*/
|
||||
package de.blazemcworld.blazinggames.enchantments.sys;
|
||||
|
||||
import de.blazemcworld.blazinggames.enchantments.sys.VanillaEnchantmentWrapper.AltarTiers;
|
||||
import de.blazemcworld.blazinggames.enchantments.sys.VanillaEnchantmentWrapper.Warning;
|
||||
import de.blazemcworld.blazinggames.enchantments.sys.altar.AltarRecipe;
|
||||
import de.blazemcworld.blazinggames.items.predicates.ColorlessItemPredicate;
|
||||
|
@ -36,300 +35,258 @@ import java.util.Set;
|
|||
public class EnchantmentWrappers {
|
||||
public static VanillaEnchantmentWrapper MULTISHOT =
|
||||
new VanillaEnchantmentWrapper(Enchantment.MULTISHOT, () -> new ItemStack(Material.PRISMARINE_CRYSTALS),
|
||||
new AltarTiers(0, 1),
|
||||
new AltarRecipe(1, 4, 16, new MaterialItemPredicate(Material.ARROW))
|
||||
new AltarRecipe(2,1, 4, 16, new MaterialItemPredicate(Material.ARROW))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper PIERCING =
|
||||
new VanillaEnchantmentWrapper(Enchantment.PIERCING, () -> new ItemStack(Material.SPECTRAL_ARROW),
|
||||
new AltarTiers(1, 2, 3, 4),
|
||||
new AltarRecipe(1, 2, 32, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(2, 4, 32, new MaterialItemPredicate(Material.BONE)),
|
||||
new AltarRecipe(3, 6, 32, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(4, 8, 32, new MaterialItemPredicate(Material.GUNPOWDER))
|
||||
new AltarRecipe(1,1, 2, 32, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(2,2, 4, 32, new MaterialItemPredicate(Material.BONE)),
|
||||
new AltarRecipe(3,3, 6, 32, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(4,4, 8, 32, new MaterialItemPredicate(Material.GUNPOWDER))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper SILK_TOUCH =
|
||||
new VanillaEnchantmentWrapper(Enchantment.SILK_TOUCH, () -> new ItemStack(Material.STRING),
|
||||
new AltarTiers(0, 0, 1, 1, 2),
|
||||
List.of(
|
||||
new Warning("Might break pickaxe when used on spawners.\nAlways breaks iron pickaxes and lower.\nUses 2/3rd of durability on diamond pickaxes.\nUses half of durability on netherite pickaxes.", 2)
|
||||
),
|
||||
new AltarRecipe(1, 15, 32, new MaterialItemPredicate(Material.STRING)),
|
||||
new AltarRecipe(2, 30, 1, new MaterialItemPredicate(Material.NETHERITE_INGOT))
|
||||
new AltarRecipe(3,1, 15, 32, new MaterialItemPredicate(Material.STRING)),
|
||||
new AltarRecipe(5,2, 30, 1, new MaterialItemPredicate(Material.NETHERITE_INGOT))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper VANISHING_CURSE =
|
||||
new VanillaEnchantmentWrapper(Enchantment.VANISHING_CURSE, () -> new ItemStack(Material.GLASS),
|
||||
new AltarTiers(0, 1),
|
||||
new AltarRecipe(1, 8, new PotionItemPredicate(PotionEffectType.INVISIBILITY))
|
||||
new AltarRecipe(2,1, 8, new PotionItemPredicate(PotionEffectType.INVISIBILITY))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper FROST_WALKER =
|
||||
new VanillaEnchantmentWrapper(Enchantment.FROST_WALKER, () -> new ItemStack(Material.BLUE_ICE),
|
||||
new AltarTiers(0, 1, 2),
|
||||
new AltarRecipe(1, 2, 16, new MaterialItemPredicate(Material.BLUE_ICE)),
|
||||
new AltarRecipe(2, 4, 16, new MaterialItemPredicate(Material.PRISMARINE_CRYSTALS))
|
||||
new AltarRecipe(2,1, 2, 16, new MaterialItemPredicate(Material.BLUE_ICE)),
|
||||
new AltarRecipe(3,2, 4, 16, new MaterialItemPredicate(Material.PRISMARINE_CRYSTALS))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper FORTUNE =
|
||||
new VanillaEnchantmentWrapper(Enchantment.FORTUNE, () -> new ItemStack(Material.EMERALD),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 2, 16, new MaterialItemPredicate(Material.EMERALD)),
|
||||
new AltarRecipe(2, 4, 16, new MaterialItemPredicate(Material.DIAMOND)),
|
||||
new AltarRecipe(3, 8, new MaterialItemPredicate(Material.RABBIT_FOOT))
|
||||
new AltarRecipe(2,1, 2, 16, new MaterialItemPredicate(Material.EMERALD)),
|
||||
new AltarRecipe(3,2, 4, 16, new MaterialItemPredicate(Material.DIAMOND)),
|
||||
new AltarRecipe(4,3, 8, new MaterialItemPredicate(Material.RABBIT_FOOT))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper BINDING_CURSE =
|
||||
new VanillaEnchantmentWrapper(Enchantment.BINDING_CURSE, () -> new ItemStack(Material.CHAIN),
|
||||
new AltarTiers(0, 1),
|
||||
new AltarRecipe(1, 8, 16, new MaterialItemPredicate(Material.COBWEB))
|
||||
new AltarRecipe(2,1, 8, 16, new MaterialItemPredicate(Material.COBWEB))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper SHARPNESS =
|
||||
new VanillaEnchantmentWrapper(Enchantment.SHARPNESS, () -> new ItemStack(Material.DIAMOND_SWORD),
|
||||
new AltarTiers(1, 2, 3, 5),
|
||||
new AltarRecipe(1, 2, 32, new MaterialItemPredicate(Material.REDSTONE)),
|
||||
new AltarRecipe(2, 4, 16, new MaterialItemPredicate(Material.REDSTONE_BLOCK)),
|
||||
new AltarRecipe(3, 6, 16, new MaterialItemPredicate(Material.BLAZE_POWDER)),
|
||||
new AltarRecipe(4, 8, 8, new MaterialItemPredicate(Material.DIAMOND)),
|
||||
new AltarRecipe(5, 10, new PotionItemPredicate(PotionEffectType.STRENGTH))
|
||||
new AltarRecipe(1,1, 2, 32, new MaterialItemPredicate(Material.REDSTONE)),
|
||||
new AltarRecipe(2,2, 4, 16, new MaterialItemPredicate(Material.REDSTONE_BLOCK)),
|
||||
new AltarRecipe(3,3, 6, 16, new MaterialItemPredicate(Material.BLAZE_POWDER)),
|
||||
new AltarRecipe(4,4, 8, 8, new MaterialItemPredicate(Material.DIAMOND)),
|
||||
new AltarRecipe(4,5, 10, new PotionItemPredicate(PotionEffectType.STRENGTH))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper SWEEPING_EDGE =
|
||||
new VanillaEnchantmentWrapper(Enchantment.SWEEPING_EDGE, () -> new ItemStack(Material.FEATHER),
|
||||
new AltarTiers(1, 2, 3),
|
||||
new AltarRecipe(1, 1, 32, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(2, 2, 32, new MaterialItemPredicate(Material.BONE)),
|
||||
new AltarRecipe(3, 4, 32, new MaterialItemPredicate(Material.STRING))
|
||||
new AltarRecipe(1,1, 1, 32, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(2,2, 2, 32, new MaterialItemPredicate(Material.BONE)),
|
||||
new AltarRecipe(3,3, 4, 32, new MaterialItemPredicate(Material.STRING))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper RIPTIDE =
|
||||
new VanillaEnchantmentWrapper(Enchantment.RIPTIDE, () -> new ItemStack(Material.NAUTILUS_SHELL),
|
||||
new AltarTiers(0, 0, 1, 3),
|
||||
new AltarRecipe(1, 4, 16, new MaterialItemPredicate(Material.CHAIN)),
|
||||
new AltarRecipe(2, 6, 16, new MaterialItemPredicate(Material.PISTON)),
|
||||
new AltarRecipe(3, 8, 16, new MaterialItemPredicate(Material.TNT))
|
||||
new AltarRecipe(3,1, 4, 16, new MaterialItemPredicate(Material.CHAIN)),
|
||||
new AltarRecipe(4,2, 6, 16, new MaterialItemPredicate(Material.PISTON)),
|
||||
new AltarRecipe(4,3, 8, 16, new MaterialItemPredicate(Material.TNT))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper QUICK_CHARGE =
|
||||
new VanillaEnchantmentWrapper(Enchantment.QUICK_CHARGE, () -> new ItemStack(Material.REDSTONE),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 4, 16, new MaterialItemPredicate(Material.LEATHER)),
|
||||
new AltarRecipe(2, 6, 16, new MaterialItemPredicate(Material.STRING)),
|
||||
new AltarRecipe(3, 8, new PotionItemPredicate(PotionEffectType.SPEED))
|
||||
new AltarRecipe(2,1, 4, 16, new MaterialItemPredicate(Material.LEATHER)),
|
||||
new AltarRecipe(3,2, 6, 16, new MaterialItemPredicate(Material.STRING)),
|
||||
new AltarRecipe(4,3, 8, new PotionItemPredicate(PotionEffectType.SPEED))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper IMPALING =
|
||||
new VanillaEnchantmentWrapper(Enchantment.IMPALING, () -> new ItemStack(Material.TRIDENT),
|
||||
new AltarTiers(1, 2, 3, 5),
|
||||
new AltarRecipe(1, 1, new MaterialItemPredicate(Material.WATER_BUCKET)),
|
||||
new AltarRecipe(2, 2, 32, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(3, 3, 16, new MaterialItemPredicate(Material.COD)),
|
||||
new AltarRecipe(4, 4, 16, new MaterialItemPredicate(Material.SALMON)),
|
||||
new AltarRecipe(5, 5, 16, new MaterialItemPredicate(Material.PUFFERFISH))
|
||||
new AltarRecipe(1,1, 1, new MaterialItemPredicate(Material.WATER_BUCKET)),
|
||||
new AltarRecipe(2,2, 2, 32, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(3,3, 3, 16, new MaterialItemPredicate(Material.COD)),
|
||||
new AltarRecipe(4,4, 4, 16, new MaterialItemPredicate(Material.SALMON)),
|
||||
new AltarRecipe(5,5, 5, 16, new MaterialItemPredicate(Material.PUFFERFISH))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper FIRE_PROTECTION =
|
||||
new VanillaEnchantmentWrapper(Enchantment.FIRE_PROTECTION, () -> new ItemStack(Material.MAGMA_CREAM),
|
||||
new AltarTiers(1, 2, 3, 4),
|
||||
new AltarRecipe(1, 1, 32, new MaterialItemPredicate(Material.COPPER_INGOT)),
|
||||
new AltarRecipe(2, 2, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(3, 3, 16, new MaterialItemPredicate(Material.BLAZE_POWDER)),
|
||||
new AltarRecipe(4, 4, 32, new MaterialItemPredicate(Material.BLAZE_POWDER))
|
||||
new AltarRecipe(1,1, 1, 32, new MaterialItemPredicate(Material.COPPER_INGOT)),
|
||||
new AltarRecipe(2,2, 2, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(3,3, 3, 16, new MaterialItemPredicate(Material.BLAZE_POWDER)),
|
||||
new AltarRecipe(4,4, 4, 32, new MaterialItemPredicate(Material.BLAZE_POWDER))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper MENDING =
|
||||
new VanillaEnchantmentWrapper(Enchantment.MENDING, () -> new ItemStack(Material.SHULKER_SHELL),
|
||||
new AltarTiers(0, 0, 0, 1),
|
||||
new AltarRecipe(10, 15, CustomItems.NETHER_STAR_CHUNK)
|
||||
new AltarRecipe(4,10, 15, CustomItems.NETHER_STAR_CHUNK)
|
||||
);
|
||||
public static VanillaEnchantmentWrapper LOYALTY =
|
||||
new VanillaEnchantmentWrapper(Enchantment.LOYALTY, () -> new ItemStack(Material.STICK),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 2, 16, new MaterialItemPredicate(Material.BONE)),
|
||||
new AltarRecipe(2, 3, 16, new MaterialItemPredicate(Material.COD)),
|
||||
new AltarRecipe(3, 4, 16, new MaterialItemPredicate(Material.CHAIN))
|
||||
new AltarRecipe(2,1, 2, 16, new MaterialItemPredicate(Material.BONE)),
|
||||
new AltarRecipe(3,2, 3, 16, new MaterialItemPredicate(Material.COD)),
|
||||
new AltarRecipe(4,3, 4, 16, new MaterialItemPredicate(Material.CHAIN))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper LUCK_OF_THE_SEA =
|
||||
new VanillaEnchantmentWrapper(Enchantment.LUCK_OF_THE_SEA, () -> new ItemStack(Material.HEART_OF_THE_SEA),
|
||||
new AltarTiers(1, 2, 3),
|
||||
new AltarRecipe(1, 1, 16, new MaterialItemPredicate(Material.COD)),
|
||||
new AltarRecipe(2, 2, 8, new MaterialItemPredicate(Material.CHEST)),
|
||||
new AltarRecipe(3, 4, new MaterialItemPredicate(Material.HEART_OF_THE_SEA))
|
||||
new AltarRecipe(1,1, 1, 16, new MaterialItemPredicate(Material.COD)),
|
||||
new AltarRecipe(2,2, 2, 8, new MaterialItemPredicate(Material.CHEST)),
|
||||
new AltarRecipe(3,3, 4, new MaterialItemPredicate(Material.HEART_OF_THE_SEA))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper RESPIRATION =
|
||||
new VanillaEnchantmentWrapper(Enchantment.RESPIRATION, () -> new ItemStack(Material.PUFFERFISH),
|
||||
new AltarTiers(1, 2, 3),
|
||||
new AltarRecipe(1, 1, new MaterialItemPredicate(Material.WATER_BUCKET)),
|
||||
new AltarRecipe(2, 2, new MaterialItemPredicate(Material.TURTLE_HELMET)),
|
||||
new AltarRecipe(3, 4, new PotionItemPredicate(PotionEffectType.WATER_BREATHING))
|
||||
new AltarRecipe(1,1, 1, new MaterialItemPredicate(Material.WATER_BUCKET)),
|
||||
new AltarRecipe(2,2, 2, new MaterialItemPredicate(Material.TURTLE_HELMET)),
|
||||
new AltarRecipe(3,3, 4, new PotionItemPredicate(PotionEffectType.WATER_BREATHING))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper FLAME =
|
||||
new VanillaEnchantmentWrapper(Enchantment.FLAME, () -> new ItemStack(Material.BLAZE_POWDER),
|
||||
new AltarTiers(0, 1),
|
||||
new AltarRecipe(1, 4, 16, new MaterialItemPredicate(Material.BLAZE_POWDER))
|
||||
new AltarRecipe(2,1, 4, 16, new MaterialItemPredicate(Material.BLAZE_POWDER))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper PUNCH =
|
||||
new VanillaEnchantmentWrapper(Enchantment.PUNCH, () -> new ItemStack(Material.PISTON),
|
||||
new AltarTiers(0, 1, 2),
|
||||
new AltarRecipe(1, 2, 10, new MaterialItemPredicate(Material.SLIME_BLOCK)),
|
||||
new AltarRecipe(2, 4, 10, new MaterialItemPredicate(Material.PISTON))
|
||||
new AltarRecipe(2,1, 2, 10, new MaterialItemPredicate(Material.SLIME_BLOCK)),
|
||||
new AltarRecipe(3,2, 4, 10, new MaterialItemPredicate(Material.PISTON))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper BLAST_PROTECTION =
|
||||
new VanillaEnchantmentWrapper(Enchantment.BLAST_PROTECTION, () -> new ItemStack(Material.TNT),
|
||||
new AltarTiers(1, 2, 3, 4),
|
||||
new AltarRecipe(1, 1, 32, new MaterialItemPredicate(Material.COPPER_INGOT)),
|
||||
new AltarRecipe(2, 2, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(3, 3, 16, new MaterialItemPredicate(Material.TNT)),
|
||||
new AltarRecipe(4, 4, 32, new MaterialItemPredicate(Material.TNT))
|
||||
new AltarRecipe(1,1, 1, 32, new MaterialItemPredicate(Material.COPPER_INGOT)),
|
||||
new AltarRecipe(2,2, 2, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(3,3, 3, 16, new MaterialItemPredicate(Material.TNT)),
|
||||
new AltarRecipe(4,4, 4, 32, new MaterialItemPredicate(Material.TNT))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper PROJECTILE_PROTECTION =
|
||||
new VanillaEnchantmentWrapper(Enchantment.PROJECTILE_PROTECTION, () -> new ItemStack(Material.ARROW),
|
||||
new AltarTiers(1, 2, 3, 4),
|
||||
new AltarRecipe(1, 1, 32, new MaterialItemPredicate(Material.COPPER_INGOT)),
|
||||
new AltarRecipe(2, 2, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(3, 3, 16, new MaterialItemPredicate(Material.ARROW)),
|
||||
new AltarRecipe(4, 4, 32, new MaterialItemPredicate(Material.ARROW))
|
||||
new AltarRecipe(1,1, 1, 32, new MaterialItemPredicate(Material.COPPER_INGOT)),
|
||||
new AltarRecipe(2,2, 2, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(3,3, 3, 16, new MaterialItemPredicate(Material.ARROW)),
|
||||
new AltarRecipe(4,4, 4, 32, new MaterialItemPredicate(Material.ARROW))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper PROTECTION =
|
||||
new VanillaEnchantmentWrapper(Enchantment.PROTECTION, () -> new ItemStack(Material.DIAMOND_CHESTPLATE),
|
||||
new AltarTiers(2, 3, 4, 4),
|
||||
new AltarRecipe(1, 2, 32, new MaterialItemPredicate(Material.COPPER_INGOT)),
|
||||
new AltarRecipe(2, 4, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(3, 6, 32, new MaterialItemPredicate(Material.GOLD_INGOT)),
|
||||
new AltarRecipe(4, 8, 16, new MaterialItemPredicate(Material.DIAMOND))
|
||||
new AltarRecipe(1,1, 2, 32, new MaterialItemPredicate(Material.COPPER_INGOT)),
|
||||
new AltarRecipe(1,2, 4, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(2,3, 6, 32, new MaterialItemPredicate(Material.GOLD_INGOT)),
|
||||
new AltarRecipe(3,4, 8, 16, new MaterialItemPredicate(Material.DIAMOND))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper AQUA_AFFINITY =
|
||||
new VanillaEnchantmentWrapper(Enchantment.AQUA_AFFINITY, () -> new ItemStack(Material.PRISMARINE),
|
||||
new AltarTiers(1),
|
||||
new AltarRecipe(1, 4, 16, new MaterialItemPredicate(Material.PRISMARINE_SHARD))
|
||||
new AltarRecipe(1,1, 4, 16, new MaterialItemPredicate(Material.PRISMARINE_SHARD))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper SMITE =
|
||||
new VanillaEnchantmentWrapper(Enchantment.SMITE, () -> new ItemStack(Material.ROTTEN_FLESH),
|
||||
new AltarTiers(1, 2, 3, 5),
|
||||
new AltarRecipe(1, 1, 10, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(2, 2, 20, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(3, 3, 30, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(4, 4, 40, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(5, 5, 50, new MaterialItemPredicate(Material.ROTTEN_FLESH))
|
||||
new AltarRecipe(1,1, 1, 10, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(2,2, 2, 20, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(3,3, 3, 30, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(4,4, 4, 40, new MaterialItemPredicate(Material.ROTTEN_FLESH)),
|
||||
new AltarRecipe(4,5, 5, 50, new MaterialItemPredicate(Material.ROTTEN_FLESH))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper POWER =
|
||||
new VanillaEnchantmentWrapper(Enchantment.POWER, () -> new ItemStack(Material.BOW),
|
||||
new AltarTiers(1, 2, 3, 5),
|
||||
new AltarRecipe(1, 2, 32, new MaterialItemPredicate(Material.REDSTONE)),
|
||||
new AltarRecipe(2, 4, 16, new MaterialItemPredicate(Material.REDSTONE_BLOCK)),
|
||||
new AltarRecipe(3, 6, 16, new MaterialItemPredicate(Material.BLAZE_POWDER)),
|
||||
new AltarRecipe(4, 8, 8, new MaterialItemPredicate(Material.DIAMOND)),
|
||||
new AltarRecipe(5, 10, new PotionItemPredicate(PotionEffectType.STRENGTH))
|
||||
new AltarRecipe(1,1, 2, 32, new MaterialItemPredicate(Material.REDSTONE)),
|
||||
new AltarRecipe(2,2, 4, 16, new MaterialItemPredicate(Material.REDSTONE_BLOCK)),
|
||||
new AltarRecipe(3,3, 6, 16, new MaterialItemPredicate(Material.BLAZE_POWDER)),
|
||||
new AltarRecipe(4,4, 8, 8, new MaterialItemPredicate(Material.DIAMOND)),
|
||||
new AltarRecipe(4,5, 10, new PotionItemPredicate(PotionEffectType.STRENGTH))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper THORNS =
|
||||
new VanillaEnchantmentWrapper(Enchantment.THORNS, () -> new ItemStack(Material.PUFFERFISH),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 1, 16, new MaterialItemPredicate(Material.CACTUS)),
|
||||
new AltarRecipe(2, 2, 16, new MaterialItemPredicate(Material.SWEET_BERRIES)),
|
||||
new AltarRecipe(3, 4, new MaterialItemPredicate(Material.DIAMOND_SWORD))
|
||||
new AltarRecipe(2,1, 1, 16, new MaterialItemPredicate(Material.CACTUS)),
|
||||
new AltarRecipe(3,2, 2, 16, new MaterialItemPredicate(Material.SWEET_BERRIES)),
|
||||
new AltarRecipe(4,3, 4, new MaterialItemPredicate(Material.DIAMOND_SWORD))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper LOOTING =
|
||||
new VanillaEnchantmentWrapper(Enchantment.LOOTING, () -> new ItemStack(Material.EMERALD),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 2, 16, new MaterialItemPredicate(Material.CHEST)),
|
||||
new AltarRecipe(2, 4, 16, new MaterialItemPredicate(Material.EMERALD)),
|
||||
new AltarRecipe(3, 8, 10, new MaterialItemPredicate(Material.DIAMOND))
|
||||
new AltarRecipe(2,1, 2, 16, new MaterialItemPredicate(Material.CHEST)),
|
||||
new AltarRecipe(3,2, 4, 16, new MaterialItemPredicate(Material.EMERALD)),
|
||||
new AltarRecipe(4,3, 8, 10, new MaterialItemPredicate(Material.DIAMOND))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper FEATHER_FALLING =
|
||||
new VanillaEnchantmentWrapper(Enchantment.FEATHER_FALLING, () -> new ItemStack(Material.FEATHER),
|
||||
new AltarTiers(0, 1, 2, 4),
|
||||
new AltarRecipe(1, 2, 10, new MaterialItemPredicate(Material.FEATHER)),
|
||||
new AltarRecipe(2, 4, 5, new MaterialItemPredicate(Material.HAY_BLOCK)),
|
||||
new AltarRecipe(3, 6, new ColorlessItemPredicate(Material.WHITE_BED)),
|
||||
new AltarRecipe(4, 8, 32, new ColorlessItemPredicate(Material.WHITE_WOOL))
|
||||
new AltarRecipe(2,1, 2, 10, new MaterialItemPredicate(Material.FEATHER)),
|
||||
new AltarRecipe(3,2, 4, 5, new MaterialItemPredicate(Material.HAY_BLOCK)),
|
||||
new AltarRecipe(4,3, 6, new ColorlessItemPredicate(Material.WHITE_BED)),
|
||||
new AltarRecipe(4,4, 8, 32, new ColorlessItemPredicate(Material.WHITE_WOOL))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper FIRE_ASPECT =
|
||||
new VanillaEnchantmentWrapper(Enchantment.FIRE_ASPECT, () -> new ItemStack(Material.BLAZE_POWDER),
|
||||
new AltarTiers(0, 1, 2),
|
||||
new AltarRecipe(1, 4, 16, new MaterialItemPredicate(Material.BLAZE_POWDER)),
|
||||
new AltarRecipe(2, 8, 32, new MaterialItemPredicate(Material.BLAZE_POWDER))
|
||||
new AltarRecipe(2,1, 4, 16, new MaterialItemPredicate(Material.BLAZE_POWDER)),
|
||||
new AltarRecipe(3,2, 8, 32, new MaterialItemPredicate(Material.BLAZE_POWDER))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper UNBREAKING =
|
||||
new VanillaEnchantmentWrapper(Enchantment.UNBREAKING, () -> new ItemStack(Material.BEDROCK),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 2, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(2, 4, 32, new MaterialItemPredicate(Material.OBSIDIAN)),
|
||||
new AltarRecipe(3, 8, 2, new MaterialItemPredicate(Material.NETHERITE_SCRAP))
|
||||
new AltarRecipe(2,1, 2, 32, new MaterialItemPredicate(Material.IRON_INGOT)),
|
||||
new AltarRecipe(3,2, 4, 32, new MaterialItemPredicate(Material.OBSIDIAN)),
|
||||
new AltarRecipe(4,3, 8, 2, new MaterialItemPredicate(Material.NETHERITE_SCRAP))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper CHANNELING =
|
||||
new VanillaEnchantmentWrapper(Enchantment.CHANNELING, () -> new ItemStack(Material.LIGHTNING_ROD),
|
||||
new AltarTiers(0, 0, 1),
|
||||
new AltarRecipe(1, 8, 1, new MaterialItemPredicate(Material.LIGHTNING_ROD))
|
||||
new AltarRecipe(3,1, 8, 1, new MaterialItemPredicate(Material.LIGHTNING_ROD))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper LURE =
|
||||
new VanillaEnchantmentWrapper(Enchantment.LURE, () -> new ItemStack(Material.TRIPWIRE_HOOK),
|
||||
new AltarTiers(1, 2, 3),
|
||||
new AltarRecipe(1, 1, 16, new MaterialItemPredicate(Material.STRING)),
|
||||
new AltarRecipe(2, 2, 16, new MaterialItemPredicate(Material.COD)),
|
||||
new AltarRecipe(3, 4, 16, new MaterialItemPredicate(Material.PUFFERFISH))
|
||||
new AltarRecipe(1,1, 1, 16, new MaterialItemPredicate(Material.STRING)),
|
||||
new AltarRecipe(2,2, 2, 16, new MaterialItemPredicate(Material.COD)),
|
||||
new AltarRecipe(3,3, 4, 16, new MaterialItemPredicate(Material.PUFFERFISH))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper INFINITY =
|
||||
new VanillaEnchantmentWrapper(Enchantment.INFINITY, () -> new ItemStack(Material.CHORUS_FLOWER),
|
||||
new AltarTiers(0, 0, 0, 1),
|
||||
new AltarRecipe(1, 8, 64, new MaterialItemPredicate(Material.ARROW))
|
||||
new AltarRecipe(4,1, 8, 64, new MaterialItemPredicate(Material.ARROW))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper EFFICIENCY =
|
||||
new VanillaEnchantmentWrapper(Enchantment.EFFICIENCY, () -> new ItemStack(Material.REDSTONE),
|
||||
new AltarTiers(1, 2, 3, 5),
|
||||
new AltarRecipe(1, 2, 32, new MaterialItemPredicate(Material.SUGAR)),
|
||||
new AltarRecipe(2, 4, 32, new MaterialItemPredicate(Material.REDSTONE)),
|
||||
new AltarRecipe(3, 6, 16, new MaterialItemPredicate(Material.REDSTONE_BLOCK)),
|
||||
new AltarRecipe(4, 8, 32, new MaterialItemPredicate(Material.GOLD_INGOT)),
|
||||
new AltarRecipe(5, 10, new PotionItemPredicate(PotionEffectType.SPEED))
|
||||
new AltarRecipe(1,1, 2, 32, new MaterialItemPredicate(Material.SUGAR)),
|
||||
new AltarRecipe(2,2, 4, 32, new MaterialItemPredicate(Material.REDSTONE)),
|
||||
new AltarRecipe(3,3, 6, 16, new MaterialItemPredicate(Material.REDSTONE_BLOCK)),
|
||||
new AltarRecipe(4,4, 8, 32, new MaterialItemPredicate(Material.GOLD_INGOT)),
|
||||
new AltarRecipe(4,5, 10, new PotionItemPredicate(PotionEffectType.SPEED))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper DEPTH_STRIDER =
|
||||
new VanillaEnchantmentWrapper(Enchantment.DEPTH_STRIDER, () -> new ItemStack(Material.COD),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 1, new ColorlessItemPredicate(Material.OAK_BOAT)),
|
||||
new AltarRecipe(2, 2, new MaterialItemPredicate(Material.MINECART)),
|
||||
new AltarRecipe(3, 4, 3, new MaterialItemPredicate(Material.RABBIT_FOOT))
|
||||
new AltarRecipe(2,1, 1, new ColorlessItemPredicate(Material.OAK_BOAT)),
|
||||
new AltarRecipe(3,2, 2, new MaterialItemPredicate(Material.MINECART)),
|
||||
new AltarRecipe(4,3, 4, 3, new MaterialItemPredicate(Material.RABBIT_FOOT))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper KNOCKBACK =
|
||||
new VanillaEnchantmentWrapper(Enchantment.KNOCKBACK, () -> new ItemStack(Material.PISTON),
|
||||
new AltarTiers(0, 1, 2),
|
||||
new AltarRecipe(1, 2, 10, new MaterialItemPredicate(Material.SLIME_BLOCK)),
|
||||
new AltarRecipe(2, 4, 10, new MaterialItemPredicate(Material.PISTON))
|
||||
new AltarRecipe(2,1, 2, 10, new MaterialItemPredicate(Material.SLIME_BLOCK)),
|
||||
new AltarRecipe(3,2, 4, 10, new MaterialItemPredicate(Material.PISTON))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper SOUL_SPEED =
|
||||
new VanillaEnchantmentWrapper(Enchantment.SOUL_SPEED, () -> new ItemStack(Material.SOUL_SAND),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 1, 16, new MaterialItemPredicate(Material.SOUL_SAND)),
|
||||
new AltarRecipe(2, 2, 16, new MaterialItemPredicate(Material.SOUL_SOIL)),
|
||||
new AltarRecipe(3, 4, 32, new MaterialItemPredicate(Material.SOUL_LANTERN))
|
||||
new AltarRecipe(2,1, 1, 16, new MaterialItemPredicate(Material.SOUL_SAND)),
|
||||
new AltarRecipe(3,2, 2, 16, new MaterialItemPredicate(Material.SOUL_SOIL)),
|
||||
new AltarRecipe(4,3, 4, 32, new MaterialItemPredicate(Material.SOUL_LANTERN))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper SWIFT_SNEAK =
|
||||
new VanillaEnchantmentWrapper(Enchantment.SWIFT_SNEAK, () -> new ItemStack(Material.ECHO_SHARD),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 1, 16, new ColorlessItemPredicate(Material.WHITE_WOOL)),
|
||||
new AltarRecipe(2, 2, 16, new MaterialItemPredicate(Material.SCULK)),
|
||||
new AltarRecipe(3, 4, 4, new MaterialItemPredicate(Material.ECHO_SHARD))
|
||||
new AltarRecipe(2,1, 1, 16, new ColorlessItemPredicate(Material.WHITE_WOOL)),
|
||||
new AltarRecipe(3,2, 2, 16, new MaterialItemPredicate(Material.SCULK)),
|
||||
new AltarRecipe(4,3, 4, 4, new MaterialItemPredicate(Material.ECHO_SHARD))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper BANE_OF_ARTHROPODS =
|
||||
new VanillaEnchantmentWrapper(Enchantment.BANE_OF_ARTHROPODS, () -> new ItemStack(Material.SPIDER_EYE),
|
||||
new AltarTiers(1, 2, 3, 5),
|
||||
new AltarRecipe(1, 1, 10, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(2, 2, 20, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(3, 3, 30, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(4, 4, 40, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(5, 5, 50, new MaterialItemPredicate(Material.SPIDER_EYE))
|
||||
new AltarRecipe(1,1, 1, 10, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(2,2, 2, 20, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(3,3, 3, 30, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(4,4, 4, 40, new MaterialItemPredicate(Material.SPIDER_EYE)),
|
||||
new AltarRecipe(4,5, 5, 50, new MaterialItemPredicate(Material.SPIDER_EYE))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper WIND_BURST =
|
||||
new VanillaEnchantmentWrapper(Enchantment.WIND_BURST, () -> new ItemStack(Material.WIND_CHARGE),
|
||||
new AltarTiers(0, 1, 2, 3),
|
||||
new AltarRecipe(1, 1, 16, new MaterialItemPredicate(Material.WIND_CHARGE)),
|
||||
new AltarRecipe(2, 2, 32, new MaterialItemPredicate(Material.BREEZE_ROD)),
|
||||
new AltarRecipe(3, 4, new PotionItemPredicate(PotionEffectType.WIND_CHARGED))
|
||||
new AltarRecipe(2,1, 1, 16, new MaterialItemPredicate(Material.WIND_CHARGE)),
|
||||
new AltarRecipe(3,2, 2, 32, new MaterialItemPredicate(Material.BREEZE_ROD)),
|
||||
new AltarRecipe(4,3, 4, new PotionItemPredicate(PotionEffectType.WIND_CHARGED))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper BREACH =
|
||||
new VanillaEnchantmentWrapper(Enchantment.BREACH, () -> new ItemStack(Material.GRINDSTONE),
|
||||
new AltarTiers(1, 2, 3, 4),
|
||||
new AltarRecipe(1, 2, 16, new MaterialItemPredicate(Material.GRINDSTONE)),
|
||||
new AltarRecipe(2, 4, 8, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(3, 6, new PotionItemPredicate(PotionEffectType.STRENGTH)),
|
||||
new AltarRecipe(4, 8, new MaterialItemPredicate(Material.HEAVY_CORE))
|
||||
new AltarRecipe(1,1, 2, 16, new MaterialItemPredicate(Material.GRINDSTONE)),
|
||||
new AltarRecipe(2,2, 4, 8, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(3,3, 6, new PotionItemPredicate(PotionEffectType.STRENGTH)),
|
||||
new AltarRecipe(4,4, 8, new MaterialItemPredicate(Material.HEAVY_CORE))
|
||||
);
|
||||
public static VanillaEnchantmentWrapper DENSITY =
|
||||
new VanillaEnchantmentWrapper(Enchantment.DENSITY, () -> new ItemStack(Material.MACE),
|
||||
new AltarTiers(1, 2, 3, 5),
|
||||
new AltarRecipe(1, 1, 2, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(2, 2, 4, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(3, 3, 6, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(4, 4, 8, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(5, 5, new MaterialItemPredicate(Material.HEAVY_CORE))
|
||||
new AltarRecipe(1,1, 1, 2, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(2,2, 2, 4, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(3,3, 3, 6, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(4,4, 4, 8, new MaterialItemPredicate(Material.ANVIL)),
|
||||
new AltarRecipe(4,5, 5, new MaterialItemPredicate(Material.HEAVY_CORE))
|
||||
);
|
||||
|
||||
private static Set<VanillaEnchantmentWrapper> vanilla() {
|
||||
|
|
|
@ -31,61 +31,25 @@ import java.util.Map;
|
|||
import java.util.function.Supplier;
|
||||
|
||||
public class VanillaEnchantmentWrapper implements EnchantmentWrapper {
|
||||
public record AltarTiers(int tier1, int tier2, int tier3, int tier4, int tier5) {
|
||||
public AltarTiers(int tier1, int tier2, int tier3, int tier4) {
|
||||
this(tier1, tier2, tier3, tier4, tier4);
|
||||
}
|
||||
|
||||
public AltarTiers(int tier1, int tier2, int tier3) {
|
||||
this(tier1, tier2, tier3, tier3, tier3);
|
||||
}
|
||||
|
||||
public AltarTiers(int tier1, int tier2) {
|
||||
this(tier1, tier2, tier2, tier2, tier2);
|
||||
}
|
||||
|
||||
public AltarTiers(int tier1) {
|
||||
this(tier1, tier1, tier1, tier1, tier1);
|
||||
}
|
||||
|
||||
public int get(int tier) {
|
||||
return switch (tier) {
|
||||
case 1 -> tier1;
|
||||
case 2 -> tier2;
|
||||
case 3 -> tier3;
|
||||
case 4 -> tier4;
|
||||
case 5 -> tier5;
|
||||
default -> 0;
|
||||
};
|
||||
}
|
||||
|
||||
public int getMax() {
|
||||
return tier5;
|
||||
}
|
||||
}
|
||||
|
||||
public record Warning(String message, int enchantmentLevel) {
|
||||
}
|
||||
|
||||
private final Enchantment enchantment;
|
||||
private final Supplier<ItemStack> icon;
|
||||
private final List<AltarRecipe> recipes;
|
||||
private final AltarTiers altarLevels;
|
||||
private final List<Warning> warnings;
|
||||
|
||||
public VanillaEnchantmentWrapper(Enchantment enchantment, Supplier<ItemStack> icon, AltarTiers altarLevels, List<Warning> warnings, AltarRecipe... recipes) {
|
||||
public VanillaEnchantmentWrapper(Enchantment enchantment, Supplier<ItemStack> icon, List<Warning> warnings, AltarRecipe... recipes) {
|
||||
this.enchantment = enchantment;
|
||||
this.icon = icon;
|
||||
this.recipes = List.of(recipes);
|
||||
this.altarLevels = altarLevels;
|
||||
this.warnings = warnings;
|
||||
}
|
||||
|
||||
public VanillaEnchantmentWrapper(Enchantment enchantment, Supplier<ItemStack> icon, AltarTiers altarLevels, AltarRecipe... recipes) {
|
||||
public VanillaEnchantmentWrapper(Enchantment enchantment, Supplier<ItemStack> icon, AltarRecipe... recipes) {
|
||||
this.enchantment = enchantment;
|
||||
this.icon = icon;
|
||||
this.recipes = List.of(recipes);
|
||||
this.altarLevels = altarLevels;
|
||||
this.warnings = List.of();
|
||||
}
|
||||
|
||||
|
@ -103,11 +67,6 @@ public class VanillaEnchantmentWrapper implements EnchantmentWrapper {
|
|||
return tool.getEnchantmentLevel(enchantment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return altarLevels.getMax();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEnchantItem(ItemStack tool) {
|
||||
Map<CustomEnchantment, Integer> customEnchantmentLevels = EnchantmentHelper.getCustomEnchantments(tool);
|
||||
|
@ -172,13 +131,7 @@ public class VanillaEnchantmentWrapper implements EnchantmentWrapper {
|
|||
color = NamedTextColor.RED;
|
||||
}
|
||||
|
||||
return Component.translatable(enchantment.translationKey()).color(color).decoration(TextDecoration.ITALIC, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxLevelAvailableInAltar(int altarTier) {
|
||||
if (altarTier < 1) return 0;
|
||||
return altarLevels.get(altarTier);
|
||||
return enchantment.description().color(color).decoration(TextDecoration.ITALIC, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -192,16 +145,8 @@ public class VanillaEnchantmentWrapper implements EnchantmentWrapper {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AltarRecipe getRecipe(int level) {
|
||||
if(level <= 0) {
|
||||
return recipes.getFirst();
|
||||
}
|
||||
|
||||
if(level > recipes.size()) {
|
||||
return recipes.getLast();
|
||||
}
|
||||
|
||||
return recipes.get(level-1);
|
||||
public List<AltarRecipe> getRecipes() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
public Enchantment getEnchantment() {
|
||||
|
|
|
@ -19,9 +19,9 @@ import de.blazemcworld.blazinggames.items.predicates.EmptyItemPredicate;
|
|||
import de.blazemcworld.blazinggames.items.predicates.ItemPredicate;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public record AltarRecipe(int lapisAmount, int expAmount, int itemAmount, ItemPredicate itemRequirement) {
|
||||
public AltarRecipe(int lapisAmount, int expAmount, ItemPredicate itemRequirement) {
|
||||
this(lapisAmount, expAmount, (itemRequirement instanceof EmptyItemPredicate) ? 0 : 1, itemRequirement);
|
||||
public record AltarRecipe(int tier, int lapisAmount, int expAmount, int itemAmount, ItemPredicate itemRequirement) {
|
||||
public AltarRecipe(int tier, int lapisAmount, int expAmount, ItemPredicate itemRequirement) {
|
||||
this(tier, lapisAmount, expAmount, (itemRequirement instanceof EmptyItemPredicate) ? 0 : 1, itemRequirement);
|
||||
}
|
||||
|
||||
public boolean matchMaterial(ItemStack material) {
|
||||
|
|
|
@ -162,7 +162,7 @@ public class BreakBlockEventListener implements Listener {
|
|||
int pattern = EnchantmentHelper.getActiveCustomEnchantmentLevel(mainHand, CustomEnchantments.PATTERN);
|
||||
|
||||
if (pattern > 0 && face != null) {
|
||||
Pair<Integer, Integer> dimensions = PatternEnchantment.dimensions.get(pattern - 1).left2();
|
||||
Pair<Integer, Integer> dimensions = PatternEnchantment.dimensions.get(pattern - 1);
|
||||
|
||||
for (int i = 0; i < dimensions.left; i++) {
|
||||
int x = -dimensions.left / 2 + i;
|
||||
|
|
Loading…
Reference in a new issue