mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Rewriten how dependency is handled
This commit is contained in:
parent
b512d8f732
commit
aad9974baf
10 changed files with 56 additions and 19 deletions
|
|
@ -9,6 +9,7 @@ import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
|||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import xyz.alexcrea.cuanvil.dependency.DependencyManager;
|
||||
import xyz.alexcrea.cuanvil.enchant.wrapped.VanillaEnchant;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -172,7 +173,7 @@ public abstract class WrappedEnchantment {
|
|||
* @param item Item to get enchantment from.
|
||||
* @return A map of the set enchantments and there's respective levels.
|
||||
*/
|
||||
public static Map<WrappedEnchantment, Integer> getEnchants(@NotNull ItemStack item){ //TODO faster method to find vanilla enchantment
|
||||
public static Map<WrappedEnchantment, Integer> getEnchants(@NotNull ItemStack item){
|
||||
Map<WrappedEnchantment, Integer> enchantments = new HashMap<>();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
|
@ -232,6 +233,10 @@ public abstract class WrappedEnchantment {
|
|||
register(new VanillaEnchant(enchantment));
|
||||
}
|
||||
|
||||
if(DependencyManager.INSTANCE.getEnchantmentSquaredCompatibility() != null){
|
||||
DependencyManager.INSTANCE.getEnchantmentSquaredCompatibility().registerEnchantements();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import xyz.alexcrea.cuanvil.gui.config.global.*;
|
||||
import xyz.alexcrea.cuanvil.gui.util.GuiGlobalItems;
|
||||
import xyz.alexcrea.cuanvil.packet.PacketManager;
|
||||
import xyz.alexcrea.cuanvil.dependency.protocolib.PacketManager;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import xyz.alexcrea.cuanvil.gui.config.settings.IntSettingsGui;
|
|||
import xyz.alexcrea.cuanvil.gui.util.GuiGlobalActions;
|
||||
import xyz.alexcrea.cuanvil.gui.util.GuiGlobalItems;
|
||||
import xyz.alexcrea.cuanvil.gui.util.GuiSharedConstant;
|
||||
import xyz.alexcrea.cuanvil.packet.PacketManager;
|
||||
import xyz.alexcrea.cuanvil.dependency.protocolib.PacketManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue