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:
parent
7021df8a54
commit
bced5ba4b1
@ -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());
|
||||
|
||||
|
@ -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.
|
||||
|
6
src/main/resources/tags/luck_multiplier_materials.json
Normal file
6
src/main/resources/tags/luck_multiplier_materials.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"values" : [
|
||||
"#slimefun:ores",
|
||||
"#slimefun:raw_metals"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user