9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-27 02:49:17 +00:00

zap items & fix 1.20-

This commit is contained in:
XiaoMoMi
2023-09-19 01:40:37 +08:00
parent 4a9e96429a
commit a0bb0e4726
9 changed files with 43 additions and 4 deletions

View File

@@ -78,6 +78,10 @@ public class IntegrationManagerImpl implements IntegrationManager {
plugin.getItemManager().registerItemLibrary(new OraxenItemImpl());
hookMessage("Oraxen");
}
if (plugin.isHookedPluginEnabled("Zaphkiel")) {
plugin.getItemManager().registerItemLibrary(new ZaphkielItemImpl());
hookMessage("Zaphkiel");
}
if (plugin.isHookedPluginEnabled("NeigeItems")) {
plugin.getItemManager().registerItemLibrary(new NeigeItemsItemImpl());
hookMessage("NeigeItems");

View File

@@ -0,0 +1,33 @@
package net.momirealms.customfishing.compatibility.item;
import ink.ptms.zaphkiel.ZapAPI;
import ink.ptms.zaphkiel.Zaphkiel;
import net.momirealms.customfishing.api.mechanic.item.ItemLibrary;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class ZaphkielItemImpl implements ItemLibrary {
private final ZapAPI zapAPI;
public ZaphkielItemImpl() {
this.zapAPI = Zaphkiel.INSTANCE.api();
}
@Override
public String identification() {
return "Zaphkiel";
}
@Override
public ItemStack buildItem(Player player, String id) {
return zapAPI.getItemManager().generateItemStack(id, player);
}
@Override
public String getItemID(ItemStack itemStack) {
if (itemStack == null || itemStack.getType() == Material.AIR) return null;
return zapAPI.getItemHandler().getItemId(itemStack);
}
}

View File

@@ -294,7 +294,7 @@ public class FishingManagerImpl implements Listener, FishingManager {
if ((entity instanceof ArmorStand armorStand)
&& armorStand.getPersistentDataContainer().get(
Objects.requireNonNull(NamespacedKey.fromString("lavafishing", plugin)),
PersistentDataType.BOOLEAN
PersistentDataType.STRING
) != null) {
// The hook is hooked into the temp entity
// This might be called both not in game and in game

View File

@@ -230,8 +230,8 @@ public class HookCheckTimerTask implements Runnable {
a.setGravity(false);
a.getPersistentDataContainer().set(
Objects.requireNonNull(NamespacedKey.fromString("lavafishing", CustomFishingPlugin.get())),
PersistentDataType.BOOLEAN,
true
PersistentDataType.STRING,
"temp"
);
});
fishHook.setHookedEntity(hookedEntity);

View File

@@ -33,6 +33,7 @@ softdepend:
- Jobs
- EcoJobs
- Zaphkiel
permissions:
fishingbag.user: