From f2c9ce176abd9e050f265e7393ac931db787b89f Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Thu, 29 Jun 2023 09:43:54 +0200 Subject: [PATCH] Migrate from SongodaCore to CraftaroCore v3.0.0-SNAPSHOT --- pom.xml | 26 ++++++++----- .../com/songoda/epichoppers/EpicHoppers.java | 32 +++++++-------- .../epichoppers/commands/CommandBoost.java | 6 +-- .../epichoppers/commands/CommandGive.java | 2 +- .../epichoppers/commands/CommandReload.java | 2 +- .../epichoppers/commands/CommandSettings.java | 4 +- .../epichoppers/database/DataManager.java | 4 +- .../migrations/_1_InitialMigration.java | 4 +- .../epichoppers/gui/GUIAutoSellFilter.java | 16 ++++---- .../songoda/epichoppers/gui/GUICrafting.java | 10 ++--- .../songoda/epichoppers/gui/GUIFilter.java | 20 +++++----- .../songoda/epichoppers/gui/GUIOverview.java | 18 ++++----- .../songoda/epichoppers/gui/GUISmeltable.java | 39 +++++++++++-------- .../songoda/epichoppers/hopper/Hopper.java | 10 ++--- .../hopper/levels/LevelManager.java | 6 +-- .../hopper/levels/modules/Module.java | 2 +- .../levels/modules/ModuleAutoCrafting.java | 15 +++---- .../hopper/levels/modules/ModuleAutoSell.java | 12 +++--- .../levels/modules/ModuleAutoSmelter.java | 32 ++++++++------- .../levels/modules/ModuleBlockBreak.java | 4 +- .../levels/modules/ModuleMobHopper.java | 2 +- .../hopper/levels/modules/ModuleSuction.java | 10 ++--- .../hopper/teleport/TeleportHandler.java | 4 +- .../epichoppers/listeners/BlockListeners.java | 2 +- .../listeners/HopperListeners.java | 4 +- .../listeners/InteractListeners.java | 4 +- .../epichoppers/settings/Settings.java | 14 +++---- .../songoda/epichoppers/utils/Methods.java | 4 +- .../utils/StorageContainerCache.java | 26 ++++++------- 29 files changed, 176 insertions(+), 158 deletions(-) diff --git a/pom.xml b/pom.xml index 7724fb7..5e6f928 100644 --- a/pom.xml +++ b/pom.xml @@ -68,6 +68,14 @@ LICENSE.** + + + com.craftaro:CraftaroCore + false + + **/nms/v*/** + + @@ -89,6 +97,11 @@ https://repo.craftaro.com/repository/minecraft-plugins/ + + SpigotMC + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + public https://repo.songoda.com/repository/public/ @@ -96,20 +109,15 @@ jitpack.io - https://jitpack.io - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + https://jitpack.io/ - com.songoda - SongodaCore - 2.6.20 + com.craftaro + CraftaroCore + 3.0.0-SNAPSHOT compile diff --git a/src/main/java/com/songoda/epichoppers/EpicHoppers.java b/src/main/java/com/songoda/epichoppers/EpicHoppers.java index 4222481..227690c 100644 --- a/src/main/java/com/songoda/epichoppers/EpicHoppers.java +++ b/src/main/java/com/songoda/epichoppers/EpicHoppers.java @@ -1,19 +1,19 @@ package com.songoda.epichoppers; -import com.songoda.core.SongodaCore; -import com.songoda.core.SongodaPlugin; -import com.songoda.core.commands.CommandManager; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.configuration.Config; -import com.songoda.core.database.DataMigrationManager; -import com.songoda.core.database.DatabaseConnector; -import com.songoda.core.database.MySQLConnector; -import com.songoda.core.database.SQLiteConnector; -import com.songoda.core.gui.GuiManager; -import com.songoda.core.hooks.EconomyManager; -import com.songoda.core.hooks.ProtectionManager; -import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.SongodaCore; +import com.craftaro.core.SongodaPlugin; +import com.craftaro.core.commands.CommandManager; +import com.craftaro.core.configuration.Config; +import com.craftaro.core.database.DataMigrationManager; +import com.craftaro.core.database.DatabaseConnector; +import com.craftaro.core.database.MySQLConnector; +import com.craftaro.core.database.SQLiteConnector; +import com.craftaro.core.gui.GuiManager; +import com.craftaro.core.hooks.EconomyManager; +import com.craftaro.core.hooks.ProtectionManager; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.boost.BoostManager; import com.songoda.epichoppers.commands.CommandBoost; import com.songoda.epichoppers.commands.CommandGive; @@ -84,7 +84,7 @@ public class EpicHoppers extends SongodaPlugin { @Override public void onPluginEnable() { // Run Songoda Updater - SongodaCore.registerPlugin(this, 15, CompatibleMaterial.HOPPER); + SongodaCore.registerPlugin(this, 15, XMaterial.HOPPER); // Load Economy EconomyManager.load(); @@ -252,7 +252,7 @@ public class EpicHoppers extends SongodaPlugin { } public ItemStack newHopperItem(Level level) { - ItemStack item = new ItemStack(CompatibleMaterial.HOPPER.getMaterial()); + ItemStack item = XMaterial.HOPPER.parseItem(); ItemMeta itemmeta = item.getItemMeta(); itemmeta.setDisplayName(TextUtils.formatText(Methods.formatName(level.getLevel()))); String line = getLocale().getMessage("general.nametag.lore").getMessage(); diff --git a/src/main/java/com/songoda/epichoppers/commands/CommandBoost.java b/src/main/java/com/songoda/epichoppers/commands/CommandBoost.java index c48035e..cf10f9c 100644 --- a/src/main/java/com/songoda/epichoppers/commands/CommandBoost.java +++ b/src/main/java/com/songoda/epichoppers/commands/CommandBoost.java @@ -1,8 +1,8 @@ package com.songoda.epichoppers.commands; -import com.songoda.core.commands.AbstractCommand; -import com.songoda.core.utils.NumberUtils; -import com.songoda.core.utils.TimeUtils; +import com.craftaro.core.commands.AbstractCommand; +import com.craftaro.core.utils.NumberUtils; +import com.craftaro.core.utils.TimeUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.boost.BoostData; import org.bukkit.Bukkit; diff --git a/src/main/java/com/songoda/epichoppers/commands/CommandGive.java b/src/main/java/com/songoda/epichoppers/commands/CommandGive.java index 3784ae8..de89144 100644 --- a/src/main/java/com/songoda/epichoppers/commands/CommandGive.java +++ b/src/main/java/com/songoda/epichoppers/commands/CommandGive.java @@ -1,6 +1,6 @@ package com.songoda.epichoppers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.levels.Level; import org.bukkit.Bukkit; diff --git a/src/main/java/com/songoda/epichoppers/commands/CommandReload.java b/src/main/java/com/songoda/epichoppers/commands/CommandReload.java index 7211931..0a58dac 100644 --- a/src/main/java/com/songoda/epichoppers/commands/CommandReload.java +++ b/src/main/java/com/songoda/epichoppers/commands/CommandReload.java @@ -1,6 +1,6 @@ package com.songoda.epichoppers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epichoppers.EpicHoppers; import org.bukkit.command.CommandSender; diff --git a/src/main/java/com/songoda/epichoppers/commands/CommandSettings.java b/src/main/java/com/songoda/epichoppers/commands/CommandSettings.java index 079efde..8eeeb7b 100644 --- a/src/main/java/com/songoda/epichoppers/commands/CommandSettings.java +++ b/src/main/java/com/songoda/epichoppers/commands/CommandSettings.java @@ -1,7 +1,7 @@ package com.songoda.epichoppers.commands; -import com.songoda.core.commands.AbstractCommand; -import com.songoda.core.configuration.editor.PluginConfigGui; +import com.craftaro.core.commands.AbstractCommand; +import com.craftaro.core.configuration.editor.PluginConfigGui; import com.songoda.epichoppers.EpicHoppers; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epichoppers/database/DataManager.java b/src/main/java/com/songoda/epichoppers/database/DataManager.java index 6822a12..f1ad6b0 100644 --- a/src/main/java/com/songoda/epichoppers/database/DataManager.java +++ b/src/main/java/com/songoda/epichoppers/database/DataManager.java @@ -1,7 +1,7 @@ package com.songoda.epichoppers.database; -import com.songoda.core.database.DataManagerAbstract; -import com.songoda.core.database.DatabaseConnector; +import com.craftaro.core.database.DataManagerAbstract; +import com.craftaro.core.database.DatabaseConnector; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.boost.BoostData; import com.songoda.epichoppers.hopper.Filter; diff --git a/src/main/java/com/songoda/epichoppers/database/migrations/_1_InitialMigration.java b/src/main/java/com/songoda/epichoppers/database/migrations/_1_InitialMigration.java index 0788401..e6ad744 100644 --- a/src/main/java/com/songoda/epichoppers/database/migrations/_1_InitialMigration.java +++ b/src/main/java/com/songoda/epichoppers/database/migrations/_1_InitialMigration.java @@ -1,7 +1,7 @@ package com.songoda.epichoppers.database.migrations; -import com.songoda.core.database.DataMigration; -import com.songoda.core.database.MySQLConnector; +import com.craftaro.core.database.DataMigration; +import com.craftaro.core.database.MySQLConnector; import com.songoda.epichoppers.EpicHoppers; import java.sql.Connection; diff --git a/src/main/java/com/songoda/epichoppers/gui/GUIAutoSellFilter.java b/src/main/java/com/songoda/epichoppers/gui/GUIAutoSellFilter.java index e40d062..b4522fa 100644 --- a/src/main/java/com/songoda/epichoppers/gui/GUIAutoSellFilter.java +++ b/src/main/java/com/songoda/epichoppers/gui/GUIAutoSellFilter.java @@ -1,9 +1,9 @@ package com.songoda.epichoppers.gui; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.gui.CustomizableGui; -import com.songoda.core.gui.GuiUtils; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.gui.CustomizableGui; +import com.craftaro.core.gui.GuiUtils; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Filter; import com.songoda.epichoppers.hopper.Hopper; @@ -60,7 +60,7 @@ public class GUIAutoSellFilter extends CustomizableGui { mirrorFill("mirrorfill_8", 2, 8, true, false, glass2); mirrorFill("mirrorfill_9", 4, 7, false, false, glass1); - setButton("back", 8, GuiUtils.createButtonItem(CompatibleMaterial.ARROW.getItem(), + setButton("back", 8, GuiUtils.createButtonItem(XMaterial.ARROW.parseItem(), plugin.getLocale().getMessage("general.nametag.back").getMessage()), (event) -> { hopper.overview(this.guiManager, event.player); @@ -68,7 +68,7 @@ public class GUIAutoSellFilter extends CustomizableGui { }); // Whitelist - ItemStack indicatorItem = CompatibleMaterial.WHITE_STAINED_GLASS_PANE.getItem(); + ItemStack indicatorItem = XMaterial.WHITE_STAINED_GLASS_PANE.parseItem(); ItemMeta indicatorMeta = indicatorItem.getItemMeta(); indicatorMeta.setDisplayName(plugin.getLocale().getMessage("interface.autosell-filter.whitelist").getMessage()); indicatorItem.setItemMeta(indicatorMeta); @@ -88,7 +88,7 @@ public class GUIAutoSellFilter extends CustomizableGui { } // Blacklist - indicatorItem = CompatibleMaterial.BLACK_STAINED_GLASS_PANE.getItem(); + indicatorItem = XMaterial.BLACK_STAINED_GLASS_PANE.parseItem(); indicatorMeta = indicatorItem.getItemMeta(); indicatorMeta.setDisplayName(plugin.getLocale().getMessage("interface.autosell-filter.blacklist").getMessage()); indicatorItem.setItemMeta(indicatorMeta); @@ -108,7 +108,7 @@ public class GUIAutoSellFilter extends CustomizableGui { } // Info item - indicatorItem = new ItemStack(CompatibleMaterial.PAPER.getMaterial()); + indicatorItem = XMaterial.PAPER.parseItem(); indicatorMeta = indicatorItem.getItemMeta(); indicatorMeta.setDisplayName(plugin.getLocale().getMessage("interface.autosell-filter.infotitle").getMessage()); diff --git a/src/main/java/com/songoda/epichoppers/gui/GUICrafting.java b/src/main/java/com/songoda/epichoppers/gui/GUICrafting.java index 9ab8bb4..f4098f6 100644 --- a/src/main/java/com/songoda/epichoppers/gui/GUICrafting.java +++ b/src/main/java/com/songoda/epichoppers/gui/GUICrafting.java @@ -1,9 +1,9 @@ package com.songoda.epichoppers.gui; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.gui.CustomizableGui; -import com.songoda.core.gui.GuiUtils; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.gui.CustomizableGui; +import com.craftaro.core.gui.GuiUtils; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.hopper.levels.modules.ModuleAutoCrafting; @@ -35,7 +35,7 @@ public class GUICrafting extends CustomizableGui { mirrorFill("mirrorfill_4", 1, 0, false, true, glass2); mirrorFill("mirrorfill_5", 1, 1, false, true, glass3); - setButton("back", 8, GuiUtils.createButtonItem(CompatibleMaterial.ARROW.getItem(), + setButton("back", 8, GuiUtils.createButtonItem(XMaterial.ARROW.parseItem(), plugin.getLocale().getMessage("general.nametag.back").getMessage()), (event) -> { hopper.overview(this.guiManager, event.player); diff --git a/src/main/java/com/songoda/epichoppers/gui/GUIFilter.java b/src/main/java/com/songoda/epichoppers/gui/GUIFilter.java index 496c47c..a6cf827 100644 --- a/src/main/java/com/songoda/epichoppers/gui/GUIFilter.java +++ b/src/main/java/com/songoda/epichoppers/gui/GUIFilter.java @@ -1,9 +1,9 @@ package com.songoda.epichoppers.gui; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.gui.CustomizableGui; -import com.songoda.core.gui.GuiUtils; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.gui.CustomizableGui; +import com.craftaro.core.gui.GuiUtils; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Filter; import com.songoda.epichoppers.hopper.Hopper; @@ -59,12 +59,12 @@ public class GUIFilter extends CustomizableGui { mirrorFill("mirrorfill_7", 2, 7, true, false, glass1); mirrorFill("mirrorfill_8", 2, 8, true, false, glass2); - ItemStack it = CompatibleMaterial.WHITE_STAINED_GLASS_PANE.getItem(); + ItemStack it = XMaterial.WHITE_STAINED_GLASS_PANE.parseItem(); ItemMeta itm = it.getItemMeta(); itm.setDisplayName(plugin.getLocale().getMessage("interface.filter.whitelist").getMessage()); it.setItemMeta(itm); - setButton("back", 8, GuiUtils.createButtonItem(CompatibleMaterial.ARROW.getItem(), + setButton("back", 8, GuiUtils.createButtonItem(XMaterial.ARROW.parseItem(), plugin.getLocale().getMessage("general.nametag.back").getMessage()), (event) -> { hopper.overview(this.guiManager, event.player); @@ -86,7 +86,7 @@ public class GUIFilter extends CustomizableGui { num++; } - it = CompatibleMaterial.BLACK_STAINED_GLASS_PANE.getItem(); + it = XMaterial.BLACK_STAINED_GLASS_PANE.parseItem(); itm = it.getItemMeta(); itm.setDisplayName(plugin.getLocale().getMessage("interface.filter.blacklist").getMessage()); it.setItemMeta(itm); @@ -107,7 +107,7 @@ public class GUIFilter extends CustomizableGui { num++; } - it = new ItemStack(CompatibleMaterial.BARRIER.getMaterial()); + it = XMaterial.BARRIER.parseItem(); itm = it.getItemMeta(); itm.setDisplayName(plugin.getLocale().getMessage("interface.filter.void").getMessage()); it.setItemMeta(itm); @@ -127,7 +127,7 @@ public class GUIFilter extends CustomizableGui { num++; } - ItemStack itemInfo = new ItemStack(CompatibleMaterial.PAPER.getMaterial()); + ItemStack itemInfo = XMaterial.PAPER.parseItem(); ItemMeta itemMetaInfo = itemInfo.getItemMeta(); itemMetaInfo.setDisplayName(plugin.getLocale().getMessage("interface.filter.infotitle").getMessage()); ArrayList loreInfo = new ArrayList<>(); @@ -141,7 +141,7 @@ public class GUIFilter extends CustomizableGui { setItem("info", 16, itemInfo); - ItemStack hook = new ItemStack(CompatibleMaterial.TRIPWIRE_HOOK.getMaterial()); + ItemStack hook = XMaterial.TRIPWIRE_HOOK.parseItem(); ItemMeta hookMeta = hook.getItemMeta(); hookMeta.setDisplayName(plugin.getLocale().getMessage("interface.hopper.rejectsync").getMessage()); ArrayList loreHook = new ArrayList<>(); diff --git a/src/main/java/com/songoda/epichoppers/gui/GUIOverview.java b/src/main/java/com/songoda/epichoppers/gui/GUIOverview.java index 7280aaa..3c8c02b 100644 --- a/src/main/java/com/songoda/epichoppers/gui/GUIOverview.java +++ b/src/main/java/com/songoda/epichoppers/gui/GUIOverview.java @@ -1,12 +1,12 @@ package com.songoda.epichoppers.gui; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.compatibility.ServerVersion; -import com.songoda.core.gui.CustomizableGui; -import com.songoda.core.gui.GuiUtils; -import com.songoda.core.utils.NumberUtils; -import com.songoda.core.utils.TextUtils; -import com.songoda.core.utils.TimeUtils; +import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.gui.CustomizableGui; +import com.craftaro.core.gui.GuiUtils; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.NumberUtils; +import com.craftaro.core.utils.TextUtils; +import com.craftaro.core.utils.TimeUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.boost.BoostData; import com.songoda.epichoppers.hopper.Hopper; @@ -250,7 +250,7 @@ public class GUIOverview extends CustomizableGui { && level.getCostExperience() != -1 && this.player.hasPermission("EpicHoppers.Upgrade.XP")) { setButton("upgrade_xp", 1, 2, GuiUtils.createButtonItem( - Settings.XP_ICON.getMaterial(CompatibleMaterial.EXPERIENCE_BOTTLE), + Settings.XP_ICON.getMaterial(XMaterial.EXPERIENCE_BOTTLE), this.plugin.getLocale().getMessage("interface.hopper.upgradewithxp").getMessage(), nextLevel != null ? this.plugin.getLocale().getMessage("interface.hopper.upgradewithxplore") @@ -265,7 +265,7 @@ public class GUIOverview extends CustomizableGui { && level.getCostEconomy() != -1 && this.player.hasPermission("EpicHoppers.Upgrade.ECO")) { setButton("upgrade_economy", 1, 6, GuiUtils.createButtonItem( - Settings.ECO_ICON.getMaterial(CompatibleMaterial.SUNFLOWER), + Settings.ECO_ICON.getMaterial(XMaterial.SUNFLOWER), this.plugin.getLocale().getMessage("interface.hopper.upgradewitheconomy").getMessage(), nextLevel != null ? this.plugin.getLocale().getMessage("interface.hopper.upgradewitheconomylore") diff --git a/src/main/java/com/songoda/epichoppers/gui/GUISmeltable.java b/src/main/java/com/songoda/epichoppers/gui/GUISmeltable.java index e17bb05..eb649f4 100644 --- a/src/main/java/com/songoda/epichoppers/gui/GUISmeltable.java +++ b/src/main/java/com/songoda/epichoppers/gui/GUISmeltable.java @@ -1,9 +1,10 @@ package com.songoda.epichoppers.gui; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.gui.CustomizableGui; -import com.songoda.core.gui.GuiUtils; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.compatibility.CompatibleMaterial; +import com.craftaro.core.gui.CustomizableGui; +import com.craftaro.core.gui.GuiUtils; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.hopper.levels.modules.ModuleAutoSmelter; @@ -22,9 +23,9 @@ public class GUISmeltable extends CustomizableGui { private final int maxPages; private final ModuleAutoSmelter moduleAutoSmelter; - private static final List BURNABLES = Arrays - .stream(CompatibleMaterial.values()) - .filter(material -> material.getBurnResult() != null) + private static final List BURNABLES = Arrays + .stream(XMaterial.values()) + .filter(material -> CompatibleMaterial.getFurnaceResult(material) != null) .collect(Collectors.toList()); public GUISmeltable(ModuleAutoSmelter moduleAutoSmelter, EpicHoppers plugin, Hopper hopper) { @@ -61,11 +62,17 @@ public class GUISmeltable extends CustomizableGui { int smeltableIndex = this.page == 1 ? 0 : 32 * (this.page - 1); for (int i = 9; i < 45; i++) { - if (i == 9 || i == 17 || i == 44 || i == 36) continue; + if (i == 9 || i == 17 || i == 44 || i == 36) { + continue; + } + setItem(i, null); clearActions(i); - if (smeltableIndex >= (BURNABLES.size() - 1)) continue; - CompatibleMaterial burnable = BURNABLES.get(smeltableIndex); + if (smeltableIndex >= (BURNABLES.size() - 1)) { + continue; + } + + XMaterial burnable = BURNABLES.get(smeltableIndex); setButton(i, getItemStack(burnable, this.moduleAutoSmelter.isSmeltable(this.hopper, burnable)), (event) -> { this.moduleAutoSmelter.toggleSmeltable(this.hopper, burnable); setItem(event.slot, getItemStack(burnable, this.moduleAutoSmelter.isSmeltable(this.hopper, burnable))); @@ -75,7 +82,7 @@ public class GUISmeltable extends CustomizableGui { clearActions(51); if (this.page < this.maxPages) { - setButton("next", 51, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, + setButton("next", 51, GuiUtils.createButtonItem(XMaterial.ARROW, this.plugin.getLocale().getMessage("general.nametag.next").getMessage()), (event) -> { this.page++; @@ -85,7 +92,7 @@ public class GUISmeltable extends CustomizableGui { clearActions(47); if (this.page > 1) { - setButton("back", 47, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, + setButton("back", 47, GuiUtils.createButtonItem(XMaterial.ARROW, this.plugin.getLocale().getMessage("general.nametag.back").getMessage()), (event) -> { this.page--; @@ -93,16 +100,16 @@ public class GUISmeltable extends CustomizableGui { }); } - setButton("exit", 49, GuiUtils.createButtonItem(CompatibleMaterial.OAK_DOOR, + setButton("exit", 49, GuiUtils.createButtonItem(XMaterial.OAK_DOOR, this.plugin.getLocale().getMessage("general.nametag.exit").getMessage()), (event) -> this.hopper.overview(this.plugin.getGuiManager(), event.player)); } - public ItemStack getItemStack(CompatibleMaterial material, boolean enabled) { - ItemStack item = material.getItem(); + public ItemStack getItemStack(XMaterial material, boolean enabled) { + ItemStack item = material.parseItem(); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(TextUtils.formatText("&e" + material.name())); - meta.setLore(Arrays.asList(TextUtils.formatText(" &7-> &e" + material.getBurnResult().name()), + meta.setLore(Arrays.asList(TextUtils.formatText(" &7-> &e" + CompatibleMaterial.getFurnaceResult(material).getType().name()), TextUtils.formatText("&7Enabled: &6" + String.valueOf(enabled).toLowerCase() + "&7."), "", this.plugin.getLocale().getMessage("interface.hopper.toggle").getMessage())); diff --git a/src/main/java/com/songoda/epichoppers/hopper/Hopper.java b/src/main/java/com/songoda/epichoppers/hopper/Hopper.java index 536477b..da4d0a5 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/Hopper.java +++ b/src/main/java/com/songoda/epichoppers/hopper/Hopper.java @@ -1,10 +1,10 @@ package com.songoda.epichoppers.hopper; -import com.songoda.core.compatibility.CompatibleParticleHandler; -import com.songoda.core.compatibility.CompatibleSound; -import com.songoda.core.compatibility.ServerVersion; -import com.songoda.core.gui.GuiManager; -import com.songoda.core.hooks.EconomyManager; +import com.craftaro.core.compatibility.CompatibleParticleHandler; +import com.craftaro.core.compatibility.CompatibleSound; +import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.gui.GuiManager; +import com.craftaro.core.hooks.EconomyManager; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.api.events.HopperAccessEvent; import com.songoda.epichoppers.gui.GUIOverview; diff --git a/src/main/java/com/songoda/epichoppers/hopper/levels/LevelManager.java b/src/main/java/com/songoda/epichoppers/hopper/levels/LevelManager.java index f330257..6ad1dfe 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/levels/LevelManager.java +++ b/src/main/java/com/songoda/epichoppers/hopper/levels/LevelManager.java @@ -1,8 +1,8 @@ package com.songoda.epichoppers.hopper.levels; -import com.songoda.core.nms.NmsManager; -import com.songoda.core.nms.nbt.NBTCore; -import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem; +import com.craftaro.core.nms.NmsManager; +import com.craftaro.core.nms.nbt.NBTCore; +import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.songoda.epichoppers.hopper.levels.modules.Module; import org.bukkit.ChatColor; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/Module.java b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/Module.java index cfac017..fd5fc60 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/Module.java +++ b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/Module.java @@ -1,6 +1,6 @@ package com.songoda.epichoppers.hopper.levels.modules; -import com.songoda.core.configuration.Config; +import com.craftaro.core.configuration.Config; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.utils.Methods; diff --git a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoCrafting.java b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoCrafting.java index b67f1b3..aa5315f 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoCrafting.java +++ b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoCrafting.java @@ -1,7 +1,8 @@ package com.songoda.epichoppers.hopper.levels.modules; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.compatibility.CompatibleMaterial; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.gui.GUICrafting; import com.songoda.epichoppers.hopper.Hopper; @@ -187,9 +188,9 @@ public class ModuleAutoCrafting extends Module { @Override public ItemStack getGUIButton(Hopper hopper) { - ItemStack crafting = CompatibleMaterial.CRAFTING_TABLE.getItem(); - ItemMeta craftingmeta = crafting.getItemMeta(); - craftingmeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.craftingtitle") + ItemStack crafting = XMaterial.CRAFTING_TABLE.parseItem(); + ItemMeta craftingMeta = crafting.getItemMeta(); + craftingMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.craftingtitle") .getMessage()); ArrayList lorecrafting = new ArrayList<>(); String[] parts = this.plugin.getLocale().getMessage("interface.hopper.craftinglore") @@ -197,8 +198,8 @@ public class ModuleAutoCrafting extends Module { for (String line : parts) { lorecrafting.add(TextUtils.formatText(line)); } - craftingmeta.setLore(lorecrafting); - crafting.setItemMeta(craftingmeta); + craftingMeta.setLore(lorecrafting); + crafting.setItemMeta(craftingMeta); return crafting; } diff --git a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoSell.java b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoSell.java index e912314..770c815 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoSell.java +++ b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoSell.java @@ -1,9 +1,9 @@ package com.songoda.epichoppers.hopper.levels.modules; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.hooks.EconomyManager; -import com.songoda.core.utils.NumberUtils; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.hooks.EconomyManager; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.NumberUtils; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.gui.GUIAutoSellFilter; import com.songoda.epichoppers.hopper.Filter; @@ -109,7 +109,7 @@ public class ModuleAutoSell extends Module { ex.printStackTrace(); } } else { - value = Settings.AUTOSELL_PRICES.getStringList().stream().filter(line -> CompatibleMaterial.valueOf(line.split(",")[0]) == CompatibleMaterial.getMaterial(itemStack)).findFirst() + value = Settings.AUTOSELL_PRICES.getStringList().stream().filter(line -> XMaterial.valueOf(line.split(",")[0]).isSimilar(itemStack)).findFirst() .map(s -> Double.valueOf(s.split(",")[1])).orElse(0.0); } @@ -142,7 +142,7 @@ public class ModuleAutoSell extends Module { @Override public ItemStack getGUIButton(Hopper hopper) { - ItemStack sellItem = CompatibleMaterial.SUNFLOWER.getItem(); + ItemStack sellItem = XMaterial.SUNFLOWER.parseItem(); ItemMeta sellMeta = sellItem.getItemMeta(); sellMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.selltitle").getMessage()); diff --git a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoSmelter.java b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoSmelter.java index 8a747e4..1e95875 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoSmelter.java +++ b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleAutoSmelter.java @@ -1,7 +1,8 @@ package com.songoda.epichoppers.hopper.levels.modules; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.compatibility.CompatibleMaterial; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.gui.GUISmeltable; import com.songoda.epichoppers.hopper.Hopper; @@ -52,13 +53,14 @@ public class ModuleAutoSmelter extends Module { if (itemStack == null) { continue; } - CompatibleMaterial material = CompatibleMaterial.getMaterial(itemStack); + XMaterial material = CompatibleMaterial.getMaterial(itemStack.getType()).get(); if (!isSmeltable(hopper, material)) { continue; } - CompatibleMaterial result = CompatibleMaterial.getMaterial(itemStack).getBurnResult(); + XMaterial input = CompatibleMaterial.getMaterial(itemStack.getType()).get(); + ItemStack result = CompatibleMaterial.getFurnaceResult(input); - if (hopperCache.addItem(result.getItem())) { + if (hopperCache.addItem(result)) { if (itemStack.getAmount() == 1) { hopperCache.setItem(i, null); } else { @@ -78,9 +80,9 @@ public class ModuleAutoSmelter extends Module { @Override public ItemStack getGUIButton(Hopper hopper) { - ItemStack block = CompatibleMaterial.IRON_INGOT.getItem(); - ItemMeta blockmeta = block.getItemMeta(); - blockmeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.smelttitle").getMessage()); + ItemStack block = XMaterial.IRON_INGOT.parseItem(); + ItemMeta blockMeta = block.getItemMeta(); + blockMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.smelttitle").getMessage()); ArrayList loreBlock = new ArrayList<>(); String[] parts = this.plugin.getLocale().getMessage("interface.hopper.smeltlore") .processPlaceholder("timeleft", getTime(hopper) == -9999 ? "∞" : (int) Math.floor(getTime(hopper) / 20.0)) @@ -93,8 +95,8 @@ public class ModuleAutoSmelter extends Module { for (String line : parts) { loreBlock.add(TextUtils.formatText(line)); } - blockmeta.setLore(loreBlock); - block.setItemMeta(blockmeta); + blockMeta.setLore(loreBlock); + block.setItemMeta(blockMeta); return block; } @@ -114,9 +116,9 @@ public class ModuleAutoSmelter extends Module { } List blockedItems = new ArrayList<>(); - for (CompatibleMaterial material : CompatibleMaterial.values()) { - if (material.getBurnResult() != null && isSmeltable(hopper, material)) { - blockedItems.add(material.getMaterial()); + for (XMaterial material : XMaterial.values()) { + if (CompatibleMaterial.getFurnaceResult(material) != null && isSmeltable(hopper, material)) { + blockedItems.add(material.parseMaterial()); } } @@ -145,7 +147,7 @@ public class ModuleAutoSmelter extends Module { return ((int) obj) != -9999; } - public boolean isSmeltable(Hopper hopper, CompatibleMaterial material) { + public boolean isSmeltable(Hopper hopper, XMaterial material) { Object obj = getData(hopper, material.name()); if (obj == null) { return false; @@ -162,7 +164,7 @@ public class ModuleAutoSmelter extends Module { } } - public void toggleSmeltable(Hopper hopper, CompatibleMaterial material) { + public void toggleSmeltable(Hopper hopper, XMaterial material) { saveData(hopper, material.name(), !isSmeltable(hopper, material)); } } diff --git a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleBlockBreak.java b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleBlockBreak.java index 7b888ee..7b02459 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleBlockBreak.java +++ b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleBlockBreak.java @@ -1,7 +1,7 @@ package com.songoda.epichoppers.hopper.levels.modules; -import com.songoda.core.compatibility.ServerVersion; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.settings.Settings; diff --git a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleMobHopper.java b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleMobHopper.java index cda5121..7692fbd 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleMobHopper.java +++ b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleMobHopper.java @@ -1,6 +1,6 @@ package com.songoda.epichoppers.hopper.levels.modules; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.utils.StorageContainerCache; diff --git a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleSuction.java b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleSuction.java index de4d49c..205e4f7 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleSuction.java +++ b/src/main/java/com/songoda/epichoppers/hopper/levels/modules/ModuleSuction.java @@ -1,10 +1,10 @@ package com.songoda.epichoppers.hopper.levels.modules; import com.bgsoftware.wildstacker.api.WildStackerAPI; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.compatibility.CompatibleParticleHandler; -import com.songoda.core.locale.Locale; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.compatibility.CompatibleParticleHandler; +import com.craftaro.core.locale.Locale; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.settings.Settings; @@ -182,7 +182,7 @@ public class ModuleSuction extends Module { @Override public ItemStack getGUIButton(Hopper hopper) { Locale locale = this.plugin.getLocale(); - ItemStack item = CompatibleMaterial.CAULDRON.getItem(); + ItemStack item = XMaterial.CAULDRON.parseItem(); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(locale.getMessage("interface.hopper.suctiontitle").getMessage()); List lore = new ArrayList<>(); diff --git a/src/main/java/com/songoda/epichoppers/hopper/teleport/TeleportHandler.java b/src/main/java/com/songoda/epichoppers/hopper/teleport/TeleportHandler.java index 2e6333f..28530f0 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/teleport/TeleportHandler.java +++ b/src/main/java/com/songoda/epichoppers/hopper/teleport/TeleportHandler.java @@ -1,7 +1,7 @@ package com.songoda.epichoppers.hopper.teleport; -import com.songoda.core.compatibility.CompatibleSound; -import com.songoda.core.compatibility.ServerVersion; +import com.craftaro.core.compatibility.CompatibleSound; +import com.craftaro.core.compatibility.ServerVersion; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.settings.Settings; diff --git a/src/main/java/com/songoda/epichoppers/listeners/BlockListeners.java b/src/main/java/com/songoda/epichoppers/listeners/BlockListeners.java index 87a1247..caa2c09 100644 --- a/src/main/java/com/songoda/epichoppers/listeners/BlockListeners.java +++ b/src/main/java/com/songoda/epichoppers/listeners/BlockListeners.java @@ -1,6 +1,6 @@ package com.songoda.epichoppers.listeners; -import com.songoda.core.compatibility.ServerVersion; +import com.craftaro.core.compatibility.ServerVersion; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.api.events.HopperBreakEvent; import com.songoda.epichoppers.api.events.HopperPlaceEvent; diff --git a/src/main/java/com/songoda/epichoppers/listeners/HopperListeners.java b/src/main/java/com/songoda/epichoppers/listeners/HopperListeners.java index c1d5156..3a0d920 100644 --- a/src/main/java/com/songoda/epichoppers/listeners/HopperListeners.java +++ b/src/main/java/com/songoda/epichoppers/listeners/HopperListeners.java @@ -1,7 +1,7 @@ package com.songoda.epichoppers.listeners; -import com.songoda.core.compatibility.ServerVersion; -import com.songoda.core.nms.NmsManager; +import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.nms.NmsManager; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.hopper.levels.modules.Module; diff --git a/src/main/java/com/songoda/epichoppers/listeners/InteractListeners.java b/src/main/java/com/songoda/epichoppers/listeners/InteractListeners.java index 4b5b06e..fba3387 100644 --- a/src/main/java/com/songoda/epichoppers/listeners/InteractListeners.java +++ b/src/main/java/com/songoda/epichoppers/listeners/InteractListeners.java @@ -1,7 +1,7 @@ package com.songoda.epichoppers.listeners; -import com.songoda.core.hooks.ProtectionManager; -import com.songoda.core.hooks.WorldGuardHook; +import com.craftaro.core.hooks.ProtectionManager; +import com.craftaro.core.hooks.WorldGuardHook; import com.songoda.epichoppers.EpicHoppers; import com.songoda.epichoppers.hopper.Hopper; import com.songoda.epichoppers.hopper.teleport.TeleportTrigger; diff --git a/src/main/java/com/songoda/epichoppers/settings/Settings.java b/src/main/java/com/songoda/epichoppers/settings/Settings.java index bc54c22..aa38d89 100644 --- a/src/main/java/com/songoda/epichoppers/settings/Settings.java +++ b/src/main/java/com/songoda/epichoppers/settings/Settings.java @@ -1,9 +1,9 @@ package com.songoda.epichoppers.settings; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.configuration.Config; -import com.songoda.core.configuration.ConfigSetting; -import com.songoda.core.hooks.EconomyManager; +import com.craftaro.core.compatibility.CompatibleMaterial; +import com.craftaro.core.configuration.Config; +import com.craftaro.core.configuration.ConfigSetting; +import com.craftaro.core.hooks.EconomyManager; import com.songoda.epichoppers.EpicHoppers; import java.util.Arrays; @@ -132,13 +132,13 @@ public class Settings { // convert glass pane settings int color; if ((color = GLASS_TYPE_1.getInt(-1)) != -1) { - CONFIG.set(GLASS_TYPE_1.getKey(), CompatibleMaterial.getGlassPaneColor(color).name()); + CONFIG.set(GLASS_TYPE_1.getKey(), CompatibleMaterial.getGlassPaneForColor(color).name()); } if ((color = GLASS_TYPE_2.getInt(-1)) != -1) { - CONFIG.set(GLASS_TYPE_2.getKey(), CompatibleMaterial.getGlassPaneColor(color).name()); + CONFIG.set(GLASS_TYPE_2.getKey(), CompatibleMaterial.getGlassPaneForColor(color).name()); } if ((color = GLASS_TYPE_3.getInt(-1)) != -1) { - CONFIG.set(GLASS_TYPE_3.getKey(), CompatibleMaterial.getGlassPaneColor(color).name()); + CONFIG.set(GLASS_TYPE_3.getKey(), CompatibleMaterial.getGlassPaneForColor(color).name()); } // convert economy settings diff --git a/src/main/java/com/songoda/epichoppers/utils/Methods.java b/src/main/java/com/songoda/epichoppers/utils/Methods.java index fad8a2b..06fe40c 100644 --- a/src/main/java/com/songoda/epichoppers/utils/Methods.java +++ b/src/main/java/com/songoda/epichoppers/utils/Methods.java @@ -1,7 +1,7 @@ package com.songoda.epichoppers.utils; -import com.songoda.core.compatibility.ServerVersion; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.utils.TextUtils; import com.songoda.epichoppers.EpicHoppers; import org.bukkit.Bukkit; import org.bukkit.Location; diff --git a/src/main/java/com/songoda/epichoppers/utils/StorageContainerCache.java b/src/main/java/com/songoda/epichoppers/utils/StorageContainerCache.java index 133655c..ed735e7 100644 --- a/src/main/java/com/songoda/epichoppers/utils/StorageContainerCache.java +++ b/src/main/java/com/songoda/epichoppers/utils/StorageContainerCache.java @@ -1,8 +1,9 @@ package com.songoda.epichoppers.utils; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.compatibility.ServerVersion; -import com.songoda.core.nms.NmsManager; +import com.craftaro.core.compatibility.CompatibleMaterial; +import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.nms.Nms; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -109,7 +110,7 @@ public class StorageContainerCache { } } - NmsManager.getWorld().updateAdjacentComparators(e.getKey()); + Nms.getImplementations().getWorld().updateAdjacentComparators(e.getKey()); }); INVENTORY_CACHE.clear(); } @@ -260,9 +261,8 @@ public class StorageContainerCache { boolean[] check = null; // some destination containers have special conditions - switch (this.type.name()) { - case "BREWING_STAND": { - + switch (CompatibleMaterial.getMaterial(this.type).orElse(XMaterial.AIR)) { + case BREWING_STAND: { // first compile a list of what slots to check check = new boolean[5]; String typeStr = item.getType().name().toUpperCase(); @@ -273,20 +273,19 @@ public class StorageContainerCache { // fuel in 5th position, input in 4th if (item.getType() == Material.BLAZE_POWDER) { check[4] = true; - } else if (CompatibleMaterial.getMaterial(item).isBrewingStandIngredient()) { + } else if (CompatibleMaterial.isBrewingStandIngredient(CompatibleMaterial.getMaterial(item.getType()).get())) { check[3] = true; } break; } - case "SMOKER": - case "BLAST_FURNACE": - case "BURNING_FURNACE": - case "FURNACE": { + case SMOKER: + case BLAST_FURNACE: + case FURNACE: { check = new boolean[3]; - boolean isFuel = !item.getType().name().contains("LOG") && CompatibleMaterial.getMaterial(item.getType()).isFuel(); + boolean isFuel = !item.getType().name().contains("LOG") && CompatibleMaterial.isFurnaceFuel(CompatibleMaterial.getMaterial(item.getType()).get()); // fuel is 2nd slot, input is first if (isFuel) { check[1] = true; @@ -296,6 +295,7 @@ public class StorageContainerCache { break; } + default: break; }