Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add SlimeFrame fast foundry #26

Merged
merged 2 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,12 @@
<version>14b651fce2</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.github.VoperAD</groupId>
<artifactId>SlimeFrame</artifactId>
<version>8af2379a01</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
// </editor-fold>
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
12 changes: 12 additions & 0 deletions src/main/java/net/guizhanss/fastmachines/setup/Items.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/lang/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ depend:
softdepend:
- GuizhanLibPlugin
- InfinityExpansion
- SlimeFrame
authors: [ ybw0014 ]
description: A Slimefun Addon that adds better basic machines.