mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-25 15:35:11 +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
|
||||
public int getMaxLevel() {
|
||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
||||
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
||||
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
||||
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,7 +18,7 @@ public class EcoCraftEnchantment extends CraftEnchantment {
|
||||
|
||||
@Override
|
||||
public int getMaxLevel() {
|
||||
return metadata.getMaxLevel() == null ? this.getHandle().getMaxLevel() : metadata.getMaxLevel();
|
||||
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,11 +1,6 @@
|
||||
package com.willfp.ecoenchants.enchantments.support.vanilla;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VanillaEnchantmentMetadata {
|
||||
/**
|
||||
* The maximum level for the enchantment.
|
||||
*/
|
||||
private Integer maxLevel = null;
|
||||
public record VanillaEnchantmentMetadata(
|
||||
Integer maxLevel
|
||||
) {
|
||||
}
|
||||
|
@ -51,9 +51,7 @@ public class VanillaEnchantments {
|
||||
));
|
||||
|
||||
for (Enchantment enchantment : enchantments) {
|
||||
VanillaEnchantmentMetadata metadata = new VanillaEnchantmentMetadata();
|
||||
|
||||
metadata.setMaxLevel(maxLevels.get(enchantment));
|
||||
VanillaEnchantmentMetadata metadata = new VanillaEnchantmentMetadata(maxLevels.get(enchantment));
|
||||
|
||||
map.put(enchantment, metadata);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user