1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

use slimefun tag

This commit is contained in:
ybw0014 2021-08-02 12:20:13 +08:00
parent 33ce8ecff6
commit dfd6d372cd
3 changed files with 25 additions and 2 deletions

View File

@ -18,6 +18,7 @@ import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.EnhancedFurnace; import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.EnhancedFurnace;
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;
import io.papermc.lib.PaperLib; import io.papermc.lib.PaperLib;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.BlockStorage;
@ -68,10 +69,11 @@ public class EnhancedFurnaceListener implements Listener {
if (state instanceof Furnace) { if (state instanceof Furnace) {
FurnaceInventory inventory = ((Furnace) state).getInventory(); FurnaceInventory inventory = ((Furnace) state).getInventory();
Material smelting = inventory.getSmelting().getType();
boolean multiplier = SlimefunTag.ORES.isTagged(smelting);
boolean multiplier = inventory.getSmelting().getType().toString().endsWith("_ORE");
// In 1.17, the raw ores should benefit from luck multiplier // In 1.17, the raw ores should benefit from luck multiplier
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17) && inventory.getSmelting().getType().toString().startsWith("RAW_")) { if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17) && SlimefunTag.RAW_METALS.isTagged(smelting)) {
multiplier = true; multiplier = true;
} }

View File

@ -64,6 +64,11 @@ public enum SlimefunTag implements Tag<Material> {
*/ */
NETHER_ORES, NETHER_ORES,
/**
* All raw metals in 1.17+
*/
RAW_METALS,
/** /**
* All Shulker boxes, normal and colored. * All Shulker boxes, normal and colored.
*/ */

View File

@ -0,0 +1,16 @@
{
"values" : [
{
"id" : "minecraft:raw_iron",
"required" : false
},
{
"id" : "minecraft:raw_gold",
"required" : false
},
{
"id" : "minecraft:raw_copper",
"required" : false
}
]
}