From 9dc7e4f916676394e39501bd666032e770a7a804 Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Tue, 17 Jan 2023 09:09:57 +0100 Subject: [PATCH 1/7] This has been requested a lot --- .../dev/j3fftw/litexpansion/ItemSetup.java | 2 + .../java/dev/j3fftw/litexpansion/Items.java | 6 ++ .../litexpansion/machine/Converter.java | 73 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 src/main/java/dev/j3fftw/litexpansion/machine/Converter.java diff --git a/src/main/java/dev/j3fftw/litexpansion/ItemSetup.java b/src/main/java/dev/j3fftw/litexpansion/ItemSetup.java index 86196276..9f7d0c51 100644 --- a/src/main/java/dev/j3fftw/litexpansion/ItemSetup.java +++ b/src/main/java/dev/j3fftw/litexpansion/ItemSetup.java @@ -9,6 +9,7 @@ import dev.j3fftw.litexpansion.items.MagThor; import dev.j3fftw.litexpansion.items.MiningDrill; import dev.j3fftw.litexpansion.items.Thorium; +import dev.j3fftw.litexpansion.machine.Converter; import dev.j3fftw.litexpansion.machine.Macerator; import dev.j3fftw.litexpansion.machine.MassFabricator; import dev.j3fftw.litexpansion.machine.MultiFunctionalElectricStorageUnit; @@ -83,6 +84,7 @@ private void registerMachines() { new ManualMill().register(plugin); new Macerator().register(plugin); new UUCrafter().register(plugin); + new Converter().register(plugin); } //Disable when SlimyTreeTaps exists diff --git a/src/main/java/dev/j3fftw/litexpansion/Items.java b/src/main/java/dev/j3fftw/litexpansion/Items.java index e4d5b04a..852ee2e4 100644 --- a/src/main/java/dev/j3fftw/litexpansion/Items.java +++ b/src/main/java/dev/j3fftw/litexpansion/Items.java @@ -545,6 +545,12 @@ public final class Items { "&7UU Crafter" ); + public static final SlimefunItemStack CONVERTER = new SlimefunItemStack( + "CONVER", + Material.COAL_BLOCK, + "&7Converter" + ); + private static final Enchantment glowEnchant = Enchantment.getByKey(Constants.GLOW_ENCHANT); static { diff --git a/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java new file mode 100644 index 00000000..91a1e70a --- /dev/null +++ b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java @@ -0,0 +1,73 @@ +package dev.j3fftw.litexpansion.machine; + +import dev.j3fftw.litexpansion.Items; +import dev.j3fftw.litexpansion.machine.api.PoweredMachine; +import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; +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() { + addRecipe(new ItemStack(Material.COPPER_INGOT), new ItemStack(SlimefunItems.COPPER_INGOT)); + addRecipe(new ItemStack(SlimefunItems.COPPER_INGOT), new ItemStack(Material.COPPER_INGOT)); + } + + 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 "&6Macerator"; + } + + @Nonnull + @Override + public String getMachineIdentifier() { + return "MACERATOR"; + } + + @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; + } + +} From cae538f522fe208028418631fb09424684dc76a7 Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Tue, 17 Jan 2023 09:10:45 +0100 Subject: [PATCH 2/7] whoops --- src/main/java/dev/j3fftw/litexpansion/machine/Converter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java index 91a1e70a..08fc6512 100644 --- a/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java +++ b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java @@ -41,13 +41,13 @@ public ItemStack getProgressBar() { @Nonnull @Override public String getInventoryTitle() { - return "&6Macerator"; + return "&6Converter"; } @Nonnull @Override public String getMachineIdentifier() { - return "MACERATOR"; + return "CONVERTER"; } @Override From a2090579a36a55563d110071e7a8bc6417c7b9ed Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Tue, 17 Jan 2023 09:11:13 +0100 Subject: [PATCH 3/7] This has been requested a lot From 0df22a3605aa8e8bd24b6de9d47f85e160add4d1 Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Thu, 19 Jan 2023 08:43:20 +0100 Subject: [PATCH 4/7] converter is now useless for 1.17 --- .../java/dev/j3fftw/litexpansion/machine/Converter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java index 08fc6512..46d004d3 100644 --- a/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java +++ b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java @@ -2,7 +2,9 @@ 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; @@ -25,8 +27,11 @@ public Converter() { @Override protected void registerDefaultRecipes() { - addRecipe(new ItemStack(Material.COPPER_INGOT), new ItemStack(SlimefunItems.COPPER_INGOT)); - addRecipe(new ItemStack(SlimefunItems.COPPER_INGOT), new ItemStack(Material.COPPER_INGOT)); + 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)); + } + } private void addRecipe(ItemStack input, ItemStack output) { From cfc8cd1ea83dfd2784c53578c0a26548870a2dec Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Sat, 21 Jan 2023 14:34:04 +0100 Subject: [PATCH 5/7] dropped support for 1.14 and 1.15 --- pom.xml | 2 +- src/main/java/dev/j3fftw/litexpansion/ItemSetup.java | 10 +++------- src/main/resources/plugin.yml | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 565d0e8c..912ec2eb 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ com.github.Slimefun Slimefun4 - 2c4f886fe4 + RC-33 provided diff --git a/src/main/java/dev/j3fftw/litexpansion/ItemSetup.java b/src/main/java/dev/j3fftw/litexpansion/ItemSetup.java index 9f7d0c51..52f0bfb2 100644 --- a/src/main/java/dev/j3fftw/litexpansion/ItemSetup.java +++ b/src/main/java/dev/j3fftw/litexpansion/ItemSetup.java @@ -224,13 +224,9 @@ Items.TIN_ITEM_CASING, new ItemStack(Material.REDSTONE), Items.TIN_ITEM_CASING RecipeType.SMELTERY.register(new ItemStack[] {Items.QUARTZ_DUST}, new ItemStack(Material.QUARTZ) ); - - // 1.16 - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - RecipeType.SMELTERY.register(new ItemStack[] {Items.ANCIENT_DEBRIS_DUST}, - new ItemStack(Material.NETHERITE_INGOT) - ); - } + RecipeType.SMELTERY.register(new ItemStack[] {Items.ANCIENT_DEBRIS_DUST}, + new ItemStack(Material.NETHERITE_INGOT) + ); // Resources new MagThor().register(plugin); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index b8d1cc0f..be562278 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: LiteXpansion description: Description version: ${project.version} -api-version: 1.14 +api-version: 1.16 author: j3fftw depend: [Slimefun] softdepend: [SlimyTreeTaps] From c0cb079e00cb753f08c971e7eafea8ac1f92c65c Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Tue, 31 Jan 2023 18:31:17 +0100 Subject: [PATCH 6/7] Gold Gold Gold a lot of gold --- .../dev/j3fftw/litexpansion/machine/Converter.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java index 46d004d3..03ce54d5 100644 --- a/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java +++ b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java @@ -32,6 +32,18 @@ protected void registerDefaultRecipes() { 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) { From 95150d0edd8bb79183d93b1efdf89edab23e5164 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Wed, 8 Feb 2023 16:44:16 -0500 Subject: [PATCH 7/7] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=B1=89=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/dev/j3fftw/litexpansion/Items.java | 2 +- src/main/java/dev/j3fftw/litexpansion/machine/Converter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/j3fftw/litexpansion/Items.java b/src/main/java/dev/j3fftw/litexpansion/Items.java index db245ad4..579ad579 100644 --- a/src/main/java/dev/j3fftw/litexpansion/Items.java +++ b/src/main/java/dev/j3fftw/litexpansion/Items.java @@ -552,7 +552,7 @@ public final class Items { public static final SlimefunItemStack CONVERTER = new SlimefunItemStack( "CONVER", Material.COAL_BLOCK, - "&7Converter" + "&7转换机" ); private static final Enchantment glowEnchant = Enchantment.getByKey(Constants.GLOW_ENCHANT); diff --git a/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java index 03ce54d5..c606eda7 100644 --- a/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java +++ b/src/main/java/dev/j3fftw/litexpansion/machine/Converter.java @@ -58,7 +58,7 @@ public ItemStack getProgressBar() { @Nonnull @Override public String getInventoryTitle() { - return "&6Converter"; + return "&6转换机"; } @Nonnull