9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-28 19:39:06 +00:00
This commit is contained in:
Xiao-MoMi
2023-03-18 18:34:57 +08:00
parent 85f779bae7
commit 1bbe22bb65
3 changed files with 19 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ dependencies {
compileOnly('redis.clients:jedis:4.3.1')
compileOnly('me.clip:placeholderapi:2.11.3')
compileOnly('com.sk89q.worldguard:worldguard-bukkit:7.0.7')
compileOnly('io.lumine:Mythic-Dist:5.0.3-SNAPSHOT')
compileOnly('io.lumine:Mythic-Dist:5.2.1')
compileOnly('dev.dejvokep:boosted-yaml:1.3')
compileOnly('com.github.Zrips:Jobs:4.17.2')
compileOnly('com.github.LoneDev6:api-itemsadder:3.2.3c')

View File

@@ -26,17 +26,21 @@ import org.jetbrains.annotations.Nullable;
public class MythicMobsItemImpl implements ItemInterface {
private ItemExecutor itemManager;
private MythicBukkit mythicBukkit;
public MythicMobsItemImpl() {
this.mythicBukkit = MythicBukkit.inst();
}
@Override
@Nullable
public ItemStack build(String material) {
if (!material.startsWith("MythicMobs:")) return null;
material = material.substring(11);
if (itemManager == null) {
this.itemManager = MythicBukkit.inst().getItemManager();
if (mythicBukkit == null || mythicBukkit.isClosed()) {
this.mythicBukkit = MythicBukkit.inst();
}
return itemManager.getItemStack(material);
return mythicBukkit.getItemManager().getItemStack(material);
}
@Override

View File

@@ -17,8 +17,12 @@
package net.momirealms.customfishing.integration.item;
import io.th0rgal.oraxen.OraxenPlugin;
import io.th0rgal.oraxen.api.OraxenFurniture;
import io.th0rgal.oraxen.api.OraxenItems;
import io.th0rgal.oraxen.items.ItemBuilder;
import io.th0rgal.oraxen.mechanics.provided.gameplay.durability.DurabilityMechanic;
import io.th0rgal.oraxen.mechanics.provided.gameplay.durability.DurabilityMechanicFactory;
import net.momirealms.customfishing.integration.ItemInterface;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@@ -37,6 +41,11 @@ public class OraxenItemImpl implements ItemInterface {
@Override
public boolean loseCustomDurability(ItemStack itemStack, Player player) {
return false;
DurabilityMechanic mechanic = (DurabilityMechanic) DurabilityMechanicFactory.get().getMechanic(OraxenItems.getIdByItem(itemStack));
if (mechanic == null) {
return false;
}
mechanic.changeDurability(itemStack, -1);
return true;
}
}