Renamed CAVanillaEnchantment to CABukkitEnchantment for clarity reason.

This commit is contained in:
alexcrea 2024-07-12 01:06:32 +02:00
parent b467823f82
commit 7407cfd135
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
4 changed files with 11 additions and 11 deletions

View file

@ -13,7 +13,7 @@ import xyz.alexcrea.cuanvil.enchant.CAEnchantmentRegistry;
import xyz.alexcrea.cuanvil.enchant.EnchantmentRarity;
import xyz.alexcrea.cuanvil.enchant.bulk.BulkCleanEnchantOperation;
import xyz.alexcrea.cuanvil.enchant.bulk.BulkGetEnchantOperation;
import xyz.alexcrea.cuanvil.enchant.wrapped.CAVanillaEnchantment;
import xyz.alexcrea.cuanvil.enchant.wrapped.CABukkitEnchantment;
import xyz.alexcrea.cuanvil.gui.config.global.EnchantCostConfigGui;
import xyz.alexcrea.cuanvil.gui.config.global.EnchantLimitConfigGui;
@ -62,9 +62,9 @@ public class EnchantmentApi {
*/
public static boolean registerEnchantment(@NotNull Enchantment enchantment, @Nullable EnchantmentRarity defaultRarity){
if(defaultRarity == null)
return registerEnchantment(new CAVanillaEnchantment(enchantment));
return registerEnchantment(new CABukkitEnchantment(enchantment));
return registerEnchantment(new CAVanillaEnchantment(enchantment, defaultRarity));
return registerEnchantment(new CABukkitEnchantment(enchantment, defaultRarity));
}
/**
@ -76,7 +76,7 @@ public class EnchantmentApi {
* @return True if successful.
*/
public static boolean registerEnchantment(@NotNull Enchantment enchantment){
return registerEnchantment(new CAVanillaEnchantment(enchantment));
return registerEnchantment(new CABukkitEnchantment(enchantment));
}
/**

View file

@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable;
import xyz.alexcrea.cuanvil.enchant.bulk.BukkitEnchantBulkOperation;
import xyz.alexcrea.cuanvil.enchant.bulk.BulkCleanEnchantOperation;
import xyz.alexcrea.cuanvil.enchant.bulk.BulkGetEnchantOperation;
import xyz.alexcrea.cuanvil.enchant.wrapped.CAVanillaEnchantment;
import xyz.alexcrea.cuanvil.enchant.wrapped.CABukkitEnchantment;
import java.util.*;
import java.util.logging.Level;
@ -48,7 +48,7 @@ public class CAEnchantmentRegistry {
public void registerBukkit(){
// Register enchantment
for (Enchantment enchantment : Enchantment.values()) {
register(new CAVanillaEnchantment(enchantment));
register(new CABukkitEnchantment(enchantment));
}
// Add bukkit enchantment bulk operation

View file

@ -16,18 +16,18 @@ import java.util.Locale;
/**
* Custom Anvil enchantment implementation for vanilla registered enchantment.
*/
public class CAVanillaEnchantment extends CAEnchantmentBase {
public class CABukkitEnchantment extends CAEnchantmentBase {
private final @NotNull Enchantment enchantment;
public CAVanillaEnchantment(@NotNull Enchantment enchantment, @Nullable EnchantmentRarity rarity){
public CABukkitEnchantment(@NotNull Enchantment enchantment, @Nullable EnchantmentRarity rarity){
super(enchantment.getKey(),
rarity,
enchantment.getMaxLevel());
this.enchantment = enchantment;
}
public CAVanillaEnchantment(@NotNull Enchantment enchantment){
public CABukkitEnchantment(@NotNull Enchantment enchantment){
this(enchantment, getRarity(enchantment));
}

View file

@ -11,7 +11,7 @@ import xyz.alexcrea.cuanvil.enchant.EnchantmentRarity;
import java.util.Map;
public class CAEcoEnchant extends CAVanillaEnchantment implements AdditionalTestEnchantment {
public class CAEcoEnchant extends CABukkitEnchantment implements AdditionalTestEnchantment {
private final @NotNull EcoEnchant ecoEnchant;
@ -28,7 +28,7 @@ public class CAEcoEnchant extends CAVanillaEnchantment implements AdditionalTest
}
for (CAEnchantment other : enchantments.keySet()) {
if(other instanceof CAVanillaEnchantment otherVanilla
if(other instanceof CABukkitEnchantment otherVanilla
&& this.ecoEnchant.conflictsWith(otherVanilla.getEnchant())){
return true;
}