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:
parent
33ce8ecff6
commit
dfd6d372cd
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
||||||
*/
|
*/
|
||||||
|
16
src/main/resources/tags/raw_metals.json
Normal file
16
src/main/resources/tags/raw_metals.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"values" : [
|
||||||
|
{
|
||||||
|
"id" : "minecraft:raw_iron",
|
||||||
|
"required" : false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id" : "minecraft:raw_gold",
|
||||||
|
"required" : false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id" : "minecraft:raw_copper",
|
||||||
|
"required" : false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user