mark superenchant as bulk and clear optimized

This commit is contained in:
alexcrea 2026-06-30 03:44:37 +02:00
parent 447859848b
commit 72a7860d93
Signed by: alexcrea
GPG key ID: E346CD16413450E3
3 changed files with 17 additions and 3 deletions

View file

@ -217,7 +217,9 @@ public class EnchantmentApi {
}
/**
* Add a bulk get operator.
* Add a bulk get operator. (not needed for proper "bukkit" enchantments)
* <p>
* Do not forget to mark your enchantments as {@link CAEnchantment#isGetOptimised() Get Optimized}
* @param operation An optimised get enchantments operation
*/
public static void addBulkGet(@NotNull BulkGetEnchantOperation operation){
@ -226,7 +228,9 @@ public class EnchantmentApi {
/**
* Add a bulk clean operator.
* @param operation An optimised clean enchantments operation
* @param operation An optimised clean enchantments operation (not needed for proper "bukkit" enchantments)
* <p>
* Do not forget to mark your enchantments as {@link CAEnchantment#isCleanOptimised() Clean Optimized}
*/
public static void addBulkClean(@NotNull BulkCleanEnchantOperation operation){
CAEnchantmentRegistry.getInstance().getOptimisedCleanOperators().add(operation);

View file

@ -41,7 +41,7 @@ public class SuperEnchantBulkOperation implements BulkGetEnchantOperation, BulkC
@Override
public void bulkClear(@NotNull ItemStack item, @NotNull ItemMeta meta) {
// item meta is not preferred for enchantment squared clear
// item meta is not preferred for super enchant
}
}

View file

@ -73,4 +73,14 @@ public class CASuperEnchantEnchantment extends CAEnchantmentBase implements Addi
return !enchant.canApplyTo(item.getType());
}
@Override
public boolean isCleanOptimised() {
return true;
}
@Override
public boolean isGetOptimised() {
return true;
}
}