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

add a new tag for luck multiplier

This commit is contained in:
ybw0014 2021-08-03 18:26:34 +08:00
parent 7021df8a54
commit bced5ba4b1
3 changed files with 14 additions and 5 deletions

View File

@ -15,7 +15,6 @@ import org.bukkit.event.inventory.FurnaceSmeltEvent;
import org.bukkit.inventory.FurnaceInventory;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.EnhancedFurnace;
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;
@ -69,9 +68,7 @@ public class EnhancedFurnaceListener implements Listener {
if (state instanceof Furnace) {
FurnaceInventory inventory = ((Furnace) state).getInventory();
Material smelting = inventory.getSmelting().getType();
boolean multiplier = SlimefunTag.ORES.isTagged(smelting) || SlimefunTag.RAW_METALS.isTagged(smelting);
boolean multiplier = SlimefunTag.LUCK_MULTIPLIER_MATERIALS.isTagged(inventory.getSmelting().getType());
int amount = multiplier ? ((EnhancedFurnace) sfItem).getRandomOutputAmount() : 1;
Optional<ItemStack> result = SlimefunPlugin.getMinecraftRecipeService().getFurnaceOutput(inventory.getSmelting());

View File

@ -21,6 +21,7 @@ import org.bukkit.block.data.Waterlogged;
import io.github.thebusybiscuit.slimefun4.api.exceptions.TagMisconfigurationException;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.BlockPlacer;
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.EnhancedFurnace;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.accelerators.CropGrowthAccelerator;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.talismans.Talisman;
import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.miner.IndustrialMiner;
@ -235,7 +236,12 @@ public enum SlimefunTag implements Tag<Material> {
/**
* All materials (ores) which trigger the Talisman of the Caveman.
*/
CAVEMAN_TALISMAN_TRIGGERS;
CAVEMAN_TALISMAN_TRIGGERS,
/**
* All materials which benefit from the luck multiplier of {@link EnhancedFurnace}
*/
LUCK_MULTIPLIER_MATERIALS;
/**
* Lookup table for tag names.

View File

@ -0,0 +1,6 @@
{
"values" : [
"#slimefun:ores",
"#slimefun:raw_metals"
]
}