mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-07-15 18:42:34 +00:00
feat(TU31): add Depth Strider enchantment
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using Minecraft.Server.FourKit.Inventory;
|
||||
|
||||
namespace Minecraft.Server.FourKit.Enchantments;
|
||||
|
||||
public class DepthStriderEnchantment : Enchantment
|
||||
{
|
||||
static readonly Material[] supportedItems = {
|
||||
Material.LEATHER_BOOTS, Material.CHAINMAIL_BOOTS, Material.GOLD_BOOTS, Material.IRON_BOOTS, Material.DIAMOND_BOOTS,
|
||||
};
|
||||
|
||||
static readonly EnchantmentType[] conflictedEnchants = { };
|
||||
|
||||
public override bool canEnchantItem(ItemStack item) => supportedItems.Contains(item.getType());
|
||||
|
||||
public override bool conflictsWith(Enchantment other) => conflictedEnchants.Contains(other.getEnchantType());
|
||||
|
||||
public override EnchantmentTarget getItemTarget() => EnchantmentTarget.ARMOR_FEET;
|
||||
|
||||
public override EnchantmentType getEnchantType() => EnchantmentType.WATER_WALKER;
|
||||
|
||||
public override int getMaxLevel() => 1;
|
||||
|
||||
public override string getName() => "depthstrider";
|
||||
|
||||
public override int getStartLevel() => 1;
|
||||
}
|
||||
@@ -140,6 +140,10 @@ public enum EnchantmentType
|
||||
/// Increases the speed at which a player may mine underwater
|
||||
/// </summary>
|
||||
WATER_WORKER = 6,
|
||||
///<summary>
|
||||
/// Increases the speed at which a player may walk/swim underwater
|
||||
/// </summary>
|
||||
WATER_WALKER = 8,
|
||||
/// <summary>
|
||||
/// Increases the rate at which fish bite the hook while fishing
|
||||
/// </summary>
|
||||
@@ -176,7 +180,7 @@ public abstract class Enchantment
|
||||
public static Enchantment AquaAffinityEnchantment => _registry[EnchantmentType.WATER_WORKER];
|
||||
public static Enchantment LureEnchantment => _registry[EnchantmentType.LURE];
|
||||
public static Enchantment LuckOfTheSeaEnchantment => _registry[EnchantmentType.LUCK_OF_THE_SEA];
|
||||
|
||||
public static Enchantment DepthStriderEnchantment => _registry[EnchantmentType.WATER_WALKER];
|
||||
|
||||
private static Dictionary<EnchantmentType, Enchantment> _registry = new Dictionary<EnchantmentType, Enchantment>()
|
||||
{
|
||||
@@ -204,6 +208,7 @@ public abstract class Enchantment
|
||||
{ EnchantmentType.WATER_WORKER, new AquaAffinityEnchantment() },
|
||||
{ EnchantmentType.LURE, new LureEnchantment() },
|
||||
{ EnchantmentType.LUCK_OF_THE_SEA, new LuckOfTheSeaEnchantment() },
|
||||
{ EnchantmentType.WATER_WALKER, new DepthStriderEnchantment() },
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user