forked from Slimefun-Addon-Community/LiteXpansion
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'SlimefunGuguProject:master' into master
- Loading branch information
Showing
5 changed files
with
103 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/main/java/dev/j3fftw/litexpansion/machine/Converter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package dev.j3fftw.litexpansion.machine; | ||
|
||
import dev.j3fftw.litexpansion.Items; | ||
import dev.j3fftw.litexpansion.machine.api.PoweredMachine; | ||
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; | ||
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; | ||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; | ||
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; | ||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; | ||
import org.bukkit.Material; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class Converter extends AContainer implements PoweredMachine { | ||
|
||
public static final int TIME = 5; | ||
|
||
public Converter() { | ||
super(Items.LITEXPANSION, Items.CONVERTER, RecipeType.ENHANCED_CRAFTING_TABLE, | ||
new ItemStack[] { | ||
new ItemStack(Material.REDSTONE), new ItemStack(Material.REDSTONE), new ItemStack(Material.REDSTONE), | ||
new ItemStack(Material.COBBLESTONE), Items.ADVANCED_MACHINE_BLOCK, new ItemStack(Material.COBBLESTONE), | ||
null, Items.ADVANCED_CIRCUIT, null | ||
}); | ||
} | ||
|
||
@Override | ||
protected void registerDefaultRecipes() { | ||
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { | ||
addRecipe(new ItemStack(Material.COPPER_INGOT), new ItemStack(SlimefunItems.COPPER_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.COPPER_INGOT), new ItemStack(Material.COPPER_INGOT)); | ||
} | ||
|
||
addRecipe(new ItemStack(Material.GOLD_INGOT), new ItemStack(SlimefunItems.GOLD_4K)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_4K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_6K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_8K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_10K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_12K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_14K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_16K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_20K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_22K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_24K), new ItemStack(Material.GOLD_INGOT)); | ||
addRecipe(new ItemStack(SlimefunItems.GOLD_24K_BLOCK), new ItemStack(Material.GOLD_BLOCK)); | ||
} | ||
|
||
private void addRecipe(ItemStack input, ItemStack output) { | ||
registerRecipe(Converter.TIME, new ItemStack[] {input}, new ItemStack[] {output}); | ||
} | ||
|
||
@Override | ||
public ItemStack getProgressBar() { | ||
return new ItemStack(Material.FIRE_CHARGE); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getInventoryTitle() { | ||
return "&6转换机"; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getMachineIdentifier() { | ||
return "CONVERTER"; | ||
} | ||
|
||
@Override | ||
public int getCapacity() { | ||
return getDefaultEnergyConsumption() * 5; | ||
} | ||
|
||
@Override | ||
public int getDefaultEnergyConsumption() { | ||
return 20_000 / 26; | ||
} | ||
|
||
@Override | ||
public int getEnergyConsumption() { | ||
return this.getFinalEnergyConsumption(); | ||
} | ||
|
||
@Override | ||
public int getSpeed() { | ||
return 1; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters