|
27 | 27 |
|
28 | 28 | public final class EfficiencyAttributeStorage implements StorableObject { |
29 | 29 |
|
30 | | - public static final EnchantAttributeModifier EFFICIENCY = new EnchantAttributeModifier("minecraft:enchantment.efficiency/mainhand", 19, 0, level -> (level * level) + 1); |
31 | | - public static final EnchantAttributeModifier SOUL_SPEED = new EnchantAttributeModifier("minecraft:enchantment.soul_speed", 21, 0.1, level -> 0.04D + ((level - 1) * 0.01D)); |
32 | | - public static final EnchantAttributeModifier SWIFT_SNEAK = new EnchantAttributeModifier("minecraft:enchantment.swift_sneak", 25, 0.3, level -> level * 0.15D); |
33 | | - public static final EnchantAttributeModifier DEPTH_STRIDER = new EnchantAttributeModifier("minecraft:enchantment.depth_strider", 30, 0, level -> level / 3D); |
| 30 | + private static final EnchantAttributeModifier EFFICIENCY = new EnchantAttributeModifier("minecraft:enchantment.efficiency/mainhand", 19, 0, level -> (level * level) + 1); |
| 31 | + private static final EnchantAttributeModifier SOUL_SPEED = new EnchantAttributeModifier("minecraft:enchantment.soul_speed", 21, 0.1, level -> 0.04D + ((level - 1) * 0.01D)); |
| 32 | + private static final EnchantAttributeModifier SWIFT_SNEAK = new EnchantAttributeModifier("minecraft:enchantment.swift_sneak", 25, 0.3, level -> level * 0.15D); |
| 33 | + private static final EnchantAttributeModifier DEPTH_STRIDER = new EnchantAttributeModifier("minecraft:enchantment.depth_strider", 30, 0, level -> level / 3D); |
34 | 34 | private static final ActiveEnchants DEFAULT = new ActiveEnchants(-1, |
35 | 35 | new ActiveEnchant(EFFICIENCY, 0), |
36 | 36 | new ActiveEnchant(SOUL_SPEED, 0), |
@@ -115,18 +115,7 @@ public record ActiveEnchants(int entityId, ActiveEnchant efficiency, ActiveEncha |
115 | 115 | public record ActiveEnchant(EnchantAttributeModifier modifier, int level) { |
116 | 116 | } |
117 | 117 |
|
118 | | - public static final class EnchantAttributeModifier { // Private constructor, equals by reference |
119 | | - private final String key; |
120 | | - private final int attributeId; |
121 | | - private final double baseValue; |
122 | | - private final LevelToModifier modifierFunction; |
123 | | - |
124 | | - private EnchantAttributeModifier(final String key, final int attributeId, final double baseValue, final LevelToModifier modifierFunction) { |
125 | | - this.key = key; |
126 | | - this.attributeId = attributeId; |
127 | | - this.baseValue = baseValue; |
128 | | - this.modifierFunction = modifierFunction; |
129 | | - } |
| 118 | + public record EnchantAttributeModifier(String key, int attributeId, double baseValue, LevelToModifier modifierFunction) { |
130 | 119 | } |
131 | 120 |
|
132 | 121 | @FunctionalInterface |
|
0 commit comments