mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-01-21 21:01:20 +01:00
Fixed the MMOItems Error #253
This commit is contained in:
parent
86f82f0a14
commit
948b843b59
12
pom.xml
12
pom.xml
@ -108,7 +108,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.15-R0.1-SNAPSHOT</version>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@ -205,12 +205,18 @@
|
||||
<version>4bb9abd247</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- Contains proprietary api that we use for integration -->
|
||||
<!--<dependency>
|
||||
Contains proprietary api that we use for integration
|
||||
<groupId>com.dre</groupId>
|
||||
<artifactId>ExtPluginBridge</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>net.mmogroup</groupId>
|
||||
<artifactId>mmolib</artifactId>
|
||||
<version>1.0.9</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
|
@ -13,8 +13,8 @@ import com.dre.brewery.integration.item.MMOItemsPluginItem;
|
||||
import com.dre.brewery.recipe.BCauldronRecipe;
|
||||
import com.dre.brewery.recipe.RecipeItem;
|
||||
import com.dre.brewery.utility.LegacyUtil;
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
import net.Indyuce.mmoitems.api.item.NBTItem;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@ -219,7 +219,7 @@ public class IntegrationListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onInteract(PlayerInteractEvent event) {
|
||||
// Cancel the Interact Event early, so MMOItems does not act before us and consume the item when trying to add item to Cauldron
|
||||
// Catch the Interact Event early, so MMOItems does not act before us and cancel the event while we try to add it to the Cauldron
|
||||
if (!P.use1_9) return;
|
||||
if (BConfig.hasMMOItems == null) {
|
||||
BConfig.hasMMOItems = P.p.getServer().getPluginManager().isPluginEnabled("MMOItems");
|
||||
@ -228,7 +228,7 @@ public class IntegrationListener implements Listener {
|
||||
try {
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.hasItem() && event.getHand() == EquipmentSlot.HAND) {
|
||||
if (event.getClickedBlock() != null && event.getClickedBlock().getType() == Material.CAULDRON) {
|
||||
NBTItem item = MMOItems.plugin.getNMS().getNBTItem(event.getItem());
|
||||
NBTItem item = MMOLib.plugin.getNMS().getNBTItem(event.getItem());
|
||||
if (item.hasType()) {
|
||||
for (RecipeItem rItem : BCauldronRecipe.acceptedCustom) {
|
||||
if (rItem instanceof MMOItemsPluginItem) {
|
||||
@ -246,6 +246,7 @@ public class IntegrationListener implements Listener {
|
||||
} catch (Throwable e) {
|
||||
P.p.errorLog("Could not check MMOItems for Item");
|
||||
e.printStackTrace();
|
||||
BConfig.hasMMOItems = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ package com.dre.brewery.integration.item;
|
||||
import com.dre.brewery.P;
|
||||
import com.dre.brewery.filedata.BConfig;
|
||||
import com.dre.brewery.recipe.PluginItem;
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
import net.Indyuce.mmoitems.api.item.NBTItem;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class MMOItemsPluginItem extends PluginItem {
|
||||
@ -21,11 +21,12 @@ public class MMOItemsPluginItem extends PluginItem {
|
||||
if (!BConfig.hasMMOItems) return false;
|
||||
|
||||
try {
|
||||
NBTItem nbtItem = MMOItems.plugin.getNMS().getNBTItem(item);
|
||||
NBTItem nbtItem = MMOLib.plugin.getNMS().getNBTItem(item);
|
||||
return nbtItem.hasType() && nbtItem.getString("MMOITEMS_ITEM_ID").equalsIgnoreCase(getItemId());
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
P.p.errorLog("Could not check MMOItems for Item ID");
|
||||
BConfig.hasMMOItems = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ public class SlimefunPluginItem extends PluginItem {
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
P.p.errorLog("Could not check Slimefun for Item ID");
|
||||
BConfig.hasSlimefun = false;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user