mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-29 16:15:17 +01:00
Updated to use more Java 16 feature
This commit is contained in:
parent
c3c158207d
commit
633da45df2
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxLevel() {
|
public int getMaxLevel() {
|
||||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxLevel() {
|
public int getMaxLevel() {
|
||||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxLevel() {
|
public int getMaxLevel() {
|
||||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxLevel() {
|
public int getMaxLevel() {
|
||||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
package com.willfp.ecoenchants.enchantments.support.vanilla;
|
package com.willfp.ecoenchants.enchantments.support.vanilla;
|
||||||
|
|
||||||
import lombok.Data;
|
public record VanillaEnchantmentMetadata(
|
||||||
|
Integer maxLevel
|
||||||
@Data
|
) {
|
||||||
public class VanillaEnchantmentMetadata {
|
|
||||||
/**
|
|
||||||
* The maximum level for the enchantment.
|
|
||||||
*/
|
|
||||||
private Integer maxLevel = null;
|
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,7 @@ public class VanillaEnchantments {
|
|||||||
));
|
));
|
||||||
|
|
||||||
for (Enchantment enchantment : enchantments) {
|
for (Enchantment enchantment : enchantments) {
|
||||||
VanillaEnchantmentMetadata metadata = new VanillaEnchantmentMetadata();
|
VanillaEnchantmentMetadata metadata = new VanillaEnchantmentMetadata(maxLevels.get(enchantment));
|
||||||
|
|
||||||
metadata.setMaxLevel(maxLevels.get(enchantment));
|
|
||||||
|
|
||||||
map.put(enchantment, metadata);
|
map.put(enchantment, metadata);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user