mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-08-28 08:25:56 +02:00
mark superenchant as bulk and clear optimized
This commit is contained in:
parent
447859848b
commit
72a7860d93
3 changed files with 17 additions and 3 deletions
|
|
@ -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
|
* @param operation An optimised get enchantments operation
|
||||||
*/
|
*/
|
||||||
public static void addBulkGet(@NotNull BulkGetEnchantOperation operation){
|
public static void addBulkGet(@NotNull BulkGetEnchantOperation operation){
|
||||||
|
|
@ -226,7 +228,9 @@ public class EnchantmentApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a bulk clean operator.
|
* 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){
|
public static void addBulkClean(@NotNull BulkCleanEnchantOperation operation){
|
||||||
CAEnchantmentRegistry.getInstance().getOptimisedCleanOperators().add(operation);
|
CAEnchantmentRegistry.getInstance().getOptimisedCleanOperators().add(operation);
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public class SuperEnchantBulkOperation implements BulkGetEnchantOperation, BulkC
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bulkClear(@NotNull ItemStack item, @NotNull ItemMeta meta) {
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,4 +73,14 @@ public class CASuperEnchantEnchantment extends CAEnchantmentBase implements Addi
|
||||||
|
|
||||||
return !enchant.canApplyTo(item.getType());
|
return !enchant.canApplyTo(item.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCleanOptimised() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isGetOptimised() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue