diff --git a/pom.xml b/pom.xml index c8acbb9..3d50ff2 100644 --- a/pom.xml +++ b/pom.xml @@ -136,5 +136,12 @@ 14b651fce2 provided + + + com.github.VoperAD + SlimeFrame + 8af2379a01 + provided + diff --git a/src/main/java/net/guizhanss/fastmachines/core/services/IntegrationService.java b/src/main/java/net/guizhanss/fastmachines/core/services/IntegrationService.java index 9e70dbd..c10beb4 100644 --- a/src/main/java/net/guizhanss/fastmachines/core/services/IntegrationService.java +++ b/src/main/java/net/guizhanss/fastmachines/core/services/IntegrationService.java @@ -14,6 +14,11 @@ public IntegrationService(FastMachines plugin) { Items.setupIE(plugin); Researches.setupIE(); } + + if (isEnabled("SlimeFrame")) { + Items.setupSFrame(plugin); + Researches.setupSFrame(); + } } private boolean isEnabled(String pluginName) { diff --git a/src/main/java/net/guizhanss/fastmachines/items/FastMachinesItems.java b/src/main/java/net/guizhanss/fastmachines/items/FastMachinesItems.java index 27f6223..9580da2 100644 --- a/src/main/java/net/guizhanss/fastmachines/items/FastMachinesItems.java +++ b/src/main/java/net/guizhanss/fastmachines/items/FastMachinesItems.java @@ -87,5 +87,10 @@ public final class FastMachinesItems { "FAST_INFINITY_WORKBENCH", Material.RESPAWN_ANCHOR ); + + public static final SlimefunItemStack FAST_SLIMEFRAME_FOUNDRY = FastMachines.getLocalization().getItem( + "FAST_SLIMEFRAME_FOUNDRY", + Material.ANVIL + ); // } diff --git a/src/main/java/net/guizhanss/fastmachines/items/machines/slimeframe/FastSlimeFrameFoundry.java b/src/main/java/net/guizhanss/fastmachines/items/machines/slimeframe/FastSlimeFrameFoundry.java new file mode 100644 index 0000000..a9869df --- /dev/null +++ b/src/main/java/net/guizhanss/fastmachines/items/machines/slimeframe/FastSlimeFrameFoundry.java @@ -0,0 +1,34 @@ +package net.guizhanss.fastmachines.items.machines.slimeframe; + +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; + +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; +import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; + +import me.voper.slimeframe.implementation.SFrameStacks; + +import net.guizhanss.fastmachines.FastMachines; +import net.guizhanss.fastmachines.items.machines.abstracts.AFastMachine; +import net.guizhanss.fastmachines.utils.RecipeUtils; + +public class FastSlimeFrameFoundry extends AFastMachine { + + private static final ItemStack CRAFT_ITEM = FastMachines.getLocalization().getItem( + "CRAFT", Material.ANVIL); + + public FastSlimeFrameFoundry(SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(item, recipeType, recipe); + } + + @Override + protected void registerRecipes() { + FastMachines.debug("Registering recipes for {0}", getClass().getSimpleName()); + RecipeUtils.registerMultiblockMachineRecipes(recipes, SFrameStacks.FOUNDRY.getItemId()); + } + + @Override + protected ItemStack getCraftItem() { + return CRAFT_ITEM; + } +} diff --git a/src/main/java/net/guizhanss/fastmachines/setup/Items.java b/src/main/java/net/guizhanss/fastmachines/setup/Items.java index 6abe46f..a969042 100644 --- a/src/main/java/net/guizhanss/fastmachines/setup/Items.java +++ b/src/main/java/net/guizhanss/fastmachines/setup/Items.java @@ -13,6 +13,7 @@ import net.guizhanss.fastmachines.FastMachines; import net.guizhanss.fastmachines.items.FastMachinesItems; import net.guizhanss.fastmachines.items.machines.infinityexpansion.FastInfinityWorkbench; +import net.guizhanss.fastmachines.items.machines.slimeframe.FastSlimeFrameFoundry; import net.guizhanss.fastmachines.items.machines.slimefun.FastArmorForge; import net.guizhanss.fastmachines.items.machines.slimefun.FastComposter; import net.guizhanss.fastmachines.items.machines.slimefun.FastCompressor; @@ -140,6 +141,17 @@ SlimefunItems.OUTPUT_CHEST, getSf("INFINITY_FORGE"), fastCore }).register(plugin); } + public static void setupSFrame(FastMachines plugin) { + ItemStack fastCore = FastMachines.getAddonConfig().getBoolean("fast-machines.use-energy", true) ? + FastMachinesItems.FAST_CORE : null; + + new FastSlimeFrameFoundry(FastMachinesItems.FAST_SLIMEFRAME_FOUNDRY, RecipeType.MAGIC_WORKBENCH, new ItemStack[] { + null, null, null, + new ItemStack(Material.STONECUTTER), new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.STONECUTTER), + SlimefunItems.OUTPUT_CHEST, new ItemStack(Material.DISPENSER), fastCore + }).register(plugin); + } + @Nullable private static ItemStack getSf(@Nonnull String id) { var sfItem = SlimefunItem.getById(id); diff --git a/src/main/java/net/guizhanss/fastmachines/setup/Researches.java b/src/main/java/net/guizhanss/fastmachines/setup/Researches.java index cc9d651..314eb62 100644 --- a/src/main/java/net/guizhanss/fastmachines/setup/Researches.java +++ b/src/main/java/net/guizhanss/fastmachines/setup/Researches.java @@ -58,6 +58,12 @@ public static void setupIE() { ); } + public static void setupSFrame() { + MACHINES.addItems( + FastMachinesItems.FAST_SLIMEFRAME_FOUNDRY + ); + } + public static void register() { MACHINES.register(); MATERIALS.register(); diff --git a/src/main/resources/lang/en-US.yml b/src/main/resources/lang/en-US.yml index 89693a1..4e2e99a 100644 --- a/src/main/resources/lang/en-US.yml +++ b/src/main/resources/lang/en-US.yml @@ -141,6 +141,11 @@ items: lore: - "&7More useful Infinity Workbench." - "&7Craft without need to put items in order." + FAST_SLIMEFRAME_FOUNDRY: + name: "&aFast SlimeFrame Foundry" + lore: + - "&7More useful SlimeFrame Foundry." + - "&7Craft without need to put items in order." lores: per-craft: " &7per craft" diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 68cc6c8..c7265b6 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -7,5 +7,6 @@ depend: softdepend: - GuizhanLibPlugin - InfinityExpansion + - SlimeFrame authors: [ ybw0014 ] description: A Slimefun Addon that adds better basic machines.