9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-31 21:06:47 +00:00

try fixing some hooks

This commit is contained in:
XiaoMoMi
2024-11-11 15:54:02 +08:00
parent b4d10bb228
commit 8a06d0aed6
6 changed files with 43 additions and 6 deletions

View File

@@ -151,7 +151,6 @@ public class BukkitHookManager implements HookManager, Listener {
newLore.add(previous);
}
wrapped.lore(newLore);
wrapped.load();
return;
}
@@ -201,6 +200,9 @@ public class BukkitHookManager implements HookManager, Listener {
DurabilityItem durabilityItem;
if (wrappedHook.hasTag("CustomFishing", "max_dur")) {
durabilityItem = new CustomDurabilityItem(wrappedHook);
} else if (hookConfig.maxUsages() > 0) {
wrappedHook.setTag(hookConfig.maxUsages(), "CustomFishing", "max_dur");
durabilityItem = new CustomDurabilityItem(wrappedHook);
} else {
durabilityItem = new VanillaDurabilityItem(wrappedHook);
}

View File

@@ -177,6 +177,7 @@ public class BukkitItemManager implements ItemManager, Listener {
return (String) factory.wrap(itemStack).getTag("CustomFishing", "id").orElse(null);
}
@NotNull
@Override
public ItemStack getItemLoot(@NotNull Context<Player> context, ItemStack rod, FishHook hook) {
String id = requireNonNull(context.arg(ContextKeys.ID));