mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-09 02:13:09 +00:00
feat(fourkit): add the missing Lure and Luck of the Sea fishing enchantments
This commit is contained in:
parent
eabde3527c
commit
d6017e4766
|
|
@ -139,7 +139,15 @@ public enum EnchantmentType
|
|||
/// <summary>
|
||||
/// Increases the speed at which a player may mine underwater
|
||||
/// </summary>
|
||||
WATER_WORKER = 6
|
||||
WATER_WORKER = 6,
|
||||
/// <summary>
|
||||
/// Increases the rate at which fish bite the hook while fishing
|
||||
/// </summary>
|
||||
LURE = 64,
|
||||
/// <summary>
|
||||
/// Increases the chance of catching valuable items while fishing
|
||||
/// </summary>
|
||||
LUCK_OF_THE_SEA = 65
|
||||
}
|
||||
|
||||
public abstract class Enchantment
|
||||
|
|
@ -166,6 +174,8 @@ public abstract class Enchantment
|
|||
public static Enchantment SilkTouchEnchantment => _registry[EnchantmentType.SILK_TOUCH];
|
||||
public static Enchantment ThornsEnchantment => _registry[EnchantmentType.THORNS];
|
||||
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];
|
||||
|
||||
|
||||
private static Dictionary<EnchantmentType, Enchantment> _registry = new Dictionary<EnchantmentType, Enchantment>()
|
||||
|
|
@ -192,6 +202,8 @@ public abstract class Enchantment
|
|||
{ EnchantmentType.SILK_TOUCH, new SilkTouchEnchantment() },
|
||||
{ EnchantmentType.THORNS, new ThornsEnchantment() },
|
||||
{ EnchantmentType.WATER_WORKER, new AquaAffinityEnchantment() },
|
||||
{ EnchantmentType.LURE, new LureEnchantment() },
|
||||
{ EnchantmentType.LUCK_OF_THE_SEA, new LuckOfTheSeaEnchantment() },
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
using Minecraft.Server.FourKit.Inventory;
|
||||
|
||||
namespace Minecraft.Server.FourKit.Enchantments;
|
||||
|
||||
public class LuckOfTheSeaEnchantment : Enchantment
|
||||
{
|
||||
|
||||
public override bool canEnchantItem(ItemStack item) => item.getType().Equals(Material.FISHING_ROD);
|
||||
|
||||
public override bool conflictsWith(Enchantment other) => false;
|
||||
|
||||
public override EnchantmentTarget getItemTarget() => EnchantmentTarget.TOOL;
|
||||
|
||||
public override EnchantmentType getEnchantType() => EnchantmentType.LUCK_OF_THE_SEA;
|
||||
|
||||
public override int getMaxLevel() => 3;
|
||||
|
||||
public override string getName() => "luckofthesea";
|
||||
|
||||
public override int getStartLevel() => 1;
|
||||
}
|
||||
21
Minecraft.Server.FourKit/Enchantments/LureEnchantment.cs
Normal file
21
Minecraft.Server.FourKit/Enchantments/LureEnchantment.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using Minecraft.Server.FourKit.Inventory;
|
||||
|
||||
namespace Minecraft.Server.FourKit.Enchantments;
|
||||
|
||||
public class LureEnchantment : Enchantment
|
||||
{
|
||||
|
||||
public override bool canEnchantItem(ItemStack item) => item.getType().Equals(Material.FISHING_ROD);
|
||||
|
||||
public override bool conflictsWith(Enchantment other) => false;
|
||||
|
||||
public override EnchantmentTarget getItemTarget() => EnchantmentTarget.TOOL;
|
||||
|
||||
public override EnchantmentType getEnchantType() => EnchantmentType.LURE;
|
||||
|
||||
public override int getMaxLevel() => 3;
|
||||
|
||||
public override string getName() => "lure";
|
||||
|
||||
public override int getStartLevel() => 1;
|
||||
}
|
||||
Loading…
Reference in a new issue