Added a way to protect GooP Converter's converted items from the RevID system.

This commit is contained in:
Gunging 2021-10-18 16:52:53 -05:00
parent 6b80ca51bd
commit 6f77e0f666
2 changed files with 7 additions and 3 deletions

View File

@ -31,6 +31,7 @@ import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
@ -258,11 +259,11 @@ public class ItemStackBuilder {
/**
* @return Builds the item
*/
@Nullable
public ItemStack build() {
ItemBuildEvent itemBuildEvent = new ItemBuildEvent(buildNBT().toItem());
Bukkit.getServer().getPluginManager().callEvent(itemBuildEvent);
if (itemBuildEvent.isCancelled())
return null;
//Bukkit.getServer().getPluginManager().callEvent(itemBuildEvent);
if (itemBuildEvent.isCancelled()) { return null; }
return itemBuildEvent.getItemStack();
}

View File

@ -270,6 +270,9 @@ public class MMOItemReforger {
// Fist of all, can it update?
if (!canReforge()) { return shouldUpdate = false; }
// Its not GooP Converter's VANILLA is it?
if ("VANILLA".equals(nbtItem.getString("MMOITEMS_ITEM_ID"))) { return false; }
// Disabled in config?
if (reason != null && MMOItems.plugin.getConfig().getBoolean("item-revision.disable-on." + reason)) { return shouldUpdate = false; }