mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Merge pull request #3192 from guizhanss/feature/raw-metals-luck-multiplier
Add Enhanced furnaces' luck multiplier for raw ores in 1.17, resolves #3190
This commit is contained in:
commit
0df4694a63
@ -17,6 +17,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.EnhancedFurnace;
|
||||
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;
|
||||
import io.papermc.lib.PaperLib;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
||||
import me.mrCookieSlime.Slimefun.api.BlockStorage;
|
||||
@ -67,7 +68,8 @@ public class EnhancedFurnaceListener implements Listener {
|
||||
|
||||
if (state instanceof Furnace) {
|
||||
FurnaceInventory inventory = ((Furnace) state).getInventory();
|
||||
int amount = inventory.getSmelting().getType().toString().endsWith("_ORE") ? ((EnhancedFurnace) sfItem).getRandomOutputAmount() : 1;
|
||||
boolean multiplier = SlimefunTag.ENHANCED_FURNACE_LUCK_MATERIALS.isTagged(inventory.getSmelting().getType());
|
||||
int amount = multiplier ? ((EnhancedFurnace) sfItem).getRandomOutputAmount() : 1;
|
||||
Optional<ItemStack> result = SlimefunPlugin.getMinecraftRecipeService().getFurnaceOutput(inventory.getSmelting());
|
||||
|
||||
if (result.isPresent()) {
|
||||
|
@ -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;
|
||||
@ -64,6 +65,11 @@ public enum SlimefunTag implements Tag<Material> {
|
||||
*/
|
||||
NETHER_ORES,
|
||||
|
||||
/**
|
||||
* All raw metals in 1.17+
|
||||
*/
|
||||
RAW_METALS,
|
||||
|
||||
/**
|
||||
* All Shulker boxes, normal and colored.
|
||||
*/
|
||||
@ -230,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}
|
||||
*/
|
||||
ENHANCED_FURNACE_LUCK_MATERIALS;
|
||||
|
||||
/**
|
||||
* Lookup table for tag names.
|
||||
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"values" : [
|
||||
"#slimefun:ores",
|
||||
"#slimefun:raw_metals"
|
||||
]
|
||||
}
|
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