From 330470b9cddb7ffe1420709e01068146698c54d4 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd Date: Tue, 30 Nov 2021 09:55:34 -0800 Subject: [PATCH 001/146] register filled flask of knowledge and add respective RecipeType --- .../thebusybiscuit/slimefun4/api/recipes/RecipeType.java | 1 + .../slimefun4/implementation/setup/SlimefunItemSetup.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java index 828c78ddb..9fc0256f9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java @@ -56,6 +56,7 @@ public class RecipeType implements Keyed { public static final RecipeType MOB_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "mob_drop"), new CustomItemStack(Material.IRON_SWORD, "&bMob Drop"), RecipeType::registerMobDrop, "", "&rKill the specified Mob to obtain this Item"); public static final RecipeType BARTER_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "barter_drop"), new CustomItemStack(Material.GOLD_INGOT, "&bBarter Drop"), RecipeType::registerBarterDrop, "&aBarter with piglins for a chance", "&ato obtain this item"); + public static final RecipeType INTERACT = new RecipeType(new NamespacedKey(Slimefun.instance(), "interact"), new CustomItemStack(Material.PLAYER_HEAD, "&bInteract", "", "&a&oRight click with this item")); public static final RecipeType HEATED_PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(Slimefun.instance(), "heated_pressure_chamber"), SlimefunItems.HEATED_PRESSURE_CHAMBER); public static final RecipeType FOOD_FABRICATOR = new RecipeType(new NamespacedKey(Slimefun.instance(), "food_fabricator"), SlimefunItems.FOOD_FABRICATOR); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 8f5f86ceb..eb8dd69e8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -1365,6 +1365,11 @@ public final class SlimefunItemSetup { new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) .register(plugin); + SlimefunItem filledFlask = new SlimefunItem(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, + new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, null, null, null, null, null, null, null, null}); + filledFlask.setHidden(false); + filledFlask.register(plugin); + new BirthdayCake(categories.birthday, new SlimefunItemStack("BIRTHDAY_CAKE", Material.CAKE, "&bBirthday Cake"), RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null}) .register(plugin); From e6d0584ced77a6c8e476b7639cb1756bde28aee7 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd Date: Tue, 30 Nov 2021 20:00:55 -0800 Subject: [PATCH 002/146] make filled flask nonconfigurable --- .../items/magical/FilledKnowledgeFlask.java | 21 +++++++++++++++++++ .../setup/SlimefunItemSetup.java | 8 +++---- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java new file mode 100644 index 000000000..8db5ba24f --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java @@ -0,0 +1,21 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.magical; + +import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; +import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; +import io.github.thebusybiscuit.slimefun4.core.attributes.NotConfigurable; + +import javax.annotation.ParametersAreNonnullByDefault; + +import org.bukkit.inventory.ItemStack; + +public class FilledKnowledgeFlask extends SlimefunItem implements NotConfigurable { + + @ParametersAreNonnullByDefault + public FilledKnowledgeFlask(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(itemGroup, item, recipeType, recipe); + this.setHidden(true); + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index eb8dd69e8..3d3d09522 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -137,6 +137,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSControlPan import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSMarkerTool; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSTransmitter; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.BeeWings; +import io.github.thebusybiscuit.slimefun4.implementation.items.magical.FilledKnowledgeFlask; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfernalBonemeal; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedHopper; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedMagnet; @@ -1365,10 +1366,9 @@ public final class SlimefunItemSetup { new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) .register(plugin); - SlimefunItem filledFlask = new SlimefunItem(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, - new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, null, null, null, null, null, null, null, null}); - filledFlask.setHidden(false); - filledFlask.register(plugin); + new FilledKnowledgeFlask(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, + new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, null, null, null, null, null, null, null, null}) + .register(plugin); new BirthdayCake(categories.birthday, new SlimefunItemStack("BIRTHDAY_CAKE", Material.CAKE, "&bBirthday Cake"), RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null}) From 4bb2bc8f26745a4ab65285e406f874ed3d8e4341 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd Date: Tue, 30 Nov 2021 20:19:57 -0800 Subject: [PATCH 003/146] documentation sure --- .../implementation/items/magical/FilledKnowledgeFlask.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java index 8db5ba24f..1c0882b7c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java @@ -10,6 +10,13 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.inventory.ItemStack; +/** + * The {@link FilledKnowledgeFlask} is a {@link NotConfigurable} {@link SlimefunItem} + * that results from interacting with a {@link KnowledgeFlask}. + * + * @see KnowledgeFlask + * + */ public class FilledKnowledgeFlask extends SlimefunItem implements NotConfigurable { @ParametersAreNonnullByDefault From 9d388445c115eacd8cd16fc10de7f688b86876bb Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd Date: Thu, 2 Dec 2021 10:10:29 -0800 Subject: [PATCH 004/146] generalize filled flask to hidden item --- .../FilledKnowledgeFlask.java => HiddenItem.java} | 12 +++++------- .../implementation/setup/SlimefunItemSetup.java | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) rename src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/{magical/FilledKnowledgeFlask.java => HiddenItem.java} (55%) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java similarity index 55% rename from src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index 1c0882b7c..a021ed5b7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -1,4 +1,4 @@ -package io.github.thebusybiscuit.slimefun4.implementation.items.magical; +package io.github.thebusybiscuit.slimefun4.implementation.items; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; @@ -11,16 +11,14 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.inventory.ItemStack; /** - * The {@link FilledKnowledgeFlask} is a {@link NotConfigurable} {@link SlimefunItem} - * that results from interacting with a {@link KnowledgeFlask}. - * - * @see KnowledgeFlask + * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} + * that is hidden from the Slimefun guide. * */ -public class FilledKnowledgeFlask extends SlimefunItem implements NotConfigurable { +public class HiddenItem extends SlimefunItem implements NotConfigurable { @ParametersAreNonnullByDefault - public FilledKnowledgeFlask(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + public HiddenItem(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(itemGroup, item, recipeType, recipe); this.setHidden(true); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 3d3d09522..55dcadf84 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -26,6 +26,7 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactivity; import io.github.thebusybiscuit.slimefun4.core.handlers.RainbowTickHandler; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.items.HiddenItem; import io.github.thebusybiscuit.slimefun4.implementation.items.RadioactiveItem; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientAltar; @@ -137,7 +138,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSControlPan import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSMarkerTool; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSTransmitter; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.BeeWings; -import io.github.thebusybiscuit.slimefun4.implementation.items.magical.FilledKnowledgeFlask; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfernalBonemeal; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedHopper; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedMagnet; @@ -1366,7 +1366,7 @@ public final class SlimefunItemSetup { new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) .register(plugin); - new FilledKnowledgeFlask(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, + new HiddenItem(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, null, null, null, null, null, null, null, null}) .register(plugin); From c038e1ffc3ee8a80e2e041fa6f1e3979a977b048 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Wed, 12 Jan 2022 23:38:15 +0000 Subject: [PATCH 005/146] Apply suggestions from code review Co-authored-by: svr333 --- .../slimefun4/implementation/items/HiddenItem.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index a021ed5b7..7a6615f5c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -13,7 +13,6 @@ import org.bukkit.inventory.ItemStack; /** * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} * that is hidden from the Slimefun guide. - * */ public class HiddenItem extends SlimefunItem implements NotConfigurable { @@ -22,5 +21,4 @@ public class HiddenItem extends SlimefunItem implements NotConfigurable { super(itemGroup, item, recipeType, recipe); this.setHidden(true); } - } From 6f5f5e585fe5a47bb1e894da87af682c73013b6f Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Thu, 20 Jan 2022 04:15:38 +0000 Subject: [PATCH 006/146] Update src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java Co-authored-by: poma123 <25465545+poma123@users.noreply.github.com> --- .../slimefun4/implementation/items/HiddenItem.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index 7a6615f5c..b2be1e00b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -1,15 +1,15 @@ package io.github.thebusybiscuit.slimefun4.implementation.items; +import javax.annotation.ParametersAreNonnullByDefault; + +import org.bukkit.inventory.ItemStack; + import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.core.attributes.NotConfigurable; -import javax.annotation.ParametersAreNonnullByDefault; - -import org.bukkit.inventory.ItemStack; - /** * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} * that is hidden from the Slimefun guide. From bf3da7b8d5a83ad6fb96160e780f99f3aa731bec Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Thu, 20 Jan 2022 04:16:16 +0000 Subject: [PATCH 007/146] Update HiddenItem.java --- .../slimefun4/implementation/items/HiddenItem.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index b2be1e00b..464e0e609 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -13,6 +13,8 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.NotConfigurable; /** * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} * that is hidden from the Slimefun guide. + * + * @author char321 */ public class HiddenItem extends SlimefunItem implements NotConfigurable { From 8c8a0d24ed830daa61e471d56b29680316395420 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Thu, 20 Jan 2022 04:17:34 +0000 Subject: [PATCH 008/146] Update HiddenItem.java --- .../slimefun4/implementation/items/HiddenItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index 464e0e609..dcfaa8a10 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -13,8 +13,9 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.NotConfigurable; /** * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} * that is hidden from the Slimefun guide. - * + * * @author char321 + * */ public class HiddenItem extends SlimefunItem implements NotConfigurable { From 8043261da75f26ccc9b247d540b351b4407420da Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Sat, 19 Mar 2022 17:44:58 +0100 Subject: [PATCH 009/146] added freezer 3 --- .../slimefun4/core/multiblocks/MultiBlock.java | 2 +- .../slimefun4/implementation/SlimefunItems.java | 1 + .../slimefun4/implementation/setup/ResearchSetup.java | 2 +- .../slimefun4/implementation/setup/SlimefunItemSetup.java | 7 +++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java index d69e86214..5678ac006 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java @@ -155,7 +155,7 @@ public class MultiBlock { public boolean isSymmetric() { return isSymmetric; } - + @Override public String toString() { return "MultiBlock (" + item.getId() + ") {" + Arrays.toString(blocks) + "}"; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index 60f52eb9e..91773366f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -833,6 +833,7 @@ public final class SlimefunItems { public static final SlimefunItemStack FREEZER = new SlimefunItemStack("FREEZER", Material.LIGHT_BLUE_STAINED_GLASS, "&bFreezer", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(18)); public static final SlimefunItemStack FREEZER_2 = new SlimefunItemStack("FREEZER_2", Material.LIGHT_BLUE_STAINED_GLASS, "&bFreezer &7(&eII&7)", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(2), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(30)); + public static final SlimefunItemStack FREEZER_3 = new SlimefunItemStack("FREEZER_3", Material.LIGHT_GRAY_STAINED_GLASS, "&bFreezer &7(&eIII&7)", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(3), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(42)); public static final SlimefunItemStack ELECTRIC_GOLD_PAN = new SlimefunItemStack("ELECTRIC_GOLD_PAN", Material.BROWN_TERRACOTTA, "&6Electric Gold Pan", "", LoreBuilder.machine(MachineTier.BASIC, MachineType.MACHINE), LoreBuilder.speed(1), LoreBuilder.powerPerSecond(2)); public static final SlimefunItemStack ELECTRIC_GOLD_PAN_2 = new SlimefunItemStack("ELECTRIC_GOLD_PAN_2", Material.BROWN_TERRACOTTA, "&6Electric Gold Pan &7(&eII&7)", "", LoreBuilder.machine(MachineTier.BASIC, MachineType.MACHINE), LoreBuilder.speed(3), LoreBuilder.powerPerSecond(4)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java index fa12c1e9e..ca1e2b298 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java @@ -221,7 +221,7 @@ public final class ResearchSetup { register("better_food_fabricator", 211, "Upgraded Food Fabrication", 28, SlimefunItems.FOOD_FABRICATOR_2, SlimefunItems.FOOD_COMPOSTER_2); register("reactor_access_port", 212, "Reactor Interaction", 18, SlimefunItems.REACTOR_ACCESS_PORT); register("fluid_pump", 213, "Fluid Pump", 28, SlimefunItems.FLUID_PUMP); - register("better_freezer", 214, "Upgraded Freezer", 29, SlimefunItems.FREEZER_2); + register("better_freezer", 214, "Upgraded Freezer", 29, SlimefunItems.FREEZER_2, SlimefunItems.FREEZER_3); register("boosted_uranium", 215, "Never-Ending Circle", 30, SlimefunItems.BOOSTED_URANIUM); register("trash_can", 216, "Trash", 8, SlimefunItems.TRASH_CAN); register("advanced_output_node", 217, "Advanced Output Node", 24, SlimefunItems.CARGO_OUTPUT_NODE_2); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 03336c714..81574af3e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -2438,6 +2438,13 @@ public final class SlimefunItemSetup { .setProcessingSpeed(2) .register(plugin); + new Freezer(itemGroups.electricity, SlimefunItems.FREEZER_3, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.FREEZER_2, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COOLING_UNIT, SlimefunItems.COOLING_UNIT, SlimefunItems.COOLING_UNIT}) + .setCapacity(256) + .setEnergyConsumption(21) + .setProcessingSpeed(3) + .register(plugin); + new CoolantCell(itemGroups.technicalComponents, SlimefunItems.REACTOR_COOLANT_CELL, RecipeType.FREEZER, new ItemStack[] {new ItemStack(Material.BLUE_ICE), null, null, null, null, null, null, null, null}) .register(plugin); From 583d69ea782824935322afcc8e5cb38d5cbd9e84 Mon Sep 17 00:00:00 2001 From: TheWireLord Date: Fri, 17 Jun 2022 16:29:25 -0400 Subject: [PATCH 010/146] Added Glow Berries Being Useful + Added Glow Berry Juice as a result of using Glow Berries in the Juicer. + Added Glow Berries as a fuel in the Bio Reactor. + Updated Wiki. --- .../slimefun4/implementation/SlimefunItems.java | 1 + .../items/electric/generators/BioGenerator.java | 1 + .../slimefun4/implementation/setup/ResearchSetup.java | 2 +- .../slimefun4/implementation/setup/SlimefunItemSetup.java | 6 ++++++ src/main/resources/wiki.json | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index bd33d51a9..df97e14e1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -149,6 +149,7 @@ public final class SlimefunItems { public static final SlimefunItemStack CARROT_JUICE = new SlimefunItemStack("CARROT_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&6Carrot Juice", "", LoreBuilder.hunger(3)); public static final SlimefunItemStack PUMPKIN_JUICE = new SlimefunItemStack("PUMPKIN_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&6Pumpkin Juice", "", LoreBuilder.hunger(3)); public static final SlimefunItemStack SWEET_BERRY_JUICE = new SlimefunItemStack("SWEET_BERRY_JUICE", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&cSweet Berry Juice", "", LoreBuilder.hunger(3)); + public static final SlimefunItemStack GLOW_BERRY_JUICE = new SlimefunItemStack("GLOW_BERRY_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&6Glow Berry Juice", "", LoreBuilder.hunger(3)); public static final SlimefunItemStack GOLDEN_APPLE_JUICE = new SlimefunItemStack("GOLDEN_APPLE_JUICE", Color.YELLOW, new PotionEffect(PotionEffectType.ABSORPTION, 20 * 20, 0), "&bGolden Apple Juice"); public static final SlimefunItemStack BEEF_JERKY = new SlimefunItemStack("BEEF_JERKY", Material.COOKED_BEEF, "&6Beef Jerky", "", "&fExtra saturating!"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java index 58b0136e3..3e5229375 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java @@ -54,6 +54,7 @@ public class BioGenerator extends AGenerator { registerFuel(new MachineFuel(2, new ItemStack(Material.SEA_PICKLE))); registerFuel(new MachineFuel(1, new ItemStack(Material.BAMBOO))); registerFuel(new MachineFuel(2, new ItemStack(Material.SWEET_BERRIES))); + registerFuel(new MachineFuel(2, new ItemStack(Material.GLOW_BERRIES))); registerFuel(new MachineFuel(2, new ItemStack(Material.COCOA_BEANS))); registerFuel(new MachineFuel(3, new ItemStack(Material.BEETROOT))); registerFuel(new MachineFuel(3, new ItemStack(Material.BEETROOT_SEEDS))); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java index 4635c1b4d..9a26908c1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java @@ -144,7 +144,7 @@ public final class ResearchSetup { register("bound_weapons", 125, "Soulbound Weapons", 29, SlimefunItems.SOULBOUND_SWORD, SlimefunItems.SOULBOUND_BOW, SlimefunItems.SOULBOUND_TRIDENT); register("bound_tools", 126, "Soulbound Tools", 29, SlimefunItems.SOULBOUND_PICKAXE, SlimefunItems.SOULBOUND_AXE, SlimefunItems.SOULBOUND_SHOVEL, SlimefunItems.SOULBOUND_HOE); register("bound_armor", 127, "Soulbound Armor", 29, SlimefunItems.SOULBOUND_HELMET, SlimefunItems.SOULBOUND_CHESTPLATE, SlimefunItems.SOULBOUND_LEGGINGS, SlimefunItems.SOULBOUND_BOOTS); - register("juicer", 129, "Delicious Drinks", 29, SlimefunItems.JUICER, SlimefunItems.APPLE_JUICE, SlimefunItems.MELON_JUICE, SlimefunItems.CARROT_JUICE, SlimefunItems.PUMPKIN_JUICE, SlimefunItems.SWEET_BERRY_JUICE); + register("juicer", 129, "Delicious Drinks", 29, SlimefunItems.JUICER, SlimefunItems.APPLE_JUICE, SlimefunItems.MELON_JUICE, SlimefunItems.CARROT_JUICE, SlimefunItems.PUMPKIN_JUICE, SlimefunItems.SWEET_BERRY_JUICE, SlimefunItems.GLOW_BERRY_JUICE); register("repaired_spawner", 130, "Repairing Spawners", 15, SlimefunItems.REPAIRED_SPAWNER); register("enhanced_furnace", 132, "Enhanced Furnace", 7, SlimefunItems.ENHANCED_FURNACE, SlimefunItems.ENHANCED_FURNACE_2); register("more_enhanced_furnaces", 133, "Better Furnaces", 18, SlimefunItems.ENHANCED_FURNACE_3, SlimefunItems.ENHANCED_FURNACE_4, SlimefunItems.ENHANCED_FURNACE_5, SlimefunItems.ENHANCED_FURNACE_6, SlimefunItems.ENHANCED_FURNACE_7); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index d64323ef9..15cf7ff23 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -2614,6 +2614,12 @@ public final class SlimefunItemSetup { .register(plugin); } + if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { + new Juice(itemGroups.food, SlimefunItems.GLOW_BERRY_JUICE, RecipeType.JUICER, + new ItemStack[] {new ItemStack(Material.GLOW_BERRIES), null, null, null, null, null, null, null, null}) + .register(plugin); + } + new ElytraCap(itemGroups.magicalArmor, SlimefunItems.ELYTRA_CAP, RecipeType.ARMOR_FORGE, new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.ELYTRA_SCALE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.ELYTRA_SCALE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.LEATHER_HELMET), new ItemStack(Material.SLIME_BALL)}) .register(plugin); diff --git a/src/main/resources/wiki.json b/src/main/resources/wiki.json index bf199037f..012e4615e 100644 --- a/src/main/resources/wiki.json +++ b/src/main/resources/wiki.json @@ -215,6 +215,7 @@ "GILDED_IRON_CHESTPLATE" : "Armor", "GILDED_IRON_HELMET" : "Armor", "GILDED_IRON_LEGGINGS" : "Armor", + "GLOW_BERRY_JUICE" : "Juices", "GLOWSTONE_BOOTS" : "Magical-Armor", "GLOWSTONE_CHESTPLATE" : "Magical-Armor", "GLOWSTONE_HELMET" : "Magical-Armor", From 5414c284fac768ec704d2532525b4ef13f5f5fd0 Mon Sep 17 00:00:00 2001 From: J3fftw <44972470+J3fftw1@users.noreply.github.com> Date: Sun, 3 Jul 2022 23:04:37 +0200 Subject: [PATCH 011/146] Update src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java Co-authored-by: svr333 --- .../thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java index 5678ac006..fd3458078 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java @@ -155,7 +155,6 @@ public class MultiBlock { public boolean isSymmetric() { return isSymmetric; } - @Override public String toString() { return "MultiBlock (" + item.getId() + ") {" + Arrays.toString(blocks) + "}"; From 178fb5ceadf0d49a6dea1aa5a735a7cab40d1b3e Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Sat, 6 Aug 2022 20:04:10 -0500 Subject: [PATCH 012/146] Remove "Burst" & "Custom" from Lore Removes the "Burst" and "Custom" Lore Lines from the ColoredFireworkStar Class. Sub sequentially removing it from all Runes & More --- .../slimefun4/utils/itemstack/ColoredFireworkStar.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ColoredFireworkStar.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ColoredFireworkStar.java index 48ad6d793..17a62c352 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ColoredFireworkStar.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ColoredFireworkStar.java @@ -9,6 +9,7 @@ import org.bukkit.Color; import org.bukkit.FireworkEffect; import org.bukkit.FireworkEffect.Type; import org.bukkit.Material; +import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.FireworkEffectMeta; @@ -42,6 +43,8 @@ public class ColoredFireworkStar extends CustomItemStack { im.setLore(lines); } + + im.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); }); } From 5cd5f26c914c35b95b560001d2a730b6e71e9cd9 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 7 Aug 2022 16:15:17 -0400 Subject: [PATCH 013/146] Drop support for 1.14 and 1.15 --- src/main/resources/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 1215c7454..5e5a3adbe 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -9,7 +9,7 @@ description: Slimefun basically turns your entire Server into a FTB modpack with # Technical settings main: io.github.thebusybiscuit.slimefun4.implementation.Slimefun -api-version: '1.14' +api-version: '1.16' # (Soft) dependencies of Slimefun, we hook into these plugins. softdepend: From dcc13a8f9a0e3b3fe3116e4bdd1ca7051aa0fd4a Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 7 Aug 2022 16:41:36 -0400 Subject: [PATCH 014/146] Remove 1.14 & 1.15 from MinecraftVersion --- .../slimefun4/api/MinecraftVersion.java | 12 ----- .../slimefun4/implementation/Slimefun.java | 16 ++----- .../implementation/SlimefunItems.java | 5 +-- .../autocrafters/AbstractAutoCrafter.java | 27 ++++-------- .../electric/generators/BioGenerator.java | 16 +++---- .../machines/entities/IronGolemAssembler.java | 6 +-- .../items/magical/MagicalZombiePills.java | 5 +-- .../items/tools/ClimbingPick.java | 10 ++--- .../setup/SlimefunItemSetup.java | 44 +++++++++---------- 9 files changed, 46 insertions(+), 95 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index f0b767ef2..048407b39 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -19,18 +19,6 @@ import io.papermc.lib.PaperLib; */ public enum MinecraftVersion { - /** - * This constant represents Minecraft (Java Edition) Version 1.14 - * (The "Village & Pillage" Update) - */ - MINECRAFT_1_14(14, "1.14.x"), - - /** - * This constant represents Minecraft (Java Edition) Version 1.15 - * (The "Buzzy Bees" Update) - */ - MINECRAFT_1_15(15, "1.15.x"), - /** * This constant represents Minecraft (Java Edition) Version 1.16 * (The "Nether Update") diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java index 5bb45c58a..18d8b6302 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java @@ -630,18 +630,10 @@ public final class Slimefun extends JavaPlugin implements SlimefunAddon { new AutoCrafterListener(this); new SlimefunItemHitListener(this); new MiddleClickListener(this); - - // Bees were added in 1.15 - if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { - new BeeListener(this); - new BeeWingsListener(this, (BeeWings) SlimefunItems.BEE_WINGS.getItem()); - } - - // Piglins were added in 1.16 - if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - new PiglinListener(this); - new SmithingTableListener(this); - } + new BeeListener(this); + new BeeWingsListener(this, (BeeWings) SlimefunItems.BEE_WINGS.getItem()); + new PiglinListener(this); + new SmithingTableListener(this); // Item-specific Listeners new CoolerListener(this, (Cooler) SlimefunItems.COOLER.getItem()); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index 8869dc412..b0b328d1b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -257,10 +257,7 @@ public final class SlimefunItems { hazmatLore.add(""); hazmatLore.add(ChatColor.GOLD + "Full set effects:"); hazmatLore.add(ChatColor.YELLOW + "- Radiation immunity"); - - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { - hazmatLore.add(ChatColor.YELLOW + "- Bee Sting protection"); - } + hazmatLore.add(ChatColor.YELLOW + "- Bee Sting protection"); } public static final SlimefunItemStack SCUBA_HELMET = new SlimefunItemStack("SCUBA_HELMET", Material.LEATHER_HELMET, Color.ORANGE, "&cScuba Helmet", "", "&7Allows you to breathe underwater"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java index b5088ae59..058fef4c9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java @@ -478,24 +478,15 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy private ItemStack getLeftoverItem(@Nonnull ItemStack item) { Material type = item.getType(); - switch (type) { - case WATER_BUCKET: - case LAVA_BUCKET: - case MILK_BUCKET: - return new ItemStack(Material.BUCKET); - case DRAGON_BREATH: - case POTION: - return new ItemStack(Material.GLASS_BOTTLE); - default: - MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion(); - - // Honey does not exist in 1.14 - if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15) && type == Material.HONEY_BOTTLE) { - return new ItemStack(Material.GLASS_BOTTLE); - } else { - return null; - } - } + return switch (type) { + case WATER_BUCKET, + LAVA_BUCKET, + MILK_BUCKET -> new ItemStack(Material.BUCKET); + case DRAGON_BREATH, + POTION, + HONEY_BOTTLE -> new ItemStack(Material.GLASS_BOTTLE); + default -> null; + }; } /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java index 58b0136e3..cbbf092f6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java @@ -63,17 +63,13 @@ public class BioGenerator extends AGenerator { registerFuel(new MachineFuel(1, new ItemStack(m))); } - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { - registerFuel(new MachineFuel(4, new ItemStack(Material.HONEYCOMB))); - registerFuel(new MachineFuel(40, new ItemStack(Material.HONEYCOMB_BLOCK))); - } + registerFuel(new MachineFuel(4, new ItemStack(Material.HONEYCOMB))); + registerFuel(new MachineFuel(40, new ItemStack(Material.HONEYCOMB_BLOCK))); - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - registerFuel(new MachineFuel(4, new ItemStack(Material.SHROOMLIGHT))); - registerFuel(new MachineFuel(2, new ItemStack(Material.CRIMSON_FUNGUS))); - registerFuel(new MachineFuel(2, new ItemStack(Material.WARPED_FUNGUS))); - registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO)); - } + registerFuel(new MachineFuel(4, new ItemStack(Material.SHROOMLIGHT))); + registerFuel(new MachineFuel(2, new ItemStack(Material.CRIMSON_FUNGUS))); + registerFuel(new MachineFuel(2, new ItemStack(Material.WARPED_FUNGUS))); + registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO)); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { registerFuel(new MachineFuel(2, new ItemStack(Material.GLOW_BERRIES))); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java index 66192770d..c7ef5a4fa 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java @@ -73,11 +73,7 @@ public class IronGolemAssembler extends AbstractEntityAssembler { @Override public IronGolem spawnEntity(Location l) { - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { - // This sound doesn't exist in 1.14 and earlier :/ - l.getWorld().playSound(l, Sound.ENTITY_IRON_GOLEM_REPAIR, 0.5F, 1); - } - + l.getWorld().playSound(l, Sound.ENTITY_IRON_GOLEM_REPAIR, 0.5F, 1); return l.getWorld().spawn(l, IronGolem.class); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java index 7273db80d..dfb328cb1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java @@ -90,10 +90,7 @@ public class MagicalZombiePills extends SimpleSlimefunItem implements if (version != MinecraftVersion.UNIT_TEST) { p.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType()); - if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { - if (hand == EquipmentSlot.HAND) { - p.swingMainHand(); - } else { - p.swingOffHand(); - } + if (hand == EquipmentSlot.HAND) { + p.swingMainHand(); + } else { + p.swingOffHand(); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index d64323ef9..2faf1ca36 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -2584,35 +2584,31 @@ public final class SlimefunItemSetup { MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion(); - if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { - new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_HELMET, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), null, null, null}) - .register(plugin); + new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_HELMET, RecipeType.ARMOR_FORGE, + new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), null, null, null}) + .register(plugin); - new BeeWings(itemGroups.magicalArmor, SlimefunItems.BEE_WINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.ELYTRA), new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK)}) - .register(plugin); + new BeeWings(itemGroups.magicalArmor, SlimefunItems.BEE_WINGS, RecipeType.ARMOR_FORGE, + new ItemStack[] {SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.ELYTRA), new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK)}) + .register(plugin); - new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_LEGGINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK)}) - .register(plugin); + new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_LEGGINGS, RecipeType.ARMOR_FORGE, + new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK)}) + .register(plugin); - new LongFallBoots(itemGroups.magicalArmor, SlimefunItems.BEE_BOOTS, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), null, new ItemStack(Material.HONEY_BLOCK)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.JUMP, 300, 2)}) - .register(plugin); - } + new LongFallBoots(itemGroups.magicalArmor, SlimefunItems.BEE_BOOTS, RecipeType.ARMOR_FORGE, + new ItemStack[] {null, null, null, SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), null, new ItemStack(Material.HONEY_BLOCK)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.JUMP, 300, 2)}) + .register(plugin); - if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - new VillagerRune(itemGroups.magicalResources, SlimefunItems.VILLAGER_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.STRANGE_NETHER_GOO, SlimefunItems.FIRE_RUNE, SlimefunItems.STRANGE_NETHER_GOO, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3}, - new SlimefunItemStack(SlimefunItems.VILLAGER_RUNE, 3)) - .register(plugin); + new VillagerRune(itemGroups.magicalResources, SlimefunItems.VILLAGER_RUNE, RecipeType.ANCIENT_ALTAR, + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.STRANGE_NETHER_GOO, SlimefunItems.FIRE_RUNE, SlimefunItems.STRANGE_NETHER_GOO, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3}, + new SlimefunItemStack(SlimefunItems.VILLAGER_RUNE, 3)) + .register(plugin); - new StrangeNetherGoo(itemGroups.magicalResources, SlimefunItems.STRANGE_NETHER_GOO, RecipeType.BARTER_DROP, - new ItemStack[] {null, null, null, null, new CustomItemStack(HeadTexture.PIGLIN_HEAD.getAsItemStack(), "&fPiglin"), null, null, null, null}) - .register(plugin); - } + new StrangeNetherGoo(itemGroups.magicalResources, SlimefunItems.STRANGE_NETHER_GOO, RecipeType.BARTER_DROP, + new ItemStack[] {null, null, null, null, new CustomItemStack(HeadTexture.PIGLIN_HEAD.getAsItemStack(), "&fPiglin"), null, null, null, null}) + .register(plugin); new ElytraCap(itemGroups.magicalArmor, SlimefunItems.ELYTRA_CAP, RecipeType.ARMOR_FORGE, new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.ELYTRA_SCALE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.ELYTRA_SCALE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.LEATHER_HELMET), new ItemStack(Material.SLIME_BALL)}) From eb5d4ca3f77ad85df891d3eeeb57f8e96d050e68 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 7 Aug 2022 16:54:18 -0400 Subject: [PATCH 015/146] Fix test compile --- .../slimefun4/utils/TestMinecraftVersion.java | 38 +++++++++---------- .../biomes/TestBiomeMapCompatibility.java | 13 ------- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java index 5412b3f0d..5786a3dc0 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java @@ -11,57 +11,57 @@ class TestMinecraftVersion { @Test @DisplayName("Test if Minecraft versions match themselves") void testMatches() { - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_14.isMinecraftVersion(14)); - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_15.isMinecraftVersion(15)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(17)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_15.isMinecraftVersion(14)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_14.isMinecraftVersion(0)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(0)); } @Test @DisplayName("Test if Minecraft versions are ordered correctly (#atLeast)") void testAtLeast() { - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isAtLeast(MinecraftVersion.MINECRAFT_1_14)); - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_15.isAtLeast(MinecraftVersion.MINECRAFT_1_14)); - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_15.isAtLeast(MinecraftVersion.MINECRAFT_1_15)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_18.isAtLeast(MinecraftVersion.MINECRAFT_1_16)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_16)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_17)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_15.isAtLeast(MinecraftVersion.MINECRAFT_1_16)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_18)); } @Test @DisplayName("Test correct behaviour for MinecraftVersion.UNKNOWN.isAtleast(...)") void testAtLeastUnknown() { // Unknown should always fall back to false - Assertions.assertFalse(MinecraftVersion.UNKNOWN.isAtLeast(MinecraftVersion.MINECRAFT_1_14)); - Assertions.assertFalse(MinecraftVersion.UNKNOWN.isAtLeast(MinecraftVersion.MINECRAFT_1_15)); + Assertions.assertFalse(MinecraftVersion.UNKNOWN.isAtLeast(MinecraftVersion.MINECRAFT_1_16)); + Assertions.assertFalse(MinecraftVersion.UNKNOWN.isAtLeast(MinecraftVersion.MINECRAFT_1_17)); - Assertions.assertThrows(IllegalArgumentException.class, () -> MinecraftVersion.MINECRAFT_1_14.isAtLeast(null)); + Assertions.assertThrows(IllegalArgumentException.class, () -> MinecraftVersion.MINECRAFT_1_16.isAtLeast(null)); } @Test @DisplayName("Test if Minecraft versions are ordered correctly (#isBefore)") void testIsBefore() { - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_14.isBefore(MinecraftVersion.MINECRAFT_1_15)); - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_14.isBefore(MinecraftVersion.MINECRAFT_1_16)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isBefore(MinecraftVersion.MINECRAFT_1_17)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isBefore(MinecraftVersion.MINECRAFT_1_18)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_15.isBefore(MinecraftVersion.MINECRAFT_1_15)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_15.isBefore(MinecraftVersion.MINECRAFT_1_14)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isBefore(MinecraftVersion.MINECRAFT_1_17)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isBefore(MinecraftVersion.MINECRAFT_1_16)); } @Test @DisplayName("Test correct behaviour for MinecraftVersion.UNKNOWN.isBefore(...)") void testIsBeforeUnknown() { // Unknown should always fall back to true - Assertions.assertTrue(MinecraftVersion.UNKNOWN.isBefore(MinecraftVersion.MINECRAFT_1_14)); - Assertions.assertTrue(MinecraftVersion.UNKNOWN.isBefore(MinecraftVersion.MINECRAFT_1_15)); + Assertions.assertTrue(MinecraftVersion.UNKNOWN.isBefore(MinecraftVersion.MINECRAFT_1_16)); + Assertions.assertTrue(MinecraftVersion.UNKNOWN.isBefore(MinecraftVersion.MINECRAFT_1_17)); - Assertions.assertThrows(IllegalArgumentException.class, () -> MinecraftVersion.MINECRAFT_1_14.isBefore(null)); + Assertions.assertThrows(IllegalArgumentException.class, () -> MinecraftVersion.MINECRAFT_1_16.isBefore(null)); } @Test @DisplayName("Test warning system for lowest supported version checks") void testLowestSupportedVersion() { - Assertions.assertThrows(IllegalArgumentException.class, () -> MinecraftVersion.UNIT_TEST.isAtLeast(MinecraftVersion.MINECRAFT_1_14)); + Assertions.assertThrows(IllegalArgumentException.class, () -> MinecraftVersion.UNIT_TEST.isAtLeast(MinecraftVersion.MINECRAFT_1_16)); } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java index bec5087a8..950c566f8 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java @@ -98,10 +98,6 @@ class TestBiomeMapCompatibility { Map testCases = new HashMap<>(); // @formatter:off - testCases.put("nether_ice_v1.14", new MinecraftVersion[] { - MinecraftVersion.MINECRAFT_1_14, - MinecraftVersion.MINECRAFT_1_15 - }); testCases.put("nether_ice_v1.16", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_16, @@ -111,8 +107,6 @@ class TestBiomeMapCompatibility { }); testCases.put("oil_v1.14", new MinecraftVersion[] { - MinecraftVersion.MINECRAFT_1_14, - MinecraftVersion.MINECRAFT_1_15, MinecraftVersion.MINECRAFT_1_16, MinecraftVersion.MINECRAFT_1_17 }); @@ -123,8 +117,6 @@ class TestBiomeMapCompatibility { }); testCases.put("salt_v1.14", new MinecraftVersion[] { - MinecraftVersion.MINECRAFT_1_14, - MinecraftVersion.MINECRAFT_1_15, MinecraftVersion.MINECRAFT_1_16, MinecraftVersion.MINECRAFT_1_17 }); @@ -134,11 +126,6 @@ class TestBiomeMapCompatibility { MinecraftVersion.MINECRAFT_1_19 }); - testCases.put("uranium_v1.14", new MinecraftVersion[] { - MinecraftVersion.MINECRAFT_1_14, - MinecraftVersion.MINECRAFT_1_15 - }); - testCases.put("uranium_v1.16", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_16 }); From 435f09b6b13dfcbc1bfcc3102333479ab3715bd5 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 7 Aug 2022 17:46:28 -0400 Subject: [PATCH 016/146] Remove more version specific stuff --- .../slimefun4/api/recipes/RecipeType.java | 4 +- .../core/multiblocks/MultiBlock.java | 6 +- .../items/androids/WoodcutterAndroid.java | 97 +++++++++---------- .../implementation/items/blocks/Crucible.java | 10 +- .../electric/machines/ElectricPress.java | 4 +- .../machines/ElectrifiedCrucible.java | 6 +- .../items/magical/MagicalZombiePills.java | 2 +- .../items/multiblocks/OreCrusher.java | 10 +- .../multiblocks/miner/IndustrialMiner.java | 2 +- .../multiblocks/miner/OreDictionary.java | 5 +- .../multiblocks/miner/OreDictionary14.java | 35 ------- .../multiblocks/miner/OreDictionary16.java | 13 ++- .../resources/NetherIceResource.java | 7 +- .../resources/UraniumResource.java | 5 +- .../slimefun4/utils/SlimefunUtils.java | 11 +-- .../slimefun4/utils/WorldUtils.java | 7 +- 16 files changed, 75 insertions(+), 149 deletions(-) delete mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary14.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java index 4cbefc2d9..0fc2ac4a1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java @@ -163,9 +163,7 @@ public class RecipeType implements Keyed { @ParametersAreNonnullByDefault private static void registerBarterDrop(ItemStack[] recipe, ItemStack output) { - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - Slimefun.getRegistry().getBarteringDrops().add(output); - } + Slimefun.getRegistry().getBarteringDrops().add(output); } @ParametersAreNonnullByDefault diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java index d69e86214..411d160c1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java @@ -43,11 +43,7 @@ public class MultiBlock { SUPPORTED_TAGS.add(Tag.WOODEN_TRAPDOORS); SUPPORTED_TAGS.add(Tag.WOODEN_SLABS); SUPPORTED_TAGS.add(Tag.WOODEN_FENCES); - - // Add Soul Fire support on 1.16 - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - SUPPORTED_TAGS.add(Tag.FIRE); - } + SUPPORTED_TAGS.add(Tag.FIRE); } @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java index 55f29b6c3..ea4a5ddaf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java @@ -92,70 +92,63 @@ public class WoodcutterAndroid extends ProgrammableAndroid { Predicate soilRequirement = null; switch (logType) { - case OAK_LOG: - case OAK_WOOD: - case STRIPPED_OAK_LOG: - case STRIPPED_OAK_WOOD: + case OAK_LOG, + OAK_WOOD, + STRIPPED_OAK_LOG, + STRIPPED_OAK_WOOD -> { saplingType = Material.OAK_SAPLING; soilRequirement = SlimefunTag.DIRT_VARIANTS::isTagged; - break; - case BIRCH_LOG: - case BIRCH_WOOD: - case STRIPPED_BIRCH_LOG: - case STRIPPED_BIRCH_WOOD: + } + case BIRCH_LOG, + BIRCH_WOOD, + STRIPPED_BIRCH_LOG, + STRIPPED_BIRCH_WOOD -> { saplingType = Material.BIRCH_SAPLING; soilRequirement = SlimefunTag.DIRT_VARIANTS::isTagged; - break; - case JUNGLE_LOG: - case JUNGLE_WOOD: - case STRIPPED_JUNGLE_LOG: - case STRIPPED_JUNGLE_WOOD: + } + case JUNGLE_LOG, + JUNGLE_WOOD, + STRIPPED_JUNGLE_LOG, + STRIPPED_JUNGLE_WOOD -> { saplingType = Material.JUNGLE_SAPLING; soilRequirement = SlimefunTag.DIRT_VARIANTS::isTagged; - break; - case SPRUCE_LOG: - case SPRUCE_WOOD: - case STRIPPED_SPRUCE_LOG: - case STRIPPED_SPRUCE_WOOD: + } + case SPRUCE_LOG, + SPRUCE_WOOD, + STRIPPED_SPRUCE_LOG, + STRIPPED_SPRUCE_WOOD -> { saplingType = Material.SPRUCE_SAPLING; soilRequirement = SlimefunTag.DIRT_VARIANTS::isTagged; - break; - case ACACIA_LOG: - case ACACIA_WOOD: - case STRIPPED_ACACIA_LOG: - case STRIPPED_ACACIA_WOOD: + } + case ACACIA_LOG, + ACACIA_WOOD, + STRIPPED_ACACIA_LOG, + STRIPPED_ACACIA_WOOD -> { saplingType = Material.ACACIA_SAPLING; soilRequirement = SlimefunTag.DIRT_VARIANTS::isTagged; - break; - case DARK_OAK_LOG: - case DARK_OAK_WOOD: - case STRIPPED_DARK_OAK_LOG: - case STRIPPED_DARK_OAK_WOOD: + } + case DARK_OAK_LOG, + DARK_OAK_WOOD, + STRIPPED_DARK_OAK_LOG, + STRIPPED_DARK_OAK_WOOD -> { saplingType = Material.DARK_OAK_SAPLING; soilRequirement = SlimefunTag.DIRT_VARIANTS::isTagged; - break; - default: - break; - } - - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - switch (logType) { - case CRIMSON_STEM: - case CRIMSON_HYPHAE: - case STRIPPED_CRIMSON_STEM: - case STRIPPED_CRIMSON_HYPHAE: - saplingType = Material.CRIMSON_FUNGUS; - soilRequirement = SlimefunTag.FUNGUS_SOIL::isTagged; - break; - case WARPED_STEM: - case WARPED_HYPHAE: - case STRIPPED_WARPED_STEM: - case STRIPPED_WARPED_HYPHAE: - saplingType = Material.WARPED_FUNGUS; - soilRequirement = SlimefunTag.FUNGUS_SOIL::isTagged; - break; - default: - break; + } + case CRIMSON_STEM, + CRIMSON_HYPHAE, + STRIPPED_CRIMSON_STEM, + STRIPPED_CRIMSON_HYPHAE -> { + saplingType = Material.CRIMSON_FUNGUS; + soilRequirement = SlimefunTag.FUNGUS_SOIL::isTagged; + } + case WARPED_STEM, + WARPED_HYPHAE, + STRIPPED_WARPED_STEM, + STRIPPED_WARPED_HYPHAE -> { + saplingType = Material.WARPED_FUNGUS; + soilRequirement = SlimefunTag.FUNGUS_SOIL::isTagged; + } + default -> { } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java index 575177c71..1c7c05c7e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java @@ -90,13 +90,11 @@ public class Crucible extends SimpleSlimefunItem implements Rec items.add(new ItemStack(Material.LAVA_BUCKET)); } - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - items.add(new ItemStack(Material.BLACKSTONE, 8)); - items.add(new ItemStack(Material.LAVA_BUCKET)); + items.add(new ItemStack(Material.BLACKSTONE, 8)); + items.add(new ItemStack(Material.LAVA_BUCKET)); - items.add(new ItemStack(Material.BASALT, 12)); - items.add(new ItemStack(Material.LAVA_BUCKET)); - } + items.add(new ItemStack(Material.BASALT, 12)); + items.add(new ItemStack(Material.LAVA_BUCKET)); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { items.add(new ItemStack(Material.COBBLED_DEEPSLATE, 12)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java index 5cea6710d..b5cb6f2f4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java @@ -75,9 +75,7 @@ public class ElectricPress extends AContainer implements RecipeDisplayItem { addRecipe(8, new ItemStack(Material.EMERALD, 9), new ItemStack(Material.EMERALD_BLOCK)); addRecipe(8, new ItemStack(Material.DIAMOND, 9), new ItemStack(Material.DIAMOND_BLOCK)); - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - addRecipe(16, new ItemStack(Material.NETHERITE_INGOT, 9), new ItemStack(Material.NETHERITE_BLOCK)); - } + addRecipe(16, new ItemStack(Material.NETHERITE_INGOT, 9), new ItemStack(Material.NETHERITE_BLOCK)); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { addRecipe(4, new ItemStack(Material.AMETHYST_SHARD, 4), new ItemStack(Material.AMETHYST_BLOCK)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectrifiedCrucible.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectrifiedCrucible.java index e7be0631b..ff5a33474 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectrifiedCrucible.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectrifiedCrucible.java @@ -35,10 +35,8 @@ public class ElectrifiedCrucible extends AContainer { registerRecipe(10, new ItemStack[] { new ItemStack(Material.BUCKET), new ItemStack(leaves, 16) }, new ItemStack[] { new ItemStack(Material.WATER_BUCKET) }); } - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - registerRecipe(10, new ItemStack[] { new ItemStack(Material.BUCKET), new ItemStack(Material.BLACKSTONE, 8) }, new ItemStack[] { new ItemStack(Material.LAVA_BUCKET) }); - registerRecipe(10, new ItemStack[] { new ItemStack(Material.BUCKET), new ItemStack(Material.BASALT, 12) }, new ItemStack[] { new ItemStack(Material.LAVA_BUCKET) }); - } + registerRecipe(10, new ItemStack[] { new ItemStack(Material.BUCKET), new ItemStack(Material.BLACKSTONE, 8) }, new ItemStack[] { new ItemStack(Material.LAVA_BUCKET) }); + registerRecipe(10, new ItemStack[] { new ItemStack(Material.BUCKET), new ItemStack(Material.BASALT, 12) }, new ItemStack[] { new ItemStack(Material.LAVA_BUCKET) }); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { registerRecipe(10, new ItemStack[] { new ItemStack(Material.BUCKET), new ItemStack(Material.COBBLED_DEEPSLATE, 12) }, new ItemStack[] { new ItemStack(Material.LAVA_BUCKET) }); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java index dfb328cb1..2c14589c2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java @@ -64,7 +64,7 @@ public class MagicalZombiePills extends SimpleSlimefunItem new ItemStack(Material.COAL); - case DIAMOND_ORE -> new ItemStack(Material.DIAMOND); - case EMERALD_ORE -> new ItemStack(Material.EMERALD); - case REDSTONE_ORE -> new ItemStack(Material.REDSTONE, 4 + random.nextInt(2)); - case LAPIS_ORE -> new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4)); - case NETHER_QUARTZ_ORE -> new ItemStack(Material.QUARTZ); - case IRON_ORE -> new ItemStack(Material.IRON_ORE); - case GOLD_ORE -> new ItemStack(Material.GOLD_ORE); - default -> new ItemStack(material); - }; - } - -} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary16.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary16.java index 8a78b5195..f69ebc46d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary16.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary16.java @@ -14,16 +14,23 @@ import org.bukkit.inventory.ItemStack; * @author TheBusyBiscuit * */ -class OreDictionary16 extends OreDictionary14 { +class OreDictionary16 implements OreDictionary { @Override @ParametersAreNonnullByDefault public @Nonnull ItemStack getDrops(Material material, Random random) { return switch (material) { - // In 1.16, breaking nether gold ores should get gold nuggets + case COAL_ORE -> new ItemStack(Material.COAL); + case DIAMOND_ORE -> new ItemStack(Material.DIAMOND); + case EMERALD_ORE -> new ItemStack(Material.EMERALD); + case REDSTONE_ORE -> new ItemStack(Material.REDSTONE, 4 + random.nextInt(2)); + case LAPIS_ORE -> new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4)); + case NETHER_QUARTZ_ORE -> new ItemStack(Material.QUARTZ); + case IRON_ORE -> new ItemStack(Material.IRON_ORE); + case GOLD_ORE -> new ItemStack(Material.GOLD_ORE); case NETHER_GOLD_ORE -> new ItemStack(Material.GOLD_NUGGET, 2 + random.nextInt(4)); case ANCIENT_DEBRIS -> new ItemStack(Material.ANCIENT_DEBRIS); - default -> super.getDrops(material, random); + default -> new ItemStack(material); }; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java index e7d6f06a2..28b6d612d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java @@ -25,12 +25,7 @@ class NetherIceResource extends AbstractResource { NetherIceResource() { super("nether_ice", "Nether Ice", SlimefunItems.NETHER_ICE, 6, true); - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - // 1.16+ introduced Nether biomes - biomes = getBiomeMap(this, "/biome-maps/nether_ice_v1.16.json"); - } else { - biomes = getBiomeMap(this, "/biome-maps/nether_ice_v1.14.json"); - } + biomes = getBiomeMap(this, "/biome-maps/nether_ice_v1.16.json"); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java index 8eeca8dfa..ef4ffba76 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java @@ -32,11 +32,8 @@ class UraniumResource extends AbstractResource { } else if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { // 1.17+ introduced cave biomes biomes = getBiomeMap(this, "/biome-maps/uranium_v1.17.json"); - } else if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - // 1.16+ introduced Nether biomes - biomes = getBiomeMap(this, "/biome-maps/uranium_v1.16.json"); } else { - biomes = getBiomeMap(this, "/biome-maps/uranium_v1.14.json"); + biomes = getBiomeMap(this, "/biome-maps/uranium_v1.16.json"); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java index 429ba8232..bac16f352 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java @@ -531,15 +531,6 @@ public final class SlimefunUtils { * @return True if the inventory is empty and false otherwise */ public static boolean isInventoryEmpty(@Nonnull Inventory inventory) { - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - return inventory.isEmpty(); - } else { - for (ItemStack is : inventory.getStorageContents()) { - if (is != null && !is.getType().isAir()) { - return false; - } - } - return true; - } + return inventory.isEmpty(); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java index 094600bd4..8de891611 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java @@ -30,11 +30,6 @@ public final class WorldUtils { public static int getMinHeight(@Nonnull World world) { Validate.notNull(world, "World cannot be null!"); - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - return world.getMinHeight(); - } else { - // Default to zero for pre-1.16 worlds - return 0; - } + return world.getMinHeight(); } } From af897d5df70aaa19cb70a025d01e90b50e8f5203 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 7 Aug 2022 18:41:23 -0400 Subject: [PATCH 017/146] Fix test --- .../thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java index 5786a3dc0..dbac61ea8 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java @@ -14,7 +14,7 @@ class TestMinecraftVersion { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(17)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(0)); } From fd74586e23734a24518a56f1a919ece8f72fa46b Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 7 Aug 2022 20:58:25 -0400 Subject: [PATCH 018/146] Remove unused imports --- .../thebusybiscuit/slimefun4/api/recipes/RecipeType.java | 1 - .../thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java | 2 -- .../implementation/items/androids/WoodcutterAndroid.java | 4 +--- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java index 0fc2ac4a1..2e5cf928e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java @@ -23,7 +23,6 @@ import org.bukkit.inventory.ItemStack; import io.github.bakedlibs.dough.items.CustomItemStack; import io.github.bakedlibs.dough.recipes.MinecraftRecipe; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java index 411d160c1..19d1a000d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/MultiBlock.java @@ -14,11 +14,9 @@ import org.bukkit.Tag; import org.bukkit.World; import org.bukkit.block.BlockFace; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.events.MultiBlockInteractEvent; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.core.handlers.MultiBlockInteractionHandler; -import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; /** * A {@link MultiBlock} represents a structure build in a {@link World}. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java index ea4a5ddaf..559349c03 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java @@ -18,7 +18,6 @@ import org.bukkit.inventory.ItemStack; import io.github.bakedlibs.dough.blocks.Vein; import io.github.bakedlibs.dough.protection.Interaction; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; @@ -148,8 +147,7 @@ public class WoodcutterAndroid extends ProgrammableAndroid { saplingType = Material.WARPED_FUNGUS; soilRequirement = SlimefunTag.FUNGUS_SOIL::isTagged; } - default -> { - } + default -> {} } if (saplingType != null && soilRequirement != null) { From aa79e640e8b23b73c1c08e59aa0bfa23f6273ad7 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 7 Aug 2022 20:59:54 -0400 Subject: [PATCH 019/146] Change GEO resource versions --- .../implementation/resources/OilResource.java | 2 +- .../resources/SaltResource.java | 2 +- .../biome-maps/nether_ice_v1.14.json | 8 ---- .../{oil_v1.14.json => oil_v1.16.json} | 0 .../{salt_v1.14.json => salt_v1.16.json} | 0 .../resources/biome-maps/uranium_v1.14.json | 41 ------------------- 6 files changed, 2 insertions(+), 51 deletions(-) delete mode 100644 src/main/resources/biome-maps/nether_ice_v1.14.json rename src/main/resources/biome-maps/{oil_v1.14.json => oil_v1.16.json} (100%) rename src/main/resources/biome-maps/{salt_v1.14.json => salt_v1.16.json} (100%) delete mode 100644 src/main/resources/biome-maps/uranium_v1.14.json diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java index d3bd48c00..55e5bbd11 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java @@ -36,7 +36,7 @@ class OilResource extends AbstractResource { // 1.18+ renamed most biomes biomes = getBiomeMap(this, "/biome-maps/oil_v1.18.json"); } else { - biomes = getBiomeMap(this, "/biome-maps/oil_v1.14.json"); + biomes = getBiomeMap(this, "/biome-maps/oil_v1.16.json"); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java index 23afa77e8..0d6f1630a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java @@ -30,7 +30,7 @@ class SaltResource extends AbstractResource { // 1.18+ renamed most biomes biomes = getBiomeMap(this, "/biome-maps/salt_v1.18.json"); } else { - biomes = getBiomeMap(this, "/biome-maps/salt_v1.14.json"); + biomes = getBiomeMap(this, "/biome-maps/salt_v1.16.json"); } } diff --git a/src/main/resources/biome-maps/nether_ice_v1.14.json b/src/main/resources/biome-maps/nether_ice_v1.14.json deleted file mode 100644 index 45fa5b193..000000000 --- a/src/main/resources/biome-maps/nether_ice_v1.14.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "value" : 32, - "biomes" : [ - "minecraft:nether" - ] - } -] diff --git a/src/main/resources/biome-maps/oil_v1.14.json b/src/main/resources/biome-maps/oil_v1.16.json similarity index 100% rename from src/main/resources/biome-maps/oil_v1.14.json rename to src/main/resources/biome-maps/oil_v1.16.json diff --git a/src/main/resources/biome-maps/salt_v1.14.json b/src/main/resources/biome-maps/salt_v1.16.json similarity index 100% rename from src/main/resources/biome-maps/salt_v1.14.json rename to src/main/resources/biome-maps/salt_v1.16.json diff --git a/src/main/resources/biome-maps/uranium_v1.14.json b/src/main/resources/biome-maps/uranium_v1.14.json deleted file mode 100644 index a072891e5..000000000 --- a/src/main/resources/biome-maps/uranium_v1.14.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "value" : 5, - "biomes" : [ - "minecraft:desert", - "minecraft:beach", - "minecraft:stone_shore" - ] - }, - { - "value" : 8, - "biomes" : [ - "minecraft:mountains", - "minecraft:wooded_mountains", - "minecraft:desert_hills", - "minecraft:wooded_hills", - "minecraft:taiga_hills", - "minecraft:mountain_edge", - "minecraft:jungle_hills", - "minecraft:gravelly_mountains", - "minecraft:taiga_mountains", - "minecraft:tall_birch_hills", - "minecraft:dark_forest_hills", - "minecraft:snowy_taiga_mountains", - "minecraft:giant_spruce_taiga_hills", - "minecraft:modified_gravelly_mountains", - "minecraft:bamboo_jungle_hills" - ] - }, - { - "value" : 12, - "biomes" : [ - "minecraft:badlands", - "minecraft:wooded_badlands_plateau", - "minecraft:modified_wooded_badlands_plateau", - "minecraft:modified_badlands_plateau", - "minecraft:eroded_badlands", - "minecraft:badlands_plateau" - ] - } -] From 076c55c696abc0e82f3093d8bb0a13565b7ace81 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 7 Aug 2022 22:41:56 -0400 Subject: [PATCH 020/146] Remove unused imports --- .../slimefun4/implementation/SlimefunItems.java | 1 - .../items/autocrafters/AbstractAutoCrafter.java | 1 - .../items/electric/machines/entities/IronGolemAssembler.java | 2 -- .../implementation/items/magical/MagicalZombiePills.java | 1 - .../implementation/resources/NetherIceResource.java | 2 -- .../io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java | 3 --- .../slimefun4/utils/biomes/TestBiomeMapCompatibility.java | 5 ++--- 7 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index b0b328d1b..7fba00349 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -14,7 +14,6 @@ import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.MachineTier; import io.github.thebusybiscuit.slimefun4.core.attributes.MachineType; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java index 058fef4c9..b27f4ceca 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java @@ -28,7 +28,6 @@ import org.bukkit.inventory.ItemStack; import io.github.bakedlibs.dough.data.persistent.PersistentDataAPI; import io.github.bakedlibs.dough.items.CustomItemStack; import io.github.bakedlibs.dough.protection.Interaction; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.ItemState; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java index c7ef5a4fa..3d5ee7def 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java @@ -9,11 +9,9 @@ import org.bukkit.entity.IronGolem; import org.bukkit.inventory.ItemStack; import io.github.bakedlibs.dough.items.CustomItemStack; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; -import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java index 2c14589c2..804250bfd 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java @@ -16,7 +16,6 @@ import org.bukkit.inventory.ItemStack; import io.github.bakedlibs.dough.items.ItemUtils; import io.github.bakedlibs.dough.protection.Interaction; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java index 28b6d612d..b77ec6d30 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/NetherIceResource.java @@ -3,9 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.resources; import org.bukkit.World.Environment; import org.bukkit.block.Biome; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource; -import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.utils.biomes.BiomeMap; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java index 8de891611..71d12daf9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java @@ -5,9 +5,6 @@ import javax.annotation.Nonnull; import org.apache.commons.lang.Validate; import org.bukkit.World; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; - /** * This class holds utilities for {@link World}. This will become especially useful with the changes * in the "Cliffs and Caves" update. diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java index 950c566f8..416651d02 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java @@ -98,7 +98,6 @@ class TestBiomeMapCompatibility { Map testCases = new HashMap<>(); // @formatter:off - testCases.put("nether_ice_v1.16", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_16, MinecraftVersion.MINECRAFT_1_17, @@ -106,7 +105,7 @@ class TestBiomeMapCompatibility { MinecraftVersion.MINECRAFT_1_19 }); - testCases.put("oil_v1.14", new MinecraftVersion[] { + testCases.put("oil_v1.16", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_16, MinecraftVersion.MINECRAFT_1_17 }); @@ -116,7 +115,7 @@ class TestBiomeMapCompatibility { MinecraftVersion.MINECRAFT_1_19 }); - testCases.put("salt_v1.14", new MinecraftVersion[] { + testCases.put("salt_v1.16", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_16, MinecraftVersion.MINECRAFT_1_17 }); From f783fc7e95789135f3d040af774050fa1b5b164a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:18:05 +0200 Subject: [PATCH 021/146] [CI skip] Update dependency com.sk89q.worldedit:worldedit-core to v7.2.12 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e6e15e05b..fba16212f 100644 --- a/pom.xml +++ b/pom.xml @@ -411,7 +411,7 @@ com.sk89q.worldedit worldedit-core - 7.2.11 + 7.2.12 provided From 75a684f61478d3284dd3c82746d1c6069b43c240 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:18:11 +0200 Subject: [PATCH 022/146] [CI skip] Update dependency com.sk89q.worldedit:worldedit-bukkit to v7.2.12 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fba16212f..09b18bcdf 100644 --- a/pom.xml +++ b/pom.xml @@ -425,7 +425,7 @@ com.sk89q.worldedit worldedit-bukkit - 7.2.11 + 7.2.12 provided From b407c248d2faf4f7776a4e7663793a39112aa63a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:18:13 +0200 Subject: [PATCH 023/146] [CI skip] Update dependency com.gmail.nossr50.mcMMO:mcMMO to v2.1.217 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 09b18bcdf..a06f89969 100644 --- a/pom.xml +++ b/pom.xml @@ -439,7 +439,7 @@ com.gmail.nossr50.mcMMO mcMMO - 2.1.216 + 2.1.217 provided From b1aae439f3eaac3e38552f3c7daabc2fafb8f704 Mon Sep 17 00:00:00 2001 From: The Busy Bot Date: Mon, 8 Aug 2022 21:12:50 +0200 Subject: [PATCH 024/146] [CI skip] New locale updates from Crowdin --- src/main/resources/languages/fa/messages.yml | 39 +++++++++++++ .../resources/languages/fa/researches.yml | 11 ++++ src/main/resources/languages/ja/messages.yml | 5 ++ .../resources/languages/ja/researches.yml | 8 +-- .../resources/languages/pt/researches.yml | 20 +++++++ .../resources/languages/ro/categories.yml | 22 ++++++++ src/main/resources/languages/ro/messages.yml | 55 +++++++++++++++++++ .../resources/languages/ro/researches.yml | 6 ++ .../resources/languages/sk/researches.yml | 6 +- 9 files changed, 165 insertions(+), 7 deletions(-) diff --git a/src/main/resources/languages/fa/messages.yml b/src/main/resources/languages/fa/messages.yml index 806159a96..99b3d1130 100644 --- a/src/main/resources/languages/fa/messages.yml +++ b/src/main/resources/languages/fa/messages.yml @@ -1,5 +1,7 @@ --- commands: + research: + reset-target: '&cدانش شما بازنشانی شده است' debug: description: 'ثبت اشکال زدایی را برای توسعه دهندگان اجرا کنید' disabled: '&7حالت اشکال زدایی غیرفعال شد.' @@ -8,6 +10,10 @@ placeholderapi: guide: locked: 'قفل شده است' work-in-progress: 'اين قابليت هنوز کامل نشده!' + locked-itemgroup: + - 'براي باز کردن اين گروه شما بايد' + - 'نیاز به باز کردن قفل همه موارد از' + - 'دسته های زیر' search: message: '&bدوست دارید دنبال چه چیزی بگردید?' name: '&7جست و جو...' @@ -16,6 +22,7 @@ guide: tooltips: open-itemgroup: 'براي باز کردن کليک کنيد' versions-notice: 'این موارد هنگام گزارش باگ بسیار مهم هستند!' + wiki: 'این آیتم را در ویکی رسمی Slimefun مشاهده کنید' pages: previous: 'صفحه ي قبل' next: 'صفحه ی بعد' @@ -23,7 +30,17 @@ guide: title: 'برگشت' settings: 'به صفحه تنظیمات بازگرد' languages: + selected-language: 'در حال حاضر انتخاب شده:' + select: 'برای انتخاب این زبان کلیک کنید' + select-default: 'برای انتخاب زبان پیش فرض کلیک کنید' + change: 'برای انتخاب زبان جدید کلیک کنید' + description: + - '&7اکنون این گزینه را دارید که تغییر دهید' + - '&7زبان در Slimefun' + - '&7به شما ارائه خواهد شد. آیتم ها' + - '&7فعلا قابل ترجمه نیست.' translations: + name: '&aچیزی فراموش شده است?' lore: 'برای افزودن ترجمه خود کلیک کنید' title: main: 'راهنمای Slimefun' @@ -32,16 +49,28 @@ guide: source: 'کد منبع' credits: roles: + developer: '&6توسعه دهندگان' wiki: '&3ویرایش کننده ویکی' + resourcepack: '&cهنرمند بسته منابع' translator: '&9مترجم' messages: + hungry: '&cشما برای انجام این کار زیادی گرسنه هستید! برای انجام آن نوار گرسنگی خود را پر کنید!' disabled-in-world: '&4&lاين آيتم در این جهان غير فعال شده است' + soulbound-rune: + fail: '&cشما نمی توانید چند وسیله را به طور همزمان به روح خود متصل کنید.' + success: '&aشما با موفقیت این مورد را به روح خود متصل کردید! در صورت مردن شما این وسیله را از دست نمی دهید.' + tape-measure: + distance: '&7اندازه گیری انجام شده. &eفاصله: %distance%' no-pvp: '&cشما نمی توانید در اینجا مبارزه کنید!' link-prompt: '&eاینجا کلیک کنید:' machines: + ELEVATOR: + no-destinations: '&4مقصدی پیدا نشد' TELEPORTER: teleporting: '&3درحال جا به جایی...' teleported: '&3جا به جا شدی!' + gui: + time: 'زمان تخمین زده شده' CARGO_NODES: connected: '&2وصل است!' not-connected: '&4وصل نیست!' @@ -61,9 +90,16 @@ languages: it: 'ایتالیایی' es: 'اسپانیایی' nl: 'هلندی' + cs: 'کشور چک' hu: 'مجارستانی' ru: 'روسی' + zh-TW: 'چینی (تایوان)' + vi: 'ویتنامی' + id: 'اندونزیایی' el: 'یونانی' + he: 'عبری' + pt: 'پرتغالی (پرتغال)' + pt-BR: 'پرتغالی (برزیل)' ar: 'عربی' da: 'دانمارکی' fi: 'فنلاندی' @@ -72,3 +108,6 @@ languages: 'no': 'نروژی' ja: 'ژاپنی' fa: 'فارسی' + th: 'تایلندی' + tl: 'تاگالوگی' + ro: 'رومانیایی' diff --git a/src/main/resources/languages/fa/researches.yml b/src/main/resources/languages/fa/researches.yml index 9a9a636ac..f83ffd2bb 100644 --- a/src/main/resources/languages/fa/researches.yml +++ b/src/main/resources/languages/fa/researches.yml @@ -18,7 +18,9 @@ slimefun: solar_panel_and_helmet: نیروی خورشیدی cactus_armor: کت و شلوار کاکتوس slimefun_metals: فلزات جدید + magic_workbench: میز کار جادویی gold_carats: طلای خالص + lava_crystal: موقعیت آتشین gilded_iron: آهن براق synthetic_emerald: جواهر تقلبی hazmat_suit: لباس ضد آتش @@ -28,6 +30,7 @@ slimefun: 24k_gold_block: شهر طلایی backpacks: کوله پشتی ها juicer: نوشیدنی های خوشمزه + more_enhanced_furnaces: کوره های بهتر carbonado_furnace: کوره لبه دار کربونادو block_placer: بلوک گذار scroll_of_dimensional_teleposition: چرخاندن چیزها @@ -44,12 +47,20 @@ slimefun: oil: نفت fuel: سوخت hologram_projector: هولوگرام ها + solar_generators: نیروگاه خورشیدی + electric_furnaces: کوره برقی electric_ore_grinding: خرد کردن و آسیاب کردن + bio_reactor: راکتور زیستی elevator: آسانسورها + nuclear_reactor: نیروگاه هسته ای trash_can: اشغال elytra: بال special_elytras: بال مخصوص trident: نیزه سه شاخه + lava_generator: مولد گدازه auto_drier: یک روز خشک + diet_cookie: کوکی رژیمی + tree_growth_accelerator: درختان سریعتر lead_clothing: لباس سرب tape_measure: نوار اندازه گیری + bee_armor: زره زنبوری diff --git a/src/main/resources/languages/ja/messages.yml b/src/main/resources/languages/ja/messages.yml index 93c5cacf2..43a343ae1 100644 --- a/src/main/resources/languages/ja/messages.yml +++ b/src/main/resources/languages/ja/messages.yml @@ -147,6 +147,7 @@ messages: piglin-barter: '&4Slimefunアイテムはピグリンとの物々交換に使用できません' bee-suit-slow-fall: '&e蜂の羽が着地を安全でゆっくりにした' deprecated-item: '&4このアイテムは廃止予定です。近日中にSlimefunから削除されます。' + researching-is-disabled: '%cこのサーバーではリサーチが無効化されていました。すべてがデフォルトでアンロックされました!' multi-tool: mode-change: '&b%device% モード変更: &9%mode%' not-shears: '&cMulti Toolはハサミとして利用できません!' @@ -257,6 +258,7 @@ machines: pick-a-floor: '&3- 行先の選択 -' current-floor: '&e現在の階:' click-to-teleport: '&eクリック&7でこの階に移動:' + editor-title: 'エレベーターの設定' TELEPORTER: teleporting: '&3テレポート中…' teleported: '&3テレポート完了!' @@ -272,6 +274,7 @@ machines: waypoints: 'ウェイポイント一覧' CARGO_NODES: must-be-placed: '&4チェストや機械に対して設置してください!' + not-connected: '&4接続されていません!' INDUSTRIAL_MINER: no-fuel: '&cIndustrial Minerは燃料切れです!上のチェストに燃料を補充してください。' piston-facing: '&cIndustrial Minerのピストンは上向きに設置してください!' @@ -301,6 +304,8 @@ cauldron: no-discoloring: '&4Slimefunアイテムの脱色はできません' gps: deathpoint: '&4死亡地点 &7%date%' + status-online: 'オンライン' + status-offline: 'オフライン' waypoint: new: '&eウェイポイント名をチャットで入力してください&7(カラーコード対応)' added: '&a新しいウェイポイントを登録しました' diff --git a/src/main/resources/languages/ja/researches.yml b/src/main/resources/languages/ja/researches.yml index 54fd472da..00b4bc8e7 100644 --- a/src/main/resources/languages/ja/researches.yml +++ b/src/main/resources/languages/ja/researches.yml @@ -153,10 +153,10 @@ slimefun: electric_ore_grinding: 粉砕粉砕 heated_pressure_chamber: 加熱圧力室Ⅰ coal_generator: 火力発電所 - bio_reactor: バイオマス発電所 + bio_reactor: バイオリアクター auto_enchanting: エンチャント操作術 - auto_anvil: 電動修理術 - multimeter: マルチメーター + auto_anvil: 自動金床 + multimeter: 電力計測 gps_setup: GPS時代の夜明け gps_emergency_transmitter: 緊急戦線復帰 programmable_androids: アンドロイド @@ -250,7 +250,7 @@ slimefun: iron_golem_assembler: 人造アイアンゴーレム villager_rune: 村人の初期化 elytra_cap: 衝撃緩和装備 - bee_armor: 蜂アーマー + bee_armor: 養蜂用防護服 book_binder: エンチャントの本の製本 auto_crafting: 自動クラフト produce_collector: 自動搾乳 diff --git a/src/main/resources/languages/pt/researches.yml b/src/main/resources/languages/pt/researches.yml index ed97d539c..e590cf417 100644 --- a/src/main/resources/languages/pt/researches.yml +++ b/src/main/resources/languages/pt/researches.yml @@ -1 +1,21 @@ --- +slimefun: + fortune_cookie: Bolinho da sorte + portable_dustbin: Caixote do Lixo Portátil + meat_jerky: Jerky de Carne + magic_sugar: Açúcar Mágico + monster_jerky: Jerky de Monstro + slime_armor: Armadura de Slime + sword_of_beheading: Espada da Decapitação + parachute: Pára-quedas + grappling_hook: Gancho-arpão + jetpacks: Jetpack + slimefun_metals: Metais Novos + carbonado: Diamantes Negros + synthetic_emerald: Jóia Falsa + chainmail_armor: Armadura de Malha + uranium: Radioativo + crushed_ore: Purificação de Minérios + first_aid: Primeiros socorros + gold_armor: Armadura Brilhante + backpacks: Mochilas diff --git a/src/main/resources/languages/ro/categories.yml b/src/main/resources/languages/ro/categories.yml index ed97d539c..2333e476e 100644 --- a/src/main/resources/languages/ro/categories.yml +++ b/src/main/resources/languages/ro/categories.yml @@ -1 +1,23 @@ --- +slimefun: + weapons: 'Arme' + food: 'Mâncare' + basic_machines: 'Maşinarii de bază' + electricity: 'Energie şi electricitate' + androids: 'Androizi programabili' + gps: 'Mașinarii GPS' + armor: 'Armură' + magical_items: 'Obiecte Magice' + magical_gadgets: 'Gadget-uri Magice' + misc: 'Obiecte Diverse' + technical_gadgets: 'Gadget-uri Tehnice' + resources: 'Resurse' + tech_misc: 'Componente Tehnice' + magical_armor: 'Armură Magică' + talismans: 'Talismane (nivelul I)' + ender_talismans: 'Talismane Ender (nivelul II)' + christmas: 'Crăciun (decembrie)' + valentines_day: 'Ziua Îndrăgostiților (14 februarie)' + easter: 'Paște (Aprilie)' + birthday: 'Ziua de naștere a lui TheBusyBiscuit (26 octombrie)' + halloween: 'Halloween (31 octombrie)' diff --git a/src/main/resources/languages/ro/messages.yml b/src/main/resources/languages/ro/messages.yml index 421d00e64..2990fecf4 100644 --- a/src/main/resources/languages/ro/messages.yml +++ b/src/main/resources/languages/ro/messages.yml @@ -1,4 +1,7 @@ --- +commands: + timings: + please-wait: '&eTe rugam sa astepti o secunda... Rezultatele se incarca!' placeholderapi: profile-loading: 'Se încarcă...' guide: @@ -8,38 +11,90 @@ guide: name: '&7Cauta...' tooltip: '&bClick pentru a căuta un obiect' inventory: 'Caută pentru: %item%' + tooltips: + versions-notice: 'Acestea sunt foarte importante atunci când raportezi problemele!' + wiki: 'Vezi acest articol pe Wiki-ul Slimefun Oficial' pages: previous: 'Pagina anterioară' next: 'Pagina următoare' back: guide: 'Inapoi la Ghidul Slimefun' languages: + selected-language: 'Selectare actuală:' + select: 'Click pentru a selecta această limbă' + select-default: 'Click pentru a selecta limba implicita' + change: 'Click pentru a selecta o nouă limbă' translations: name: '&aLipseste ceva?' + lore: 'Click pentru a adăuga propria ta traducere' title: main: 'Ghid Slimefun' settings: 'Setări și informații' + languages: 'Selectați limba preferată' + credits: 'Contribuitori Slimefun4' + wiki: 'Wiki Slimefun4' + addons: 'Addons pentru Slimefun4' bugs: 'Raportare Buguri' + source: 'Cod sursă' versions: 'Versiuni instalate' + credits: + commit: 'Commit' + commits: 'Commit-uri' + profile-link: 'Faceți clic pentru a le vizita profilul pe GitHub' + open: 'Click pentru a vedea contribuitorii noștri' + roles: + developer: '&6Dezvoltator' + wiki: '&3Editor Wiki' + resourcepack: '&cArtist Resurse' + translator: '&9Traducator' messages: + not-researched: '&4Nu ai suficiente cunostinte pentru a intelege acest obiect. &cVa trebui sa deblochezi &f"%item%&f"' + not-enough-xp: '&4Nu ai suficient XP pentru a debloca acest obiect' + unlocked: '&bAi deblocat &7"%research%"' + only-players: '&4Aceasta comanda este doar pentru jucatori' link-prompt: '&eClick aici:' +machines: + TELEPORTER: + teleporting: '&3Teleportare...' + teleported: '&3Teleportat!' + cancelled: '&4Teleportare anulata!' + invulnerability: '&b&lAi primit 30 de secunde de Invulnerabilitate!' + gui: + title: 'Punctele tale de referinta' + tooltip: 'Click pentru teleportare' + time: 'Timp estimat' languages: en: 'Engleză' de: 'Germană' fr: 'Franceză' it: 'Italiană' es: 'Spaniolă' + pl: 'Poloneză' sv: 'Suedeză' nl: 'Olandeză' cs: 'Cehă' hu: 'Maghiară' + lv: 'Letonă' ru: 'Rusă' sk: 'Slovacă' + zh-CN: 'Chineză (China)' + zh-TW: 'Chineză (Taiwan)' vi: 'Vietnameză' id: 'Indoneziană' el: 'Greacă' he: 'Ebraică' + pt: 'Portugheză (Portugalia)' ar: 'Arabă' fi: 'Finlandeză' uk: 'Ucraineană' + ja: 'Japoneză' + fa: 'Persiană' + th: 'Tailandeza' + tl: 'Tagalog' + ro: 'Română' + bg: 'Bulgară' + ko: 'Coreeană' + hr: 'Croată' + mk: 'Macedoneană' + sr: 'Sârbă' be: 'Belarusă' diff --git a/src/main/resources/languages/ro/researches.yml b/src/main/resources/languages/ro/researches.yml index ed97d539c..c285f2f0c 100644 --- a/src/main/resources/languages/ro/researches.yml +++ b/src/main/resources/languages/ro/researches.yml @@ -1 +1,7 @@ --- +slimefun: + walking_sticks: Baston + portable_crafter: Masă de fabricare portabilă + portable_dustbin: Dustbin portabil + meat_jerky: Bucati de carne uscata + armor_forge: Masa de fabricare Armuri diff --git a/src/main/resources/languages/sk/researches.yml b/src/main/resources/languages/sk/researches.yml index d2eb91478..a26260815 100644 --- a/src/main/resources/languages/sk/researches.yml +++ b/src/main/resources/languages/sk/researches.yml @@ -1,7 +1,7 @@ --- slimefun: walking_sticks: Vychádzkové paličky - portable_crafter: Prenosný crafter + portable_crafter: Prenosný pracovný stôl fortune_cookie: Koláčik šťastia portable_dustbin: Prenosný kôš meat_jerky: Sušené mäso @@ -13,14 +13,14 @@ slimefun: magic_eye_of_ender: Magiké Oko Endu magic_sugar: Magický cukor monster_jerky: Sušené mäso z monštier - slime_armor: Slime brnenie + slime_armor: Slizové brnenie sword_of_beheading: Meč popráv basic_circuit_board: Základná obvodová doska advanced_circuit_board: Pokročilá obvodová doska smeltery: Taviareň steel: Vek ocele misc_power_items: Dôležité veci súvisiace s energiou - battery: Tvoja prvá baterka + battery: Tvoja prvá batéria steel_plate: Oceľové pokovovanie steel_thruster: Oceľová tryska parachute: Padák From 70cfb0dea175e48ee9bd03d73cc3956e936130d1 Mon Sep 17 00:00:00 2001 From: Speebr0 <100388782+Speebr0@users.noreply.github.com> Date: Fri, 12 Aug 2022 02:05:53 -0700 Subject: [PATCH 025/146] "Fixing" Dust Order Literally just put the silver dust before the lead dust, just like the silver ingot is before the lead ingot in the guide, a dumb, small issue that was bugging me. --- .../slimefun4/implementation/setup/SlimefunItemSetup.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index d64323ef9..bccb16aee 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -531,12 +531,12 @@ public final class SlimefunItemSetup { new SlimefunItem(itemGroups.resources, SlimefunItems.TIN_DUST, RecipeType.ORE_WASHER, new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) .register(plugin); - - new SlimefunItem(itemGroups.resources, SlimefunItems.LEAD_DUST, RecipeType.ORE_WASHER, + + new SlimefunItem(itemGroups.resources, SlimefunItems.SILVER_DUST, RecipeType.ORE_WASHER, new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) .register(plugin); - new SlimefunItem(itemGroups.resources, SlimefunItems.SILVER_DUST, RecipeType.ORE_WASHER, + new SlimefunItem(itemGroups.resources, SlimefunItems.LEAD_DUST, RecipeType.ORE_WASHER, new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) .register(plugin); From c71722a3ff2a8ce751f388713d67290f2b70d52b Mon Sep 17 00:00:00 2001 From: Speebr0 <100388782+Speebr0@users.noreply.github.com> Date: Fri, 12 Aug 2022 16:03:40 -0700 Subject: [PATCH 026/146] Update src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java Dunno what it actually does, seems to remove empty space in line 534 Co-authored-by: svr333 --- .../slimefun4/implementation/setup/SlimefunItemSetup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index bccb16aee..53e82930b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -531,7 +531,7 @@ public final class SlimefunItemSetup { new SlimefunItem(itemGroups.resources, SlimefunItems.TIN_DUST, RecipeType.ORE_WASHER, new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) .register(plugin); - + new SlimefunItem(itemGroups.resources, SlimefunItems.SILVER_DUST, RecipeType.ORE_WASHER, new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) .register(plugin); From 0b6a81aa4db75092f88251b9af94f8973927ef80 Mon Sep 17 00:00:00 2001 From: The Busy Bot Date: Sat, 13 Aug 2022 19:29:15 +0200 Subject: [PATCH 027/146] [CI skip] New locale updates from Crowdin --- src/main/resources/languages/zh-CN/recipes.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/languages/zh-CN/recipes.yml b/src/main/resources/languages/zh-CN/recipes.yml index 57fe31d18..778c63d36 100644 --- a/src/main/resources/languages/zh-CN/recipes.yml +++ b/src/main/resources/languages/zh-CN/recipes.yml @@ -22,10 +22,10 @@ slimefun: - '如合成表所示' - '使用磨石制作' smeltery: - name: '冶炼机 (Smeltery)' + name: '冶炼炉 (Smeltery)' lore: - '如合成表所示' - - '用冶炼机合成' + - '用冶炼炉合成' ore_crusher: name: '矿石粉碎机 (Ore Crusher)' lore: From 1a3b2e56ea3736178fed77694c9d51f6db8ad118 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Aug 2022 20:14:17 +0200 Subject: [PATCH 028/146] [CI skip] Update dependency org.mockito:mockito-core to v4.7.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a06f89969..5466bb6bd 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ org.mockito mockito-core - 4.6.1 + 4.7.0 test From 447e81f5736bdb300633ed1b9ce16511eae9576d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 18 Aug 2022 12:38:37 +0200 Subject: [PATCH 029/146] [CI skip] Update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.4.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5466bb6bd..f4ee24195 100644 --- a/pom.xml +++ b/pom.xml @@ -239,7 +239,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.0 + 3.4.1 ${project.basedir} From 90ddf88a683fa07974c6c3fe730e40355a53771c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 Aug 2022 12:32:46 +0200 Subject: [PATCH 030/146] [CI skip] Update hmarr/auto-approve-action action to v2.4.0 --- .github/workflows/auto-approve.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index a183eb596..55e0f5dc2 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Approve via actions - uses: hmarr/auto-approve-action@v2.2.1 + uses: hmarr/auto-approve-action@v2.4.0 if: github.actor == 'TheBusyBot' || github.actor == 'renovate[bot]' with: github-token: "${{ secrets.GITHUB_TOKEN }}" From fd12df83d5c47c210f1d5a041cc50544f0bd1b7a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 18 Sep 2022 13:53:45 +0200 Subject: [PATCH 031/146] [CI skip] Update dependency org.mockito:mockito-core to v4.8.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f4ee24195..63e432533 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ org.mockito mockito-core - 4.7.0 + 4.8.0 test From e0017850b74922aaa94808a89c77e12d7ee28f17 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 18 Sep 2022 13:54:48 +0200 Subject: [PATCH 032/146] [CI skip] Update dependency net.imprex:orebfuscator-api to v5.3.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 63e432533..1064c65f3 100644 --- a/pom.xml +++ b/pom.xml @@ -495,7 +495,7 @@ net.imprex orebfuscator-api - 5.2.6 + 5.3.0 provided From 5af46611a24cd2982edc6a997ba36e7f827a30cf Mon Sep 17 00:00:00 2001 From: The Busy Bot Date: Sun, 18 Sep 2022 14:17:52 +0200 Subject: [PATCH 033/146] [CI skip] New locale updates from Crowdin --- src/main/resources/languages/he/messages.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/resources/languages/he/messages.yml b/src/main/resources/languages/he/messages.yml index b659a3f56..a6294cdf1 100644 --- a/src/main/resources/languages/he/messages.yml +++ b/src/main/resources/languages/he/messages.yml @@ -146,6 +146,8 @@ messages: multimeter: '&bאחסון אנרגיה: &3%stored% &b/ &3%capacity%' piglin-barter: 'אתה לא יכול לסחור עם חזירונים באמצעות חפצי סליים פאן' bee-suit-slow-fall: '&eכנפי הדבורה שלך יעזרו לך להגיע לקרקע בצורה איטית ובטוחה' + deprecated-item: '&4פריט זה מיושן ויוסר מסליים פאן בקרוב.' + researching-is-disabled: '&cמחקר לא פעיל בשרת זה. לפי ברירת מחדל הכול פתוח!' multi-tool: mode-change: '&b%device% &9: המצב השתנה ל: %mode%' not-shears: '&c מולטי טול לא יכול לשמש כמזמרה!' @@ -256,6 +258,9 @@ machines: pick-a-floor: '&3- בחר קומה -' current-floor: '&e אתה נמצא כרגע על קומה:' click-to-teleport: '&eלחץ &7 כדי להשתגר לקומה:' + enter-name: '&7אנא הכנס את שם הרצפה הרצוי לצ''אט שלך. &f(קודי צבע נתמכים!)' + named: '&2 בהצלחה נקבע שם קומה זאת: &f%floor%' + editor-title: 'הגדר מעלית זו' TELEPORTER: teleporting: '&3משתגר....' teleported: '&3שוגר!' @@ -271,6 +276,8 @@ machines: waypoints: 'סקירת נקודות דרך' CARGO_NODES: must-be-placed: '&4חייב להיות מונח על תיבה או מכונה!' + connected: '&2מחובר!' + not-connected: '&4לא מחובר!' INDUSTRIAL_MINER: no-fuel: 'לכורה התעשייתית שלך אזל הדלק! שים את הדלק שלך בתיבה מעל.' piston-facing: '&cהכורה התעשייתי שלך דורש בוכנות מופנות כלפי מעלה!' @@ -300,6 +307,8 @@ cauldron: no-discoloring: '&4אתה לא יכול לשנות את הצבע של שריון סליים פאן' gps: deathpoint: "&4נקודת מוות\n&7%date%" + status-online: 'מקוון' + status-offline: 'לא מקוון' waypoint: new: '&eהקלד שם לנקודת הדרך החדשה שלך בצ''אט. (קודי צבע נתמכים!)' added: '&a נוסף בהצלחה נקודת דרך חדשה' @@ -399,3 +408,5 @@ languages: mk: 'מקדונית' sr: 'סרבית' be: 'בלארוסית' + si-LK: 'סינהאלית' + lt: 'ליטאית' From 8ecb91c7eb96f4d3c132314c6545eed2b7a005a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 03:03:19 +0200 Subject: [PATCH 034/146] [CI skip] Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.4.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1064c65f3..c8d2da4ab 100644 --- a/pom.xml +++ b/pom.xml @@ -191,7 +191,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.3.0 + 3.4.0 From 7a8d85453dc93ab0fe4f4ee10b8c5a6c5e09b40a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 17:35:31 +0200 Subject: [PATCH 035/146] [CI skip] Update dependency org.junit.jupiter:junit-jupiter to v5.9.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c8d2da4ab..b32ae68b4 100644 --- a/pom.xml +++ b/pom.xml @@ -382,7 +382,7 @@ org.junit.jupiter junit-jupiter - 5.9.0 + 5.9.1 test From ea029439ced5a6608a4ecb54a928d6eacfd26cd5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 12:11:39 +0200 Subject: [PATCH 036/146] [CI skip] Update dependency com.github.LoneDev6:itemsadder-api to v3.2.3-r8 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b32ae68b4..0b07ca0bf 100644 --- a/pom.xml +++ b/pom.xml @@ -481,7 +481,7 @@ com.github.LoneDev6 itemsadder-api - 3.2.3c + 3.2.3-r8 provided From 497a4af1c5c644f4d6b51dbdacea93816f2ad88d Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 29 Sep 2022 12:39:40 +0200 Subject: [PATCH 037/146] Fixed #3664 --- CHANGELOG.md | 1 + .../slimefun4/api/player/PlayerBackpack.java | 17 +++++++++++++++++ .../multiblocks/AbstractCraftingTable.java | 6 +++++- .../listeners/BackpackListener.java | 18 +++++++++++++----- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 462ee5fa2..14b65caf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ * Fixed an issue related to "Bee Wings" * Fixed #3573 * Fixed "round-robin" mode for cargo networks being very unreliable +* Fixed #3664 ## Release Candidate 32 (26 Jun 2022) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#32 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerBackpack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerBackpack.java index 5d942114f..5af1f1fe7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerBackpack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerBackpack.java @@ -1,10 +1,13 @@ package io.github.thebusybiscuit.slimefun4.api.player; import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; import javax.annotation.Nonnull; import org.bukkit.Bukkit; +import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -132,6 +135,20 @@ public class PlayerBackpack { }); } + /** + * This will close the {@link Inventory} of this backpack for every {@link Player} + * that has opened it. + */ + public void closeForAll() { + Slimefun.runSync(() -> { + Iterator iterator = new ArrayList<>(inventory.getViewers()).iterator(); + + while (iterator.hasNext()) { + iterator.next().closeInventory(); + } + }); + } + /** * This will change the current size of this Backpack to the specified size. * diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractCraftingTable.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractCraftingTable.java index c45a8c246..4adf57bc9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractCraftingTable.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractCraftingTable.java @@ -123,7 +123,11 @@ abstract class AbstractCraftingTable extends MultiBlockMachine { PlayerProfile.fromUUID(UUID.fromString(idSplit[0]), profile -> { Optional optional = profile.getBackpack(Integer.parseInt(idSplit[1])); - optional.ifPresent(playerBackpack -> playerBackpack.setSize(size)); + optional.ifPresent(playerBackpack -> { + // Safety feature for Issue #3664 + playerBackpack.closeForAll(); + playerBackpack.setSize(size); + }); }); return Optional.of(id); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java index 796f6917b..1650b0b42 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java @@ -96,6 +96,7 @@ public class BackpackListener implements Listener { if (backpack instanceof SlimefunBackpack slimefunBackpack) { if (e.getClick() == ClickType.NUMBER_KEY) { + // Prevent disallowed items from being moved using number keys. if (e.getClickedInventory().getType() != InventoryType.PLAYER) { ItemStack hotbarItem = e.getWhoClicked().getInventory().getItem(e.getHotbarButton()); @@ -103,12 +104,19 @@ public class BackpackListener implements Listener { e.setCancelled(true); } } - } else if (e.getClick() == ClickType.SWAP_OFFHAND && e.getClickedInventory().getType() != InventoryType.PLAYER) { - // Fixes #3265 - ItemStack offHandItem = e.getWhoClicked().getInventory().getItemInOffHand(); + } else if (e.getClick() == ClickType.SWAP_OFFHAND) { + if (e.getClickedInventory().getType() != InventoryType.PLAYER) { + // Fixes #3265 - Don't move disallowed items using the off hand. + ItemStack offHandItem = e.getWhoClicked().getInventory().getItemInOffHand(); - if (!isAllowed(slimefunBackpack, offHandItem)) { - e.setCancelled(true); + if (!isAllowed(slimefunBackpack, offHandItem)) { + e.setCancelled(true); + } + } else { + // Fixes #3664 - Do not swap the backpack to your off hand. + if (e.getCurrentItem() != null && e.getCurrentItem().isSimilar(item)) { + e.setCancelled(true); + } } } else if (!isAllowed(slimefunBackpack, e.getCurrentItem())) { e.setCancelled(true); From f9f3b3ddf98099a39907144d5b21244c966450f5 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 29 Sep 2022 13:04:31 +0200 Subject: [PATCH 038/146] Resolved #3455 and removed the Hercules Pickaxe --- CHANGELOG.md | 2 + .../items/tools/HerculesPickaxe.java | 71 ------------------- .../setup/SlimefunItemSetup.java | 5 -- 3 files changed, 2 insertions(+), 76 deletions(-) delete mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b65caf7..cf2011e70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ * "Connected / Not connected" messages for cargo nodes are now sent via the actionbar * "/sf stats" can no longer be used if researching is disabled * "/sf research" can no longer be used if researching is disabled +* Removed the Hercules Pickaxe from Slimefun #### Fixes * Fixed #3597 @@ -58,6 +59,7 @@ * Fixed #3573 * Fixed "round-robin" mode for cargo networks being very unreliable * Fixed #3664 +* Fixed #3651 ## Release Candidate 32 (26 Jun 2022) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#32 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java deleted file mode 100644 index ddada272a..000000000 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java +++ /dev/null @@ -1,71 +0,0 @@ -package io.github.thebusybiscuit.slimefun4.implementation.items.tools; - -import javax.annotation.Nonnull; -import javax.annotation.ParametersAreNonnullByDefault; - -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; - -import io.github.bakedlibs.dough.items.CustomItemStack; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; -import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; -import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; -import io.github.thebusybiscuit.slimefun4.core.handlers.ToolUseHandler; -import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; -import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; -import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; - -@Deprecated -public class HerculesPickaxe extends SimpleSlimefunItem { - - @ParametersAreNonnullByDefault - public HerculesPickaxe(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { - super(itemGroup, item, recipeType, recipe); - } - - @Override - public @Nonnull ToolUseHandler getItemHandler() { - return (e, tool, fortune, drops) -> { - - sendDeprecationWarning(e.getPlayer()); - - Material mat = e.getBlock().getType(); - - if (SlimefunTag.ORES.isTagged(mat)) { - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { - switch (mat) { - case DEEPSLATE_IRON_ORE: - drops.add(new CustomItemStack(SlimefunItems.IRON_DUST, 2)); - break; - case DEEPSLATE_GOLD_ORE: - drops.add(new CustomItemStack(SlimefunItems.GOLD_DUST, 2)); - break; - case COPPER_ORE: - case DEEPSLATE_COPPER_ORE: - drops.add(new CustomItemStack(SlimefunItems.COPPER_DUST, 2)); - break; - default: - break; - } - } - - switch (mat) { - case IRON_ORE: - drops.add(new CustomItemStack(SlimefunItems.IRON_DUST, 2)); - break; - case GOLD_ORE: - drops.add(new CustomItemStack(SlimefunItems.GOLD_DUST, 2)); - break; - default: - for (ItemStack drop : e.getBlock().getDrops(tool)) { - drops.add(new CustomItemStack(drop, drop.getAmount() * 2)); - } - break; - } - } - }; - } - -} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 53e82930b..c088052a5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -195,7 +195,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.tools.ExplosivePi import io.github.thebusybiscuit.slimefun4.implementation.items.tools.ExplosiveShovel; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.GoldPan; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.GrapplingHook; -import io.github.thebusybiscuit.slimefun4.implementation.items.tools.HerculesPickaxe; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.LumberAxe; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.NetherGoldPan; import io.github.thebusybiscuit.slimefun4.implementation.items.tools.PickaxeOfContainment; @@ -1031,10 +1030,6 @@ public final class SlimefunItemSetup { new PickaxeOfContainment(itemGroups.tools, SlimefunItems.PICKAXE_OF_CONTAINMENT, RecipeType.MAGIC_WORKBENCH, new ItemStack[] {SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, null, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) .register(plugin); - - new HerculesPickaxe(itemGroups.tools, SlimefunItems.HERCULES_PICKAXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); new TableSaw(itemGroups.basicMachines, SlimefunItems.TABLE_SAW).register(plugin); From 73db0212d9a0ef459efa48a6667394a3d7d9423e Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 29 Sep 2022 13:05:16 +0200 Subject: [PATCH 039/146] Fixed #3651 --- .../items/multiblocks/TableSaw.java | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/TableSaw.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/TableSaw.java index 7af545e01..0e920cbe0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/TableSaw.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/TableSaw.java @@ -44,7 +44,13 @@ public class TableSaw extends MultiBlockMachine { @ParametersAreNonnullByDefault public TableSaw(ItemGroup group, SlimefunItemStack item) { - super(group, item, new ItemStack[] { null, null, null, new ItemStack(Material.SMOOTH_STONE_SLAB), new ItemStack(Material.STONECUTTER), new ItemStack(Material.SMOOTH_STONE_SLAB), null, new ItemStack(Material.IRON_BLOCK), null }, BlockFace.SELF); + // @formatter:off + super(group, item, new ItemStack[] { + null, null, null, + new ItemStack(Material.SMOOTH_STONE_SLAB), new ItemStack(Material.STONECUTTER), new ItemStack(Material.SMOOTH_STONE_SLAB), + null, new ItemStack(Material.IRON_BLOCK), null + }, BlockFace.SELF); + // @formatter:on for (Material log : Tag.LOGS.getValues()) { Optional planks = getPlanks(log); @@ -61,10 +67,29 @@ public class TableSaw extends MultiBlockMachine { } } + /** + * This method returns the corresponding plank {@link Material} for a given wood {@link Material}. + * The result is wrapped by an {@link Optional}. + *

+ * {@literal Material.OAK_LOG} for example will return {@literal Material.OAK_PLANKS}. + * + * @param log + * The log type. + * + * @return An {@link Optional} containing the corresponding plank type (or an empty {@link Optional}) + */ private @Nonnull Optional getPlanks(@Nonnull Material log) { String materialName = log.name().replace("STRIPPED_", ""); - materialName = materialName.substring(0, materialName.lastIndexOf('_')) + "_PLANKS"; - return Optional.ofNullable(Material.getMaterial(materialName)); + int endIndex = materialName.lastIndexOf('_'); + + if (endIndex > 0) { + materialName = materialName.substring(0, endIndex) + "_PLANKS"; + return Optional.ofNullable(Material.getMaterial(materialName)); + } else { + // Fixed #3651 - Do not panic because of one weird wood type. + warn("Could not find a corresponding plank for wood type: '" + log.name() + "'"); + return Optional.empty(); + } } @Override From 636008dcb32f2f76ba8cb80d3a538cdf68a1a3fb Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 29 Sep 2022 13:38:41 +0200 Subject: [PATCH 040/146] Removed research for the Hercules Pickaxe --- CHANGELOG.md | 1 + .../slimefun4/implementation/SlimefunItems.java | 4 ---- .../slimefun4/implementation/setup/ResearchSetup.java | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf2011e70..a88f2f3f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ * (API) Added a method for item groups to allow addons to choose if they want to allow items from other addons * Added a new option to Eletric Gold Pans: "override-output-limit" * Added "Mud -> Clay" recipe to the Auto Drier +* Added a third tier for Freezers #### Changes * Tree Growth Accelerators can now actually cause the Tree to fully grow (1.17+ only) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index 8869dc412..4c335f4e7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -204,7 +204,6 @@ public final class SlimefunItems { public static final SlimefunItemStack SMELTERS_PICKAXE = new SlimefunItemStack("SMELTERS_PICKAXE", Material.DIAMOND_PICKAXE, "&6Smelter's Pickaxe", "&c&lAuto-Smelting", "", "&9Works with Fortune"); public static final SlimefunItemStack LUMBER_AXE = new SlimefunItemStack("LUMBER_AXE", Material.DIAMOND_AXE, "&6Lumber Axe", "&a&oCuts down the whole Tree..."); public static final SlimefunItemStack PICKAXE_OF_CONTAINMENT = new SlimefunItemStack("PICKAXE_OF_CONTAINMENT", Material.IRON_PICKAXE, "&cPickaxe of Containment", "", "&9Can pickup Spawners"); - public static final SlimefunItemStack HERCULES_PICKAXE = new SlimefunItemStack("HERCULES_PICKAXE", Material.IRON_PICKAXE, "&9Hercules' Pickaxe", "", "&4DEPRECATED - Will be removed soon", "", "&fSo powerful that it", "&fcrushes all mined Ores", "&finto Dust..."); public static final SlimefunItemStack EXPLOSIVE_PICKAXE = new SlimefunItemStack("EXPLOSIVE_PICKAXE", Material.DIAMOND_PICKAXE, "&eExplosive Pickaxe", "", "&fAllows you to mine a good bit", "&fof Blocks at once...", "", "&9Works with Fortune"); public static final SlimefunItemStack EXPLOSIVE_SHOVEL = new SlimefunItemStack("EXPLOSIVE_SHOVEL", Material.DIAMOND_SHOVEL, "&eExplosive Shovel", "", "&fAllows you to mine a good bit", "&fof diggable Blocks at once..."); public static final SlimefunItemStack PICKAXE_OF_THE_SEEKER = new SlimefunItemStack("PICKAXE_OF_THE_SEEKER", Material.DIAMOND_PICKAXE, "&aPickaxe of the Seeker", "&fWill always point you to the nearest Ore", "&fbut might get damaged when doing it", "", "&7&eRight Click&7 to be pointed to the nearest Ore"); @@ -213,9 +212,6 @@ public final class SlimefunItems { public static final SlimefunItemStack CLIMBING_PICK = new SlimefunItemStack("CLIMBING_PICK", Material.IRON_PICKAXE, "&bClimbing Pick", "", "&fAllows you to climb certain surfaces", "&fby right-clicking.", "&fEnchant this pick with Efficiency to", "&fclimb even faster!"); static { - HERCULES_PICKAXE.addUnsafeEnchantment(Enchantment.DURABILITY, 5); - HERCULES_PICKAXE.addUnsafeEnchantment(Enchantment.DIG_SPEED, 3); - COBALT_PICKAXE.addUnsafeEnchantment(Enchantment.DURABILITY, 10); COBALT_PICKAXE.addUnsafeEnchantment(Enchantment.DIG_SPEED, 6); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java index 4635c1b4d..b54762521 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java @@ -113,7 +113,6 @@ public final class ResearchSetup { register("gold_armor", 87, "Shiny Armor", 13, SlimefunItems.GOLDEN_HELMET_12K, SlimefunItems.GOLDEN_CHESTPLATE_12K, SlimefunItems.GOLDEN_LEGGINGS_12K, SlimefunItems.GOLDEN_BOOTS_12K); register("night_vision_googles", 89, "Night Vision Goggles", 10, SlimefunItems.NIGHT_VISION_GOGGLES); register("pickaxe_of_containment", 90, "Pickaxe of Containment", 14, SlimefunItems.PICKAXE_OF_CONTAINMENT, SlimefunItems.BROKEN_SPAWNER); - register("hercules_pickaxe", 91, "Hercules Pickaxe", 28, SlimefunItems.HERCULES_PICKAXE); register("table_saw", 92, "Table Saw", 4, SlimefunItems.TABLE_SAW); register("slime_steel_armor", 93, "Slimy Steel Armor", 27, SlimefunItems.SLIME_HELMET_STEEL, SlimefunItems.SLIME_CHESTPLATE_STEEL, SlimefunItems.SLIME_LEGGINGS_STEEL, SlimefunItems.SLIME_BOOTS_STEEL); register("blade_of_vampires", 94, "Blade of Vampires", 26, SlimefunItems.BLADE_OF_VAMPIRES); From 9ef5f991c2959e37ea7f1427b5b1b4a6a9903ff7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 13:50:40 +0200 Subject: [PATCH 041/146] [CI skip] Update actions/setup-java action to v3.5.1 --- .github/workflows/discord-webhook.yml | 2 +- .github/workflows/maven-compiler.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index fce2d4657..3e874e993 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v3.0.2 - name: Set up Java JDK 17 - uses: actions/setup-java@v3.4.1 + uses: actions/setup-java@v3.5.1 with: distribution: 'adopt' java-version: '17' diff --git a/.github/workflows/maven-compiler.yml b/.github/workflows/maven-compiler.yml index ee43ea34f..99aa5e949 100644 --- a/.github/workflows/maven-compiler.yml +++ b/.github/workflows/maven-compiler.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v3 - name: Set up JDK 17 - uses: actions/setup-java@v3.4.1 + uses: actions/setup-java@v3.5.1 with: distribution: 'adopt' java-version: '17' diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index b7d75e8f5..54380d8ea 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v3.4.1 + uses: actions/setup-java@v3.5.1 with: distribution: 'adopt' java-version: '17' From 9f01ec03b3acddb4ce8ed8fde3a9754de85a1c5e Mon Sep 17 00:00:00 2001 From: TheWireLord Date: Thu, 29 Sep 2022 08:02:51 -0400 Subject: [PATCH 042/146] Update src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java Co-authored-by: TheBusyBiscuit --- .../implementation/items/electric/generators/BioGenerator.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java index 3e5229375..58b0136e3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java @@ -54,7 +54,6 @@ public class BioGenerator extends AGenerator { registerFuel(new MachineFuel(2, new ItemStack(Material.SEA_PICKLE))); registerFuel(new MachineFuel(1, new ItemStack(Material.BAMBOO))); registerFuel(new MachineFuel(2, new ItemStack(Material.SWEET_BERRIES))); - registerFuel(new MachineFuel(2, new ItemStack(Material.GLOW_BERRIES))); registerFuel(new MachineFuel(2, new ItemStack(Material.COCOA_BEANS))); registerFuel(new MachineFuel(3, new ItemStack(Material.BEETROOT))); registerFuel(new MachineFuel(3, new ItemStack(Material.BEETROOT_SEEDS))); From aa8d8236322ef0333a86d8802e96835aac9cc882 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 17:49:33 +0200 Subject: [PATCH 043/146] [CI skip] Update dependency com.konghq:unirest-java to v3.13.11 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0b07ca0bf..3f005ab24 100644 --- a/pom.xml +++ b/pom.xml @@ -366,7 +366,7 @@ com.konghq unirest-java - 3.13.10 + 3.13.11 compile From 477a0552c0d6512da9ee1781cf93709f34af11af Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 29 Sep 2022 17:58:46 +0200 Subject: [PATCH 044/146] [CI skip] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a88f2f3f5..e4a9a61a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ * Added a new option to Eletric Gold Pans: "override-output-limit" * Added "Mud -> Clay" recipe to the Auto Drier * Added a third tier for Freezers +* Added Glow Berry Juice #### Changes * Tree Growth Accelerators can now actually cause the Tree to fully grow (1.17+ only) From 317a92bd69a9f7429da333b64e84cfee1428ca9c Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Fri, 30 Sep 2022 20:54:33 +0200 Subject: [PATCH 045/146] fix 3577 --- .../items/androids/WoodcutterAndroid.java | 12 ++++++++++++ .../implementation/listeners/BackpackListener.java | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java index 55f29b6c3..240e989d9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java @@ -159,6 +159,18 @@ public class WoodcutterAndroid extends ProgrammableAndroid { } } + if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_19)) { + switch (logType) { + case MANGROVE_LOG: + case STRIPPED_MANGROVE_LOG: + saplingType = Material.MANGROVE_PROPAGULE; + soilRequirement = SlimefunTag.DIRT_VARIANTS::isTagged; + break; + default: + break; + } + } + if (saplingType != null && soilRequirement != null) { if (soilRequirement.test(block.getRelative(BlockFace.DOWN).getType())) { // Replant the block diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java index a3ff32e05..3f06cacd6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java @@ -155,6 +155,10 @@ public class BackpackListener implements Listener { p.closeInventory(); } + if (p.getInventory().getItemInMainHand() == item) { + return; + } + // Check if someone else is currently viewing this backpack if (!backpacks.containsValue(item)) { p.playSound(p.getLocation(), Sound.ENTITY_HORSE_ARMOR, 1F, 1F); From 501c7ba85ad9fe32ccc6436464aba2fc4a36e646 Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Fri, 30 Sep 2022 20:56:13 +0200 Subject: [PATCH 046/146] whoops --- .../slimefun4/implementation/listeners/BackpackListener.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java index 3f06cacd6..a3ff32e05 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java @@ -155,10 +155,6 @@ public class BackpackListener implements Listener { p.closeInventory(); } - if (p.getInventory().getItemInMainHand() == item) { - return; - } - // Check if someone else is currently viewing this backpack if (!backpacks.containsValue(item)) { p.playSound(p.getLocation(), Sound.ENTITY_HORSE_ARMOR, 1F, 1F); From b516e69e5c465e8cd1bb457b3b091a6bbde279d3 Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Fri, 30 Sep 2022 21:58:40 +0200 Subject: [PATCH 047/146] added mangrove tag --- .../implementation/items/androids/WoodcutterAndroid.java | 2 +- .../thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java | 6 ++++++ src/main/resources/tags/mangrove_grow_blocks.json | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/tags/mangrove_grow_blocks.json diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java index 240e989d9..6709b511b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java @@ -164,7 +164,7 @@ public class WoodcutterAndroid extends ProgrammableAndroid { case MANGROVE_LOG: case STRIPPED_MANGROVE_LOG: saplingType = Material.MANGROVE_PROPAGULE; - soilRequirement = SlimefunTag.DIRT_VARIANTS::isTagged; + soilRequirement = SlimefunTag.MANGROVE_GROW_BLOCKS::isTagged; break; default: break; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index 2cccb004d..6fadf7dfa 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -143,6 +143,12 @@ public enum SlimefunTag implements Tag { */ FUNGUS_SOIL, + /** + * All block types for mangrove to grow on. + * This includes all dirt variants, mud and clay. + */ + MANGROVE_GROW_BLOCKS, + /** * All variants of concrete powder. * Can you believe there is no tag for this already? diff --git a/src/main/resources/tags/mangrove_grow_blocks.json b/src/main/resources/tags/mangrove_grow_blocks.json new file mode 100644 index 000000000..14312fe4b --- /dev/null +++ b/src/main/resources/tags/mangrove_grow_blocks.json @@ -0,0 +1,7 @@ +{ + "values" : [ + "#slimefun:dirt_variants", + "minecraft:clay", + "minecraft:mud" + ] +} From 64c8dd571a4768f935f4b1c5cb3a2c425c0bc233 Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Sat, 1 Oct 2022 19:04:09 +0200 Subject: [PATCH 048/146] changed tag name --- .../implementation/items/androids/WoodcutterAndroid.java | 2 +- .../github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java index 6709b511b..21939d55a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java @@ -164,7 +164,7 @@ public class WoodcutterAndroid extends ProgrammableAndroid { case MANGROVE_LOG: case STRIPPED_MANGROVE_LOG: saplingType = Material.MANGROVE_PROPAGULE; - soilRequirement = SlimefunTag.MANGROVE_GROW_BLOCKS::isTagged; + soilRequirement = SlimefunTag.MANGROVE_BASE_BLOCKS::isTagged; break; default: break; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index 6fadf7dfa..aad324f04 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -147,7 +147,7 @@ public enum SlimefunTag implements Tag { * All block types for mangrove to grow on. * This includes all dirt variants, mud and clay. */ - MANGROVE_GROW_BLOCKS, + MANGROVE_BASE_BLOCKS, /** * All variants of concrete powder. From 61f549260fc99e933a00a6b7f6d5af22c9b936b1 Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Sat, 1 Oct 2022 19:10:27 +0200 Subject: [PATCH 049/146] forgot to change json name --- .../tags/{mangrove_grow_blocks.json => mangrove_base_blocks.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/tags/{mangrove_grow_blocks.json => mangrove_base_blocks.json} (100%) diff --git a/src/main/resources/tags/mangrove_grow_blocks.json b/src/main/resources/tags/mangrove_base_blocks.json similarity index 100% rename from src/main/resources/tags/mangrove_grow_blocks.json rename to src/main/resources/tags/mangrove_base_blocks.json From 485d212a1ee47611a08c7c92cfba0991480d153b Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 4 Oct 2022 10:46:51 +0200 Subject: [PATCH 050/146] [CI skip] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4a9a61a9..d43382816 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ * Fixed "round-robin" mode for cargo networks being very unreliable * Fixed #3664 * Fixed #3651 +* Fixed #3677 ## Release Candidate 32 (26 Jun 2022) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#32 From 475b27b48c0abdfed396c2a31ac0d81bf51961d6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 12:42:09 +0200 Subject: [PATCH 051/146] [CI skip] Update actions/checkout action to v3.1.0 --- .github/workflows/discord-webhook.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index 3e874e993..0ccb971a7 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.1.0 - name: Set up Java JDK 17 uses: actions/setup-java@v3.5.1 diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 54380d8ea..bbcb4ce38 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 From c40bf0d1d356358dfbbc147513c3e8ab5b82b40c Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Sun, 16 Oct 2022 14:03:43 +0200 Subject: [PATCH 052/146] tags --- .../core/networks/cargo/CargoUtils.java | 16 +-------- .../core/services/BlockDataService.java | 28 ++------------- .../autocrafters/AbstractAutoCrafter.java | 8 +---- .../implementation/items/blocks/Crucible.java | 5 ++- .../slimefun4/utils/tags/SlimefunTag.java | 19 ++++++++-- src/main/resources/tags/inventory_blocks.json | 13 +++++++ src/main/resources/tags/storage_blocks.json | 8 +++++ src/main/resources/tags/tile_entities.json | 35 +++++++++++++++++++ 8 files changed, 79 insertions(+), 53 deletions(-) create mode 100644 src/main/resources/tags/inventory_blocks.json create mode 100644 src/main/resources/tags/storage_blocks.json create mode 100644 src/main/resources/tags/tile_entities.json diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java index c3ea0aba9..91896ba1e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java @@ -69,21 +69,7 @@ final class CargoUtils { } Material type = block.getType(); - - // TODO: Add designated SlimefunTag - return switch (type) { - case CHEST, - TRAPPED_CHEST, - FURNACE, - DISPENSER, - DROPPER, - HOPPER, - BREWING_STAND, - BARREL, - BLAST_FURNACE, - SMOKER -> true; - default -> SlimefunTag.SHULKER_BOXES.isTagged(type); - }; + return SlimefunTag.INVENTORY_BLOCKS.isTagged(type); } @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java index 2dd6774ce..69c957928 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/BlockDataService.java @@ -6,6 +6,7 @@ import java.util.logging.Level; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; import org.bukkit.Keyed; @@ -137,32 +138,7 @@ public class BlockDataService implements Keyed { return false; } - // TODO: Add designated SlimefunTag - return switch (type) { - case PLAYER_HEAD, - PLAYER_WALL_HEAD, - CHEST, - DISPENSER, - BREWING_STAND, - DROPPER, - FURNACE, - BLAST_FURNACE, - HOPPER, - LECTERN, - JUKEBOX, - ENDER_CHEST, - ENCHANTING_TABLE, - DAYLIGHT_DETECTOR, - SMOKER, - BARREL, - SPAWNER, - BEACON -> - // All of the above Materials are Tile Entities - true; - default -> - // Otherwise we assume they're not Tile Entities - false; - }; + return SlimefunTag.TILE_ENTITIES.isTagged(type); } } \ No newline at end of file diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java index b5088ae59..eaf420f0c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java @@ -202,13 +202,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy protected boolean isValidInventory(@Nonnull Block block) { Material type = block.getType(); - // TODO: Add designated SlimefunTag - return switch (type) { - case CHEST, - TRAPPED_CHEST, - BARREL -> true; - default -> SlimefunTag.SHULKER_BOXES.isTagged(type); - }; + return SlimefunTag.STORAGE_BLOCKS.isTagged(type); } /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java index 575177c71..a26a517a4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java @@ -199,7 +199,7 @@ public class Crucible extends SimpleSlimefunItem implements Rec } private void placeLiquid(@Nonnull Block block, boolean water) { - if (block.getType() == Material.AIR || block.getType() == Material.CAVE_AIR || block.getType() == Material.VOID_AIR) { + if (block.getType().isAir()) { // Fixes #2903 - Cancel physics update to resolve weird overlapping block.setType(water ? Material.WATER : Material.LAVA, false); } else { @@ -220,14 +220,13 @@ public class Crucible extends SimpleSlimefunItem implements Rec @ParametersAreNonnullByDefault private void runPostTask(Block block, Sound sound, int times) { - if (!(block.getBlockData() instanceof Levelled)) { + if (!(block.getBlockData() instanceof Levelled le)) { block.getWorld().playSound(block.getLocation(), Sound.BLOCK_METAL_BREAK, 1F, 1F); return; } block.getWorld().playSound(block.getLocation(), sound, 1F, 1F); int level = 8 - times; - Levelled le = (Levelled) block.getBlockData(); le.setLevel(level); block.setBlockData(le, false); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index 848e2e7b6..e027231ec 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -260,9 +260,24 @@ public enum SlimefunTag implements Tag { GRAVITY_AFFECTED_BLOCKS, /** - * All wool carpets + * All wool carpets. */ - WOOL_CARPETS; + WOOL_CARPETS, + + /** + * All storage blocks. + */ + STORAGE_BLOCKS, + + /** + * All blocks with an inventory. + */ + INVENTORY_BLOCKS, + + /** + * All tile entities. + */ + TILE_ENTITIES; /** * Lookup table for tag names. diff --git a/src/main/resources/tags/inventory_blocks.json b/src/main/resources/tags/inventory_blocks.json new file mode 100644 index 000000000..4a21a42d3 --- /dev/null +++ b/src/main/resources/tags/inventory_blocks.json @@ -0,0 +1,13 @@ +{ + "values" : [ + "#slimefun:storage_blocks", + "minecraft:furnace", + "minecraft:dispenser", + "minecraft:dropper", + "minecraft:hopper", + "minecraft:brewing_stand", + "minecraft:blast_furnace", + "minecraft:smoker", + "minecraft:campfire" + ] +} \ No newline at end of file diff --git a/src/main/resources/tags/storage_blocks.json b/src/main/resources/tags/storage_blocks.json new file mode 100644 index 000000000..c71debd74 --- /dev/null +++ b/src/main/resources/tags/storage_blocks.json @@ -0,0 +1,8 @@ +{ + "values" : [ + "#slimefun:shulker_boxes", + "minecraft:chest", + "minecraft:trapped_chest", + "minecraft:barrel" + ] +} \ No newline at end of file diff --git a/src/main/resources/tags/tile_entities.json b/src/main/resources/tags/tile_entities.json new file mode 100644 index 000000000..bed61f165 --- /dev/null +++ b/src/main/resources/tags/tile_entities.json @@ -0,0 +1,35 @@ +{ + "values" : [ + "#minecraft:signs", + "#minecraft:banners", + "#minecraft:beds", + "minecraft:hopper", + "minecraft:brewing_stand", + "minecraft:blast_furnace", + "minecraft:smoker", + "minecraft:beacon", + "minecraft:spawner", + "minecraft:note_block", + "minecraft:jukebox", + "minecraft:enchanting_table", + "minecraft:end_portal", + "minecraft:ender_chest", + "minecraft:command_block", + "minecraft:structure_block", + "minecraft:end_gateway", + "minecraft:comparator", + "minecraft:conduit", + "minecraft:bell", + "minecraft:daylight_detector", + "minecraft:player_head", + "minecraft:player_wall_head", + { + "id" : "minecraft:soul_campfire", + "required" : false + }, + { + "id" : "minecraft:lectern", + "required" : false + } + ] +} \ No newline at end of file From 7dcd574db1a32e2ff68e08485edb9edd94476f69 Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Sun, 16 Oct 2022 14:10:32 +0200 Subject: [PATCH 053/146] smart to actually add the tag --- src/main/resources/tags/tile_entities.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/resources/tags/tile_entities.json b/src/main/resources/tags/tile_entities.json index bed61f165..b294fa159 100644 --- a/src/main/resources/tags/tile_entities.json +++ b/src/main/resources/tags/tile_entities.json @@ -3,10 +3,7 @@ "#minecraft:signs", "#minecraft:banners", "#minecraft:beds", - "minecraft:hopper", - "minecraft:brewing_stand", - "minecraft:blast_furnace", - "minecraft:smoker", + "#slimefun:inventory_blocks", "minecraft:beacon", "minecraft:spawner", "minecraft:note_block", From 3e776a7fbaf6d415dcaab8bcc085fbc41c348923 Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Mon, 17 Oct 2022 07:53:49 +0200 Subject: [PATCH 054/146] changed to enhanced for loop --- .../slimefun4/implementation/tasks/TickerTask.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java index d5fbc59b8..ae0c31735 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java @@ -100,14 +100,7 @@ public class TickerTask implements Runnable { } // Fixes #2576 - Remove any deleted instances of BlockStorage - Iterator worlds = Slimefun.getRegistry().getWorlds().values().iterator(); - while (worlds.hasNext()) { - BlockStorage storage = worlds.next(); - - if (storage.isMarkedForRemoval()) { - worlds.remove(); - } - } + Slimefun.getRegistry().getWorlds().values().removeIf(BlockStorage::isMarkedForRemoval); // Run our ticker code if (!halted) { From e7d766e22951bc5ec9b779e2bf524fdb539bda6a Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Mon, 17 Oct 2022 12:34:44 +0200 Subject: [PATCH 055/146] suggested changes --- .../slimefun4/core/networks/cargo/CargoUtils.java | 2 +- .../items/autocrafters/AbstractAutoCrafter.java | 2 +- .../slimefun4/utils/tags/SlimefunTag.java | 4 ++-- ...ocks.json => auto_crafter_supported_storage.json} | 0 ..._blocks.json => cargo_supported_inventories.json} | 8 +++++--- src/main/resources/tags/tile_entities.json | 12 +++++++++++- 6 files changed, 20 insertions(+), 8 deletions(-) rename src/main/resources/tags/{storage_blocks.json => auto_crafter_supported_storage.json} (100%) rename src/main/resources/tags/{inventory_blocks.json => cargo_supported_inventories.json} (58%) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java index 91896ba1e..42ca357eb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java @@ -69,7 +69,7 @@ final class CargoUtils { } Material type = block.getType(); - return SlimefunTag.INVENTORY_BLOCKS.isTagged(type); + return SlimefunTag.CARGO_SUPPORTED_INVENTORIES.isTagged(type); } @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java index eaf420f0c..21371c4ec 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java @@ -202,7 +202,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy protected boolean isValidInventory(@Nonnull Block block) { Material type = block.getType(); - return SlimefunTag.STORAGE_BLOCKS.isTagged(type); + return SlimefunTag.AUTO_CRAFTER_SUPPORTED_STORAGE.isTagged(type); } /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index e027231ec..1079844e1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -267,12 +267,12 @@ public enum SlimefunTag implements Tag { /** * All storage blocks. */ - STORAGE_BLOCKS, + AUTO_CRAFTER_SUPPORTED_STORAGE, /** * All blocks with an inventory. */ - INVENTORY_BLOCKS, + CARGO_SUPPORTED_INVENTORIES, /** * All tile entities. diff --git a/src/main/resources/tags/storage_blocks.json b/src/main/resources/tags/auto_crafter_supported_storage.json similarity index 100% rename from src/main/resources/tags/storage_blocks.json rename to src/main/resources/tags/auto_crafter_supported_storage.json diff --git a/src/main/resources/tags/inventory_blocks.json b/src/main/resources/tags/cargo_supported_inventories.json similarity index 58% rename from src/main/resources/tags/inventory_blocks.json rename to src/main/resources/tags/cargo_supported_inventories.json index 4a21a42d3..eb960c5e4 100644 --- a/src/main/resources/tags/inventory_blocks.json +++ b/src/main/resources/tags/cargo_supported_inventories.json @@ -1,13 +1,15 @@ { "values" : [ - "#slimefun:storage_blocks", + "#slimefun:shulker_boxes", + "minecraft:chest", + "minecraft:trapped_chest", + "minecraft:barrel", "minecraft:furnace", "minecraft:dispenser", "minecraft:dropper", "minecraft:hopper", "minecraft:brewing_stand", "minecraft:blast_furnace", - "minecraft:smoker", - "minecraft:campfire" + "minecraft:smoker" ] } \ No newline at end of file diff --git a/src/main/resources/tags/tile_entities.json b/src/main/resources/tags/tile_entities.json index b294fa159..bcbafbd5e 100644 --- a/src/main/resources/tags/tile_entities.json +++ b/src/main/resources/tags/tile_entities.json @@ -1,9 +1,19 @@ { "values" : [ + "#slimefun:shulker_boxes", "#minecraft:signs", "#minecraft:banners", "#minecraft:beds", - "#slimefun:inventory_blocks", + "minecraft:chest", + "minecraft:trapped_chest", + "minecraft:barrel", + "minecraft:furnace", + "minecraft:dispenser", + "minecraft:dropper", + "minecraft:hopper", + "minecraft:brewing_stand", + "minecraft:blast_furnace", + "minecraft:smoker", "minecraft:beacon", "minecraft:spawner", "minecraft:note_block", From 4b6dc01cd7c49793f3e70ad556311ef3c6195ece Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:19:40 +0200 Subject: [PATCH 056/146] [CI skip] Update thollander/actions-comment-pull-request action to v1.5.0 --- .github/workflows/pr-labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index ecfe15ef3..72ec8093b 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -31,7 +31,7 @@ jobs: api: '🔧 API' compatibility: '🤝 Compatibility' - - uses: thollander/actions-comment-pull-request@v1.4.1 + - uses: thollander/actions-comment-pull-request@v1.5.0 name: Leave a comment about the applied label if: ${{ steps.labeller.outputs.applied != 0 }} with: @@ -40,7 +40,7 @@ jobs: Your Pull Request was automatically labelled as: "${{ steps.labeller.outputs.applied }}" Thank you for contributing to this project! ❤️ - - uses: thollander/actions-comment-pull-request@v1.4.1 + - uses: thollander/actions-comment-pull-request@v1.5.0 name: Leave a comment about our branch naming convention if: ${{ steps.labeller.outputs.applied == 0 }} with: From 7c44e63e0be64253c3f0afd5627f497b002a3eda Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:19:51 +0200 Subject: [PATCH 057/146] [CI skip] Update hmarr/auto-approve-action action to v3 --- .github/workflows/auto-approve.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 55e0f5dc2..7fe4d95cd 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Approve via actions - uses: hmarr/auto-approve-action@v2.4.0 + uses: hmarr/auto-approve-action@v3.0.0 if: github.actor == 'TheBusyBot' || github.actor == 'renovate[bot]' with: github-token: "${{ secrets.GITHUB_TOKEN }}" From 05d97c2afba00ee69bf06b9329871891bd194c3c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:20:04 +0200 Subject: [PATCH 058/146] [CI skip] Update ibiqlik/action-yamllint action to v3.1.1 --- .github/workflows/yaml-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/yaml-linter.yml b/.github/workflows/yaml-linter.yml index 31f2063dc..3d87edf77 100644 --- a/.github/workflows/yaml-linter.yml +++ b/.github/workflows/yaml-linter.yml @@ -21,6 +21,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: YAML Linter - uses: ibiqlik/action-yamllint@v3.1.0 + uses: ibiqlik/action-yamllint@v3.1.1 with: config_file: '.github/configs/yaml-linter.yml' From 117a867071fe263dd0c8975d9d05438562babded Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Mon, 17 Oct 2022 13:27:17 +0200 Subject: [PATCH 059/146] tag naming consicentencies --- .../slimefun4/core/networks/cargo/CargoUtils.java | 2 +- .../items/autocrafters/AbstractAutoCrafter.java | 2 +- .../thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java | 4 ++-- ...torage.json => auto_crafter_supported_storage_blocks.json} | 0 ...d_inventories.json => cargo_supported_storage_blocks.json} | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename src/main/resources/tags/{auto_crafter_supported_storage.json => auto_crafter_supported_storage_blocks.json} (100%) rename src/main/resources/tags/{cargo_supported_inventories.json => cargo_supported_storage_blocks.json} (100%) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java index 42ca357eb..2f77837ef 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java @@ -69,7 +69,7 @@ final class CargoUtils { } Material type = block.getType(); - return SlimefunTag.CARGO_SUPPORTED_INVENTORIES.isTagged(type); + return SlimefunTag.CARGO_SUPPORTED_storage_blocks.isTagged(type); } @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java index 21371c4ec..16eccc9b5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java @@ -202,7 +202,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy protected boolean isValidInventory(@Nonnull Block block) { Material type = block.getType(); - return SlimefunTag.AUTO_CRAFTER_SUPPORTED_STORAGE.isTagged(type); + return SlimefunTag.AUTO_CRAFTER_SUPPORTED_STORAGE_blocks.isTagged(type); } /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index 1079844e1..69e0322ae 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -267,12 +267,12 @@ public enum SlimefunTag implements Tag { /** * All storage blocks. */ - AUTO_CRAFTER_SUPPORTED_STORAGE, + AUTO_CRAFTER_SUPPORTED_STORAGE_blocks, /** * All blocks with an inventory. */ - CARGO_SUPPORTED_INVENTORIES, + CARGO_SUPPORTED_storage_blocks, /** * All tile entities. diff --git a/src/main/resources/tags/auto_crafter_supported_storage.json b/src/main/resources/tags/auto_crafter_supported_storage_blocks.json similarity index 100% rename from src/main/resources/tags/auto_crafter_supported_storage.json rename to src/main/resources/tags/auto_crafter_supported_storage_blocks.json diff --git a/src/main/resources/tags/cargo_supported_inventories.json b/src/main/resources/tags/cargo_supported_storage_blocks.json similarity index 100% rename from src/main/resources/tags/cargo_supported_inventories.json rename to src/main/resources/tags/cargo_supported_storage_blocks.json From 27847a6396f3889fa1a5f7b68a73cee4edfad1f4 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 18 Oct 2022 15:24:58 +0200 Subject: [PATCH 060/146] Fixed #3664 (again, I hope) --- .../slimefun4/api/player/PlayerBackpack.java | 13 ++++++++++++- .../items/multiblocks/AbstractCraftingTable.java | 5 +++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerBackpack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerBackpack.java index 5af1f1fe7..4960a7c9b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerBackpack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerBackpack.java @@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.api.player; import java.io.File; import java.util.ArrayList; import java.util.Iterator; +import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnull; @@ -138,15 +139,25 @@ public class PlayerBackpack { /** * This will close the {@link Inventory} of this backpack for every {@link Player} * that has opened it. + * + * This process has to run on the main server thread. + * + * @return A {@link CompletableFuture}. */ - public void closeForAll() { + public CompletableFuture closeForAll() { + CompletableFuture future = new CompletableFuture<>(); + Slimefun.runSync(() -> { Iterator iterator = new ArrayList<>(inventory.getViewers()).iterator(); while (iterator.hasNext()) { iterator.next().closeInventory(); } + + future.complete(null); }); + + return future; } /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractCraftingTable.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractCraftingTable.java index 4adf57bc9..0a51c63a9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractCraftingTable.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/AbstractCraftingTable.java @@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks; import java.util.List; import java.util.Optional; import java.util.UUID; +import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -125,8 +126,8 @@ abstract class AbstractCraftingTable extends MultiBlockMachine { Optional optional = profile.getBackpack(Integer.parseInt(idSplit[1])); optional.ifPresent(playerBackpack -> { // Safety feature for Issue #3664 - playerBackpack.closeForAll(); - playerBackpack.setSize(size); + CompletableFuture future = playerBackpack.closeForAll(); + future.thenRun(() -> playerBackpack.setSize(size)); }); }); From 0b7c656d864e5bf1e4376529bb0ea86c7ad743a1 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 18 Oct 2022 15:42:39 +0200 Subject: [PATCH 061/146] Improved logging for issue #3699 --- .../implementation/guide/SurvivalSlimefunGuide.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java index 2ed6c4530..2e8629600 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java @@ -332,7 +332,7 @@ public class SurvivalSlimefunGuide implements SlimefunGuideImplementation { Slimefun.getLocalization().sendMessage(pl, "messages.no-permission", true); } } catch (Exception | LinkageError x) { - printErrorMessage(pl, x); + printErrorMessage(pl, sfitem, x); } return false; @@ -383,7 +383,7 @@ public class SurvivalSlimefunGuide implements SlimefunGuideImplementation { displayItem(profile, slimefunItem, true); } } catch (Exception | LinkageError x) { - printErrorMessage(pl, x); + printErrorMessage(pl, slimefunItem, x); } return false; @@ -763,4 +763,10 @@ public class SurvivalSlimefunGuide implements SlimefunGuideImplementation { Slimefun.logger().log(Level.SEVERE, "An error has occurred while trying to open a SlimefunItem in the guide!", x); } + @ParametersAreNonnullByDefault + private void printErrorMessage(Player p, SlimefunItem item, Throwable x) { + p.sendMessage(ChatColor.DARK_RED + "An internal server error has occurred. Please inform an admin, check the console for further info."); + item.error("This item has caused an error message to be thrown while viewing it in the Slimefun guide.", x); + } + } From 3b7bdb059d5af59ccc89d860e87518bfd3823a81 Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Tue, 18 Oct 2022 17:55:23 +0200 Subject: [PATCH 062/146] suggested changes --- .../slimefun4/core/networks/cargo/CargoUtils.java | 2 +- .../implementation/guide/SurvivalSlimefunGuide.java | 2 +- .../items/autocrafters/AbstractAutoCrafter.java | 2 +- .../thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java | 9 +++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java index 2f77837ef..ff8da96d0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/cargo/CargoUtils.java @@ -69,7 +69,7 @@ final class CargoUtils { } Material type = block.getType(); - return SlimefunTag.CARGO_SUPPORTED_storage_blocks.isTagged(type); + return SlimefunTag.CARGO_SUPPORTED_STORAGE_BLOCKS.isTagged(type); } @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java index 2ed6c4530..f8df9ffd2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java @@ -667,7 +667,7 @@ public class SurvivalSlimefunGuide implements SlimefunGuideImplementation { private void displayRecipes(Player p, PlayerProfile profile, ChestMenu menu, RecipeDisplayItem sfItem, int page) { List recipes = sfItem.getDisplayRecipes(); - if (!recipes.isEmpty()) { + if (recipes != null && !recipes.isEmpty()) { menu.addItem(53, null); if (page == 0) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java index 16eccc9b5..b09886918 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java @@ -202,7 +202,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy protected boolean isValidInventory(@Nonnull Block block) { Material type = block.getType(); - return SlimefunTag.AUTO_CRAFTER_SUPPORTED_STORAGE_blocks.isTagged(type); + return SlimefunTag.AUTO_CRAFTER_SUPPORTED_STORAGE_BLOCKS.isTagged(type); } /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index 69e0322ae..7962c7b02 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -12,6 +12,7 @@ import java.util.stream.Stream; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import io.github.thebusybiscuit.slimefun4.implementation.items.autocrafters.AbstractAutoCrafter; import org.apache.commons.lang.Validate; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -265,14 +266,14 @@ public enum SlimefunTag implements Tag { WOOL_CARPETS, /** - * All storage blocks. + * All supported storage blocks for the {@link AbstractAutoCrafter} */ - AUTO_CRAFTER_SUPPORTED_STORAGE_blocks, + AUTO_CRAFTER_SUPPORTED_STORAGE_BLOCKS, /** - * All blocks with an inventory. + * All supported storage blocks for cargo. */ - CARGO_SUPPORTED_storage_blocks, + CARGO_SUPPORTED_STORAGE_BLOCKS, /** * All tile entities. From 028c6c7f68ca796ade3058a506da107d6541448a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 18:13:53 +0200 Subject: [PATCH 063/146] [CI skip] Update actions/setup-java action to v3.6.0 --- .github/workflows/discord-webhook.yml | 2 +- .github/workflows/maven-compiler.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index 0ccb971a7..500dca90a 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v3.1.0 - name: Set up Java JDK 17 - uses: actions/setup-java@v3.5.1 + uses: actions/setup-java@v3.6.0 with: distribution: 'adopt' java-version: '17' diff --git a/.github/workflows/maven-compiler.yml b/.github/workflows/maven-compiler.yml index 99aa5e949..ca8c3b8f7 100644 --- a/.github/workflows/maven-compiler.yml +++ b/.github/workflows/maven-compiler.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v3 - name: Set up JDK 17 - uses: actions/setup-java@v3.5.1 + uses: actions/setup-java@v3.6.0 with: distribution: 'adopt' java-version: '17' diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index bbcb4ce38..1d8901821 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v3.5.1 + uses: actions/setup-java@v3.6.0 with: distribution: 'adopt' java-version: '17' From 5887e2c90a8515725943b38f49f8c7688c7945a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 18:14:45 +0200 Subject: [PATCH 064/146] [CI skip] Update pascalgn/automerge-action action to v0.15.5 --- .github/workflows/auto-squash.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-squash.yml b/.github/workflows/auto-squash.yml index 1bd30aeaf..8866d8ce0 100644 --- a/.github/workflows/auto-squash.yml +++ b/.github/workflows/auto-squash.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Auto squash - uses: pascalgn/automerge-action@v0.15.3 + uses: pascalgn/automerge-action@v0.15.5 env: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} UPDATE_RETRIES: 0 @@ -42,7 +42,7 @@ jobs: steps: - name: Auto squash - uses: pascalgn/automerge-action@v0.15.3 + uses: pascalgn/automerge-action@v0.15.5 env: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} UPDATE_RETRIES: 0 From 63fc4397dcb61263a0e454a2d79e972942d124eb Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Tue, 18 Oct 2022 18:34:40 +0200 Subject: [PATCH 065/146] whoops --- .../slimefun4/implementation/guide/SurvivalSlimefunGuide.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java index f8df9ffd2..2ed6c4530 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java @@ -667,7 +667,7 @@ public class SurvivalSlimefunGuide implements SlimefunGuideImplementation { private void displayRecipes(Player p, PlayerProfile profile, ChestMenu menu, RecipeDisplayItem sfItem, int page) { List recipes = sfItem.getDisplayRecipes(); - if (recipes != null && !recipes.isEmpty()) { + if (!recipes.isEmpty()) { menu.addItem(53, null); if (page == 0) { From f1ab7ecd4ec129638ec5406f8534f4376e095972 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Tue, 18 Oct 2022 13:29:24 -0400 Subject: [PATCH 066/146] Remove WorldUtils --- .../items/androids/ProgrammableAndroid.java | 3 +- .../items/elevator/ElevatorPlate.java | 3 +- .../items/multiblocks/miner/MiningTask.java | 3 +- .../items/weapons/SeismicAxe.java | 3 +- .../slimefun4/utils/WorldUtils.java | 32 ------------------- 5 files changed, 4 insertions(+), 40 deletions(-) delete mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java index b4c5d8dbe..cd91ef4e5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java @@ -51,7 +51,6 @@ import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import io.github.thebusybiscuit.slimefun4.utils.WorldUtils; import io.papermc.lib.PaperLib; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; @@ -879,7 +878,7 @@ public class ProgrammableAndroid extends SlimefunItem implements InventoryBlock, @ParametersAreNonnullByDefault protected void move(Block b, BlockFace face, Block block) { - if (block.getY() > WorldUtils.getMinHeight(block.getWorld()) && block.getY() < block.getWorld().getMaxHeight() && block.isEmpty()) { + if (block.getY() > block.getWorld().getMinHeight() && block.getY() < block.getWorld().getMaxHeight() && block.isEmpty()) { if (!block.getWorld().getWorldBorder().isInside(block.getLocation())) { return; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/elevator/ElevatorPlate.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/elevator/ElevatorPlate.java index 70e33e049..e73e3633e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/elevator/ElevatorPlate.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/elevator/ElevatorPlate.java @@ -29,7 +29,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; -import io.github.thebusybiscuit.slimefun4.utils.WorldUtils; import io.papermc.lib.PaperLib; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; @@ -95,7 +94,7 @@ public class ElevatorPlate extends SimpleSlimefunItem { LinkedList floors = new LinkedList<>(); int index = 0; - for (int y = WorldUtils.getMinHeight(b.getWorld()); y < b.getWorld().getMaxHeight(); y++) { + for (int y = b.getWorld().getMinHeight(); y < b.getWorld().getMaxHeight(); y++) { if (y == b.getY()) { String name = ChatColors.color(BlockStorage.getLocationInfo(b.getLocation(), DATA_KEY)); floors.addFirst(new ElevatorFloor(name, index, b)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/MiningTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/MiningTask.java index 7ca9d629b..b329204e5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/MiningTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/MiningTask.java @@ -29,7 +29,6 @@ import io.github.bakedlibs.dough.items.ItemUtils; import io.github.bakedlibs.dough.protection.Interaction; import io.github.bakedlibs.dough.scheduling.TaskQueue; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import io.github.thebusybiscuit.slimefun4.utils.WorldUtils; import io.papermc.lib.PaperLib; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel; @@ -189,7 +188,7 @@ class MiningTask implements Runnable { furnace.getWorld().playEffect(furnace.getLocation(), Effect.STEP_SOUND, Material.STONE); World world = start.getWorld(); - for (int y = height; y > WorldUtils.getMinHeight(world); y--) { + for (int y = height; y > world.getMinHeight(); y--) { Block b = world.getBlockAt(x, y, z); if (!Slimefun.getProtectionManager().hasPermission(Bukkit.getOfflinePlayer(owner), b, Interaction.BREAK_BLOCK)) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SeismicAxe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SeismicAxe.java index 80df25764..93d9095c0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SeismicAxe.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/SeismicAxe.java @@ -33,7 +33,6 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable; import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; -import io.github.thebusybiscuit.slimefun4.utils.WorldUtils; /** * The {@link SeismicAxe} is an interesting weapon. It spawns ghostly block entities in a straight line @@ -151,7 +150,7 @@ public class SeismicAxe extends SimpleSlimefunItem implements No private @Nonnull Block findGround(@Nonnull Block b) { if (b.getType() == Material.AIR) { - int minHeight = WorldUtils.getMinHeight(b.getWorld()); + int minHeight = b.getWorld().getMinHeight(); for (int y = 0; b.getY() - y > minHeight; y++) { Block block = b.getRelative(0, -y, 0); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java deleted file mode 100644 index 71d12daf9..000000000 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.github.thebusybiscuit.slimefun4.utils; - -import javax.annotation.Nonnull; - -import org.apache.commons.lang.Validate; -import org.bukkit.World; - -/** - * This class holds utilities for {@link World}. This will become especially useful with the changes - * in the "Cliffs and Caves" update. - * - * @author Walshy - */ -public final class WorldUtils { - - private WorldUtils() {} - - /** - * Get the minimum Y of the given {@link World}. This is a feature introduced in Minecraft 1.17 - * and introduced into the Bukkit API in Minecraft 1.16. - * - * @param world - * The world of which to get minimum Y in. - * - * @return The minimum Y of the given world. - */ - public static int getMinHeight(@Nonnull World world) { - Validate.notNull(world, "World cannot be null!"); - - return world.getMinHeight(); - } -} From bbf39f6a69d5b511c2a8063e5518d521aa8f65ad Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Tue, 18 Oct 2022 13:32:14 -0400 Subject: [PATCH 067/146] Remove SlimefunUtils.isInventoryEmpty --- .../items/multiblocks/ArmorForge.java | 2 +- .../items/multiblocks/EnhancedCraftingTable.java | 2 +- .../items/multiblocks/MagicWorkbench.java | 2 +- .../slimefun4/utils/SlimefunUtils.java | 14 -------------- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java index fecd80cba..90dc3421c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java @@ -50,7 +50,7 @@ public class ArmorForge extends AbstractCraftingTable { } } - if (SlimefunUtils.isInventoryEmpty(inv)) { + if (inv.isEmpty()) { Slimefun.getLocalization().sendMessage(p, "machines.inventory-empty", true); } else { Slimefun.getLocalization().sendMessage(p, "machines.pattern-not-found", true); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/EnhancedCraftingTable.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/EnhancedCraftingTable.java index 9cb402263..c5392e5fb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/EnhancedCraftingTable.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/EnhancedCraftingTable.java @@ -52,7 +52,7 @@ public class EnhancedCraftingTable extends AbstractCraftingTable { } } - if (SlimefunUtils.isInventoryEmpty(inv)) { + if (inv.isEmpty()) { Slimefun.getLocalization().sendMessage(p, "machines.inventory-empty", true); } else { Slimefun.getLocalization().sendMessage(p, "machines.pattern-not-found", true); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java index 9a306b0c0..2daa14ba1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java @@ -59,7 +59,7 @@ public class MagicWorkbench extends AbstractCraftingTable { } } - if (SlimefunUtils.isInventoryEmpty(inv)) { + if (inv.isEmpty()) { Slimefun.getLocalization().sendMessage(p, "machines.inventory-empty", true); } else { Slimefun.getLocalization().sendMessage(p, "machines.pattern-not-found", true); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java index bac16f352..eeff4b463 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java @@ -519,18 +519,4 @@ public final class SlimefunUtils { public static @Nullable Item spawnItem(Location loc, ItemStack item, ItemSpawnReason reason) { return spawnItem(loc, item, reason, false); } - - /** - * Helper method to check if an Inventory is empty (has no items in "storage"). - * If the MC version is 1.16 or above - * this will call {@link Inventory#isEmpty()} (Which calls MC code resulting in a faster method). - * - * @param inventory - * The {@link Inventory} to check. - * - * @return True if the inventory is empty and false otherwise - */ - public static boolean isInventoryEmpty(@Nonnull Inventory inventory) { - return inventory.isEmpty(); - } } From 281d1e763296c3efb1b6fa6f08a65c226c2c60eb Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Tue, 18 Oct 2022 13:33:49 -0400 Subject: [PATCH 068/146] Fix test --- .../thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java index dbac61ea8..72beee009 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java @@ -14,7 +14,7 @@ class TestMinecraftVersion { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(17)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(1)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(16)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(0)); } From 8d72b90addb10685ed4de5f4cad4b44ad0b39677 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Wed, 19 Oct 2022 19:36:21 -0400 Subject: [PATCH 069/146] Merged upstream --- .../items/androids/WoodcutterAndroid.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java index 31f505353..8bc33808c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/WoodcutterAndroid.java @@ -18,6 +18,7 @@ import org.bukkit.inventory.ItemStack; import io.github.bakedlibs.dough.blocks.Vein; import io.github.bakedlibs.dough.protection.Interaction; +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; @@ -152,13 +153,12 @@ public class WoodcutterAndroid extends ProgrammableAndroid { if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_19)) { switch (logType) { - case MANGROVE_LOG: - case STRIPPED_MANGROVE_LOG: + case MANGROVE_LOG, + STRIPPED_MANGROVE_LOG -> { saplingType = Material.MANGROVE_PROPAGULE; soilRequirement = SlimefunTag.MANGROVE_BASE_BLOCKS::isTagged; - break; - default: - break; + } + default -> {} } } From e78d89ad1477239708e65449231b03048d2a9da2 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sat, 22 Oct 2022 19:18:12 -0400 Subject: [PATCH 070/146] Empty SubItemGroup should not be visible in NestedItemGroup --- .../slimefun4/api/items/groups/NestedItemGroup.java | 4 ++++ .../slimefun4/api/items/groups/SubItemGroup.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/NestedItemGroup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/NestedItemGroup.java index e8908be95..15a654b53 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/NestedItemGroup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/NestedItemGroup.java @@ -103,6 +103,10 @@ public class NestedItemGroup extends FlexItemGroup { target++; SubItemGroup itemGroup = subGroups.get(target); + if (!itemGroup.isVisibleInNested(p)) { + continue; + } + menu.addItem(index, itemGroup.getItem(p)); menu.addMenuClickHandler(index, (pl, slot, item, action) -> { SlimefunGuide.openItemGroup(profile, itemGroup, mode, 1); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java index 4797867b3..156615726 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java @@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.api.items.groups; import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import org.apache.commons.lang.Validate; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; @@ -48,6 +49,10 @@ public class SubItemGroup extends ItemGroup { return false; } + public final boolean isVisibleInNested(@Nonnull Player p) { + return super.isVisible(p); + } + @Override public final boolean isAccessible(@Nonnull Player p) { /* From 32774bbd5cc9c8ca3a10a9c27ad9a2ab2814d307 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sat, 22 Oct 2022 19:21:52 -0400 Subject: [PATCH 071/146] Add document --- .../api/items/groups/SubItemGroup.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java index 156615726..4dd1a8416 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java @@ -15,9 +15,9 @@ import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; /** * The {@link SubItemGroup} is a child {@link ItemGroup} of the * {@link NestedItemGroup}. - * + * * @author TheBusyBiscuit - * + * * @see NestedItemGroup * */ @@ -49,10 +49,6 @@ public class SubItemGroup extends ItemGroup { return false; } - public final boolean isVisibleInNested(@Nonnull Player p) { - return super.isVisible(p); - } - @Override public final boolean isAccessible(@Nonnull Player p) { /* @@ -62,10 +58,29 @@ public class SubItemGroup extends ItemGroup { return true; } + /** + * This method returns whether this {@link SubItemGroup} can be viewed + * by the given {@link Player} in a {@link NestedItemGroup}. + * Empty {@link ItemGroup ItemGroups} will not be visible. + * This includes {@link ItemGroup ItemGroups} where every {@link SlimefunItem} + * is disabled. If an {@link ItemGroup} is not accessible by the {@link Player}, + * see {@link #isAccessible(Player)}, this method will also return false. + * + * @param p + * The {@link Player} to check for + * + * @return Whether this {@link SubItemGroup} is visible to the given {@link Player} + * in the {@link NestedItemGroup} + */ + public final boolean isVisibleInNested(@Nonnull Player p) { + return super.isVisible(p); + } + + /** * This method returns the parent {@link NestedItemGroup} which this * {@link SubItemGroup} belongs to. - * + * * @return The parent {@link NestedItemGroup} */ public final @Nonnull NestedItemGroup getParent() { From 893612144b387554c11d3e33116b559ce8d3d48b Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sat, 22 Oct 2022 19:42:23 -0400 Subject: [PATCH 072/146] Reorganize import --- .../thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java index 4dd1a8416..2629ca24e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java @@ -3,7 +3,6 @@ package io.github.thebusybiscuit.slimefun4.api.items.groups; import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; -import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import org.apache.commons.lang.Validate; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; @@ -11,6 +10,7 @@ import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; /** * The {@link SubItemGroup} is a child {@link ItemGroup} of the From 888e26d5ad062e5d182582f3fc8aa6633bad6709 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sat, 22 Oct 2022 19:48:38 -0400 Subject: [PATCH 073/146] Extra empty line --- .../thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java index 2629ca24e..35b5aef3d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SubItemGroup.java @@ -76,7 +76,6 @@ public class SubItemGroup extends ItemGroup { return super.isVisible(p); } - /** * This method returns the parent {@link NestedItemGroup} which this * {@link SubItemGroup} belongs to. From 9f5c94840a4faeb6451474354bf0ea4d1301aaca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Nov 2022 10:41:23 +0100 Subject: [PATCH 074/146] [CI skip] Update hmarr/auto-approve-action action to v3.1.0 --- .github/workflows/auto-approve.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 7fe4d95cd..3ac0be525 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Approve via actions - uses: hmarr/auto-approve-action@v3.0.0 + uses: hmarr/auto-approve-action@v3.1.0 if: github.actor == 'TheBusyBot' || github.actor == 'renovate[bot]' with: github-token: "${{ secrets.GITHUB_TOKEN }}" From fe11aaadcf974d46a88799c0f43627a522f40639 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Nov 2022 10:41:41 +0100 Subject: [PATCH 075/146] [CI skip] Update dependency org.mockito:mockito-core to v4.8.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3f005ab24..cabaf491b 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ org.mockito mockito-core - 4.8.0 + 4.8.1 test From 155c639c60b34d6601d58181b4b2b7ad34932930 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Nov 2022 10:41:56 +0100 Subject: [PATCH 076/146] [CI skip] Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.4.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cabaf491b..eeefa99db 100644 --- a/pom.xml +++ b/pom.xml @@ -191,7 +191,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.4.0 + 3.4.1 From bf28bbb5a82aaf346d66cf6318bbc791a26634a8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Nov 2022 10:42:15 +0100 Subject: [PATCH 077/146] [CI skip] Update dependency com.github.LoneDev6:itemsadder-api to v3.2.5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eeefa99db..38e149225 100644 --- a/pom.xml +++ b/pom.xml @@ -481,7 +481,7 @@ com.github.LoneDev6 itemsadder-api - 3.2.3-r8 + 3.2.5 provided From 096625a7d765694323da7e4134f35cdc618db50d Mon Sep 17 00:00:00 2001 From: Jeffrey Kosse Date: Sat, 12 Nov 2022 21:14:36 +0100 Subject: [PATCH 078/146] fixes ancient altar not working in caves --- .../core/handlers/RainbowTickHandler.java | 268 +++++++++--------- .../listeners/AncientAltarListener.java | 2 +- 2 files changed, 135 insertions(+), 135 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/RainbowTickHandler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/RainbowTickHandler.java index bc5db4063..38900d852 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/RainbowTickHandler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/handlers/RainbowTickHandler.java @@ -1,134 +1,134 @@ -package io.github.thebusybiscuit.slimefun4.core.handlers; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Nonnull; - -import org.apache.commons.lang.Validate; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.data.BlockData; -import org.bukkit.block.data.type.GlassPane; - -import io.github.bakedlibs.dough.collections.LoopIterator; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; -import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.RainbowBlock; -import io.github.thebusybiscuit.slimefun4.utils.ColoredMaterial; - -import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; -import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; - -/** - * This is a {@link BlockTicker} that is exclusively used for Rainbow blocks. - * On every tick it cycles through the {@link LoopIterator} and chooses the next {@link Material} - * and sets itself to that. - * - * @author TheBusyBiscuit - * - * @see RainbowBlock - * - */ -public class RainbowTickHandler extends BlockTicker { - - private final LoopIterator iterator; - private final boolean glassPanes; - private Material material; - - public RainbowTickHandler(@Nonnull List materials) { - Validate.noNullElements(materials, "A RainbowTicker cannot have a Material that is null!"); - - if (materials.isEmpty()) { - throw new IllegalArgumentException("A RainbowTicker must have at least one Material associated with it!"); - } - - glassPanes = containsGlassPanes(materials); - iterator = new LoopIterator<>(materials); - material = iterator.next(); - } - - public RainbowTickHandler(@Nonnull Material... materials) { - this(Arrays.asList(materials)); - } - - public RainbowTickHandler(@Nonnull ColoredMaterial material) { - this(material.asList()); - } - - /** - * This method checks whether a given {@link Material} array contains any {@link Material} - * that would result in a {@link GlassPane} {@link BlockData}. - * This is done to save performance, so we don't have to validate {@link BlockData} at - * runtime. - * - * @param materials - * The {@link Material} Array to check - * - * @return Whether the array contained any {@link GlassPane} materials - */ - private boolean containsGlassPanes(@Nonnull List materials) { - if (Slimefun.getMinecraftVersion() == MinecraftVersion.UNIT_TEST) { - // BlockData is not available to us during Unit Tests :/ - return false; - } - - for (Material type : materials) { - /* - This BlockData is purely virtual and only created on startup, it should have - no impact on performance, in fact it should save performance as it preloads - the data but also saves heavy calls for other Materials - */ - if (type.createBlockData() instanceof GlassPane) { - return true; - } - } - - return false; - } - - @Override - public void tick(Block b, SlimefunItem item, Config data) { - if (b.getType() == Material.AIR) { - /* - The block was broken, setting the Material now would result in a - duplication glitch - */ - return; - } - - if (glassPanes) { - BlockData blockData = b.getBlockData(); - - if (blockData instanceof GlassPane previousData) { - BlockData block = material.createBlockData(bd -> { - if (bd instanceof GlassPane nextData) { - nextData.setWaterlogged(previousData.isWaterlogged()); - - for (BlockFace face : previousData.getAllowedFaces()) { - nextData.setFace(face, previousData.hasFace(face)); - } - } - }); - - b.setBlockData(block, false); - return; - } - } - - b.setType(material, false); - } - - @Override - public void uniqueTick() { - material = iterator.next(); - } - - @Override - public boolean isSynchronized() { - return true; - } - -} +package io.github.thebusybiscuit.slimefun4.core.handlers; + +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Nonnull; + +import org.apache.commons.lang.Validate; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.type.GlassPane; + +import io.github.bakedlibs.dough.collections.LoopIterator; +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; +import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.RainbowBlock; +import io.github.thebusybiscuit.slimefun4.utils.ColoredMaterial; + +import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; +import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; + +/** + * This is a {@link BlockTicker} that is exclusively used for Rainbow blocks. + * On every tick it cycles through the {@link LoopIterator} and chooses the next {@link Material} + * and sets itself to that. + * + * @author TheBusyBiscuit + * + * @see RainbowBlock + * + */ +public class RainbowTickHandler extends BlockTicker { + + private final LoopIterator iterator; + private final boolean glassPanes; + private Material material; + + public RainbowTickHandler(@Nonnull List materials) { + Validate.noNullElements(materials, "A RainbowTicker cannot have a Material that is null!"); + + if (materials.isEmpty()) { + throw new IllegalArgumentException("A RainbowTicker must have at least one Material associated with it!"); + } + + glassPanes = containsGlassPanes(materials); + iterator = new LoopIterator<>(materials); + material = iterator.next(); + } + + public RainbowTickHandler(@Nonnull Material... materials) { + this(Arrays.asList(materials)); + } + + public RainbowTickHandler(@Nonnull ColoredMaterial material) { + this(material.asList()); + } + + /** + * This method checks whether a given {@link Material} array contains any {@link Material} + * that would result in a {@link GlassPane} {@link BlockData}. + * This is done to save performance, so we don't have to validate {@link BlockData} at + * runtime. + * + * @param materials + * The {@link Material} Array to check + * + * @return Whether the array contained any {@link GlassPane} materials + */ + private boolean containsGlassPanes(@Nonnull List materials) { + if (Slimefun.getMinecraftVersion() == MinecraftVersion.UNIT_TEST) { + // BlockData is not available to us during Unit Tests :/ + return false; + } + + for (Material type : materials) { + /* + This BlockData is purely virtual and only created on startup, it should have + no impact on performance, in fact it should save performance as it preloads + the data but also saves heavy calls for other Materials + */ + if (type.createBlockData() instanceof GlassPane) { + return true; + } + } + + return false; + } + + @Override + public void tick(Block b, SlimefunItem item, Config data) { + if (b.getType().isAir()) { + /* + The block was broken, setting the Material now would result in a + duplication glitch + */ + return; + } + + if (glassPanes) { + BlockData blockData = b.getBlockData(); + + if (blockData instanceof GlassPane previousData) { + BlockData block = material.createBlockData(bd -> { + if (bd instanceof GlassPane nextData) { + nextData.setWaterlogged(previousData.isWaterlogged()); + + for (BlockFace face : previousData.getAllowedFaces()) { + nextData.setFace(face, previousData.hasFace(face)); + } + } + }); + + b.setBlockData(block, false); + return; + } + } + + b.setType(material, false); + } + + @Override + public void uniqueTick() { + material = iterator.next(); + } + + @Override + public boolean isSynchronized() { + return true; + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java index 30071db6f..035303b30 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java @@ -141,7 +141,7 @@ public class AncientAltarListener implements Listener { // Check if the Item in hand is valid if (p.getInventory().getItemInMainHand().getType() != Material.AIR) { // Check for pedestal obstructions - if (pedestal.getRelative(0, 1, 0).getType() != Material.AIR) { + if (!pedestal.getRelative(0, 1, 0).getType().isAir()) { Slimefun.getLocalization().sendMessage(p, "machines.ANCIENT_PEDESTAL.obstructed", true); return; } From 6a5f979fd6b52ebb4fadc720179bf864a48c3d5d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 26 Nov 2022 23:05:45 +0100 Subject: [PATCH 079/146] [CI skip] Update dependency org.mockito:mockito-core to v4.9.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 38e149225..2f8785eee 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ org.mockito mockito-core - 4.8.1 + 4.9.0 test From e6a10f7ce998803824ab3d43af7bcd55cac4032d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 Dec 2022 14:59:59 +0000 Subject: [PATCH 080/146] Update dependency com.konghq:unirest-java to v3.14.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2f8785eee..8e960b02e 100644 --- a/pom.xml +++ b/pom.xml @@ -366,7 +366,7 @@ com.konghq unirest-java - 3.13.11 + 3.14.1 compile From fc9071500ac8631f37f348d5c5bde7136c6eb63d Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Wed, 14 Dec 2022 03:08:38 -0500 Subject: [PATCH 081/146] No more CS-CoreLib --- .../slimefun4/implementation/Slimefun.java | 2 ++ .../implementation/StartupWarnings.java | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java index 5bb45c58a..a3778ed76 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java @@ -269,6 +269,8 @@ public final class Slimefun extends JavaPlugin implements SlimefunAddon { // Check if CS-CoreLib is installed (it is no longer needed) if (getServer().getPluginManager().getPlugin("CS-CoreLib") != null) { StartupWarnings.discourageCSCoreLib(logger); + getServer().getPluginManager().disablePlugin(this); + return; } // Encourage newer Java version diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java index c70bc0796..fe44f50d5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java @@ -24,14 +24,16 @@ final class StartupWarnings { @ParametersAreNonnullByDefault static void discourageCSCoreLib(Logger logger) { - logger.log(Level.WARNING, BORDER); - logger.log(Level.WARNING, PREFIX + "It looks like you are still using CS-CoreLib."); - logger.log(Level.WARNING, PREFIX); - logger.log(Level.WARNING, PREFIX + "Slimefun no longer requires CS-CoreLib to be"); - logger.log(Level.WARNING, PREFIX + "installed as of January 30th 2021. It is safe"); - logger.log(Level.WARNING, PREFIX + "to remove and we recommend you to uninstall"); - logger.log(Level.WARNING, PREFIX + "CS-CoreLib from your server immediately."); - logger.log(Level.WARNING, BORDER); + logger.log(Level.SEVERE, BORDER); + logger.log(Level.SEVERE, PREFIX + "It looks like you are still using CS-CoreLib."); + logger.log(Level.SEVERE, PREFIX); + logger.log(Level.SEVERE, PREFIX + "Slimefun no longer requires CS-CoreLib to be"); + logger.log(Level.SEVERE, PREFIX + "installed as of January 30th 2021. It is safe"); + logger.log(Level.SEVERE, PREFIX + "to remove and we recommend you to uninstall"); + logger.log(Level.SEVERE, PREFIX + "CS-CoreLib from your server immediately."); + logger.log(Level.SEVERE, PREFIX); + logger.log(Level.SEVERE, PREFIX + "You need to remove CS-CoreLib for Slimefun to run."); + logger.log(Level.SEVERE, BORDER); } @ParametersAreNonnullByDefault From e5393582f3d3e7fb676553b41518dcf108c15115 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 16:19:14 +0000 Subject: [PATCH 082/146] Update actions/setup-java action to v3.9.0 --- .github/workflows/discord-webhook.yml | 2 +- .github/workflows/maven-compiler.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index 500dca90a..ca4600911 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v3.1.0 - name: Set up Java JDK 17 - uses: actions/setup-java@v3.6.0 + uses: actions/setup-java@v3.9.0 with: distribution: 'adopt' java-version: '17' diff --git a/.github/workflows/maven-compiler.yml b/.github/workflows/maven-compiler.yml index ca8c3b8f7..1f91ea87b 100644 --- a/.github/workflows/maven-compiler.yml +++ b/.github/workflows/maven-compiler.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v3 - name: Set up JDK 17 - uses: actions/setup-java@v3.6.0 + uses: actions/setup-java@v3.9.0 with: distribution: 'adopt' java-version: '17' diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 1d8901821..0ca480529 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v3.6.0 + uses: actions/setup-java@v3.9.0 with: distribution: 'adopt' java-version: '17' From 95b628d8c96458c9a0d6a5d357b3dbbd75a096e6 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Wed, 14 Dec 2022 14:39:55 -0500 Subject: [PATCH 083/146] Change warning message --- .../slimefun4/implementation/StartupWarnings.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java index fe44f50d5..b3a9beeaa 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java @@ -28,9 +28,7 @@ final class StartupWarnings { logger.log(Level.SEVERE, PREFIX + "It looks like you are still using CS-CoreLib."); logger.log(Level.SEVERE, PREFIX); logger.log(Level.SEVERE, PREFIX + "Slimefun no longer requires CS-CoreLib to be"); - logger.log(Level.SEVERE, PREFIX + "installed as of January 30th 2021. It is safe"); - logger.log(Level.SEVERE, PREFIX + "to remove and we recommend you to uninstall"); - logger.log(Level.SEVERE, PREFIX + "CS-CoreLib from your server immediately."); + logger.log(Level.SEVERE, PREFIX + "installed as of January 30th 2021."); logger.log(Level.SEVERE, PREFIX); logger.log(Level.SEVERE, PREFIX + "You need to remove CS-CoreLib for Slimefun to run."); logger.log(Level.SEVERE, BORDER); From a0682fe49cc0dda20b4d07ee9f99943344143654 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Wed, 14 Dec 2022 14:40:59 -0500 Subject: [PATCH 084/146] Change warning message --- .../slimefun4/implementation/StartupWarnings.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java index b3a9beeaa..77b3a7479 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/StartupWarnings.java @@ -28,9 +28,8 @@ final class StartupWarnings { logger.log(Level.SEVERE, PREFIX + "It looks like you are still using CS-CoreLib."); logger.log(Level.SEVERE, PREFIX); logger.log(Level.SEVERE, PREFIX + "Slimefun no longer requires CS-CoreLib to be"); - logger.log(Level.SEVERE, PREFIX + "installed as of January 30th 2021."); - logger.log(Level.SEVERE, PREFIX); - logger.log(Level.SEVERE, PREFIX + "You need to remove CS-CoreLib for Slimefun to run."); + logger.log(Level.SEVERE, PREFIX + "installed as of January 30th 2021. You need to"); + logger.log(Level.SEVERE, PREFIX + "remove CS-CoreLib for Slimefun to run."); logger.log(Level.SEVERE, BORDER); } From 761659fd2031ea1e40ea0b448ba67b279fed7d4b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 28 Dec 2022 17:04:51 +0100 Subject: [PATCH 085/146] [CI skip] Update dependency org.mockito:mockito-core to v4.11.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2f8785eee..1591415bc 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ org.mockito mockito-core - 4.9.0 + 4.11.0 test From 168484e4ea40871b8bc206236b201ada000ef8de Mon Sep 17 00:00:00 2001 From: justtos Date: Tue, 3 Jan 2023 17:58:43 +0200 Subject: [PATCH 086/146] [Fix] BlockPlacer placing disabled items --- .../slimefun4/implementation/items/blocks/BlockPlacer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java index 0e884b135..e33ce9e83 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java @@ -104,7 +104,7 @@ public class BlockPlacer extends SlimefunItem { if (item != null) { // Check if this Item can even be placed down - if (!(item instanceof NotPlaceable)) { + if (!(item instanceof NotPlaceable) && !item.isDisabled()) { placeSlimefunBlock(item, e.getItem(), facedBlock, dispenser); } } else if (!Slimefun.getIntegrations().isCustomItem(e.getItem())) { From 7d5c31c2859d2fa17c7b72148e112b51a7484fb2 Mon Sep 17 00:00:00 2001 From: justtos Date: Wed, 4 Jan 2023 23:11:39 +0200 Subject: [PATCH 087/146] Update to a better disabled check Co-authored-by: Daniel Walsh --- .../slimefun4/implementation/items/blocks/BlockPlacer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java index e33ce9e83..1e567f803 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java @@ -104,7 +104,7 @@ public class BlockPlacer extends SlimefunItem { if (item != null) { // Check if this Item can even be placed down - if (!(item instanceof NotPlaceable) && !item.isDisabled()) { + if (!(item instanceof NotPlaceable) && !item.isDisabledIn(dispenser.getWorld())) { placeSlimefunBlock(item, e.getItem(), facedBlock, dispenser); } } else if (!Slimefun.getIntegrations().isCustomItem(e.getItem())) { From 6906014017652507a76af00230dd9ed28dcf981a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 03:30:33 +0100 Subject: [PATCH 088/146] [CI skip] Update dependency io.papermc:paperlib to v1.0.8 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1591415bc..472751f34 100644 --- a/pom.xml +++ b/pom.xml @@ -360,7 +360,7 @@ io.papermc paperlib - 1.0.7 + 1.0.8 compile From ccc8806d90048b7dd05467c1d73c40c06d9e8de2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 03:31:50 +0100 Subject: [PATCH 089/146] [CI skip] Update actions/checkout action to v3.2.0 --- .github/workflows/discord-webhook.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index 500dca90a..907413818 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.2.0 - name: Set up Java JDK 17 uses: actions/setup-java@v3.6.0 diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 1d8901821..700a30372 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.2.0 with: fetch-depth: 0 From 26e3329a820856f62c09b395748afdee00d7a54c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 03:32:17 +0100 Subject: [PATCH 090/146] [CI skip] Update dependency com.sk89q.worldedit:worldedit-core to v7.2.13 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 472751f34..d3f43c19b 100644 --- a/pom.xml +++ b/pom.xml @@ -411,7 +411,7 @@ com.sk89q.worldedit worldedit-core - 7.2.12 + 7.2.13 provided From d1ac14c8d6ac8ecac67ce6a43b7403b3d78663bf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 03:32:43 +0100 Subject: [PATCH 091/146] [CI skip] Update dependency com.sk89q.worldedit:worldedit-bukkit to v7.2.13 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d3f43c19b..fa3dcc7a9 100644 --- a/pom.xml +++ b/pom.xml @@ -425,7 +425,7 @@ com.sk89q.worldedit worldedit-bukkit - 7.2.12 + 7.2.13 provided From fbf3a20962e90542e43e968d26550bebec447417 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 03:33:10 +0100 Subject: [PATCH 092/146] [CI skip] Update dependency com.gmail.nossr50.mcMMO:mcMMO to v2.1.218 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa3dcc7a9..2a55877ce 100644 --- a/pom.xml +++ b/pom.xml @@ -439,7 +439,7 @@ com.gmail.nossr50.mcMMO mcMMO - 2.1.217 + 2.1.218 provided From a07d289fced8a1882a0276d72c7846d4615fbf7d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 16:07:18 +0000 Subject: [PATCH 093/146] Update actions/checkout action to v3.3.0 --- .github/workflows/discord-webhook.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index 907413818..d3d252aac 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v3.3.0 - name: Set up Java JDK 17 uses: actions/setup-java@v3.6.0 diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 700a30372..f3f668133 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v3.3.0 with: fetch-depth: 0 From c666f39630048610a39e7a99f548913e23e89c5d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 20:56:58 +0100 Subject: [PATCH 094/146] [CI skip] Update thollander/actions-comment-pull-request action to v2 --- .github/workflows/pr-labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index 72ec8093b..fe11a01ed 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -31,7 +31,7 @@ jobs: api: '🔧 API' compatibility: '🤝 Compatibility' - - uses: thollander/actions-comment-pull-request@v1.5.0 + - uses: thollander/actions-comment-pull-request@v2.3.0 name: Leave a comment about the applied label if: ${{ steps.labeller.outputs.applied != 0 }} with: @@ -40,7 +40,7 @@ jobs: Your Pull Request was automatically labelled as: "${{ steps.labeller.outputs.applied }}" Thank you for contributing to this project! ❤️ - - uses: thollander/actions-comment-pull-request@v1.5.0 + - uses: thollander/actions-comment-pull-request@v2.3.0 name: Leave a comment about our branch naming convention if: ${{ steps.labeller.outputs.applied == 0 }} with: From 18eea2781798fdbcedc44d9c21963fb69a670b24 Mon Sep 17 00:00:00 2001 From: Sefiraat Date: Fri, 6 Jan 2023 13:05:27 +0000 Subject: [PATCH 095/146] Update changelog --- .github/workflows/maven-compiler.yml | 1 + CHANGELOG.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/maven-compiler.yml b/.github/workflows/maven-compiler.yml index 1f91ea87b..a8ab1c105 100644 --- a/.github/workflows/maven-compiler.yml +++ b/.github/workflows/maven-compiler.yml @@ -12,6 +12,7 @@ on: - '.github/workflows/**' - 'src/**' - 'pom.xml' + - 'CHANGELOG.md' permissions: contents: read diff --git a/CHANGELOG.md b/CHANGELOG.md index d43382816..f4abe2746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ * "/sf stats" can no longer be used if researching is disabled * "/sf research" can no longer be used if researching is disabled * Removed the Hercules Pickaxe from Slimefun +* If CS-CoreLib is present, Slimefun will disable itself (previously it would just error) #### Fixes * Fixed #3597 @@ -63,6 +64,8 @@ * Fixed #3664 * Fixed #3651 * Fixed #3677 +* Fixed #3705 +* Fixed BlockPlacer being able to place disabled items ## Release Candidate 32 (26 Jun 2022) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#32 From b78c17b36280da9cede566113e999cf06fe05efd Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 7 Jan 2023 15:20:34 +0100 Subject: [PATCH 096/146] [CI skip] Schedule next RC for today --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4abe2746..d3a1604d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Table of contents -- [Release Candidate 33 (TBD)](#release-candidate-33-tbd) +- [Release Candidate 33 (07 Jan 2023)](#release-candidate-33-07-jan-2023) - [Release Candidate 32 (26 Jun 2022)](#release-candidate-32-26-jun-2022) - [Release Candidate 31 (14 Mar 2022)](#release-candidate-31-14-mar-2022) - [Release Candidate 30 (31 Dec 2021)](#release-candidate-30-31-dec-2021) @@ -34,7 +34,8 @@ - [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019) -## Release Candidate 33 (TBD) +## Release Candidate 33 (07 Jan 2023) +https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#33 #### Additions * (API) Added Tinted Glass to "GLASS_BLOCKS" tag From 856aedb6c5f8d600f9bfdf833a45349961a3ad64 Mon Sep 17 00:00:00 2001 From: Daniel Walsh Date: Sat, 7 Jan 2023 15:40:06 +0000 Subject: [PATCH 097/146] [CI Skip] RC 34 is next up --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a1604d6..4bee566d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Table of contents +- [Release Candidate 34 (TBD)](#release-candidate-34-tbd) - [Release Candidate 33 (07 Jan 2023)](#release-candidate-33-07-jan-2023) - [Release Candidate 32 (26 Jun 2022)](#release-candidate-32-26-jun-2022) - [Release Candidate 31 (14 Mar 2022)](#release-candidate-31-14-mar-2022) @@ -34,6 +35,14 @@ - [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019) +## Release Candidate 34 (TBD) + +#### Additions + +#### Changes + +#### Fixes + ## Release Candidate 33 (07 Jan 2023) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#33 From 02bf0e7b2b6a7f1d82db2e1446b829db32748ba1 Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Thu, 19 Jan 2023 09:11:55 +0100 Subject: [PATCH 098/146] more use for cobbled deepslate --- .../implementation/items/multiblocks/GrindStone.java | 3 +++ .../implementation/items/multiblocks/OreCrusher.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java index 6ec794695..0ff134504 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java @@ -81,6 +81,9 @@ public class GrindStone extends MultiBlockMachine { if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { recipes.add(new ItemStack(Material.AMETHYST_BLOCK)); recipes.add(new ItemStack(Material.AMETHYST_SHARD, 4)); + + recipes.add(new ItemStack(Material.COBBLED_DEEPSLATE)); + recipes.add(new ItemStack(Material.GRAVEL)); } recipes.add(SlimefunItems.MAGIC_LUMP_2); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java index 84851c0ea..e14561873 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java @@ -97,6 +97,11 @@ public class OreCrusher extends MultiBlockMachine { recipes.add(SlimefunItems.COMPRESSED_CARBON); recipes.add(new SlimefunItemStack(SlimefunItems.CARBON, 4)); + + if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { + recipes.add(new ItemStack(Material.COBBLED_DEEPSLATE, 8)); + recipes.add(new ItemStack(Material.SAND, 1)); + } } public boolean isOreDoublingEnabled() { From 4800ab83360cbac1283718749afff2cbdc57ab10 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Jan 2023 15:29:40 +0100 Subject: [PATCH 099/146] [CI skip] Update dependency org.junit.jupiter:junit-jupiter to v5.9.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0f0183b2c..64e80956d 100644 --- a/pom.xml +++ b/pom.xml @@ -382,7 +382,7 @@ org.junit.jupiter junit-jupiter - 5.9.1 + 5.9.2 test From e6c9a5b8cd32a58b2ef31b5434e3dccd41e4326c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Jan 2023 15:30:28 +0100 Subject: [PATCH 100/146] [CI skip] Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.0.0-M8 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64e80956d..67e64eb33 100644 --- a/pom.xml +++ b/pom.xml @@ -146,7 +146,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.0.0-M8 org.junit.jupiter:junit-jupiter From c154302d0be1853bb4c049a48b62265e6a7fd4f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Jan 2023 15:30:57 +0100 Subject: [PATCH 101/146] [CI skip] Update thollander/actions-comment-pull-request action to v2.3.1 --- .github/workflows/pr-labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index fe11a01ed..f9998718e 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -31,7 +31,7 @@ jobs: api: '🔧 API' compatibility: '🤝 Compatibility' - - uses: thollander/actions-comment-pull-request@v2.3.0 + - uses: thollander/actions-comment-pull-request@v2.3.1 name: Leave a comment about the applied label if: ${{ steps.labeller.outputs.applied != 0 }} with: @@ -40,7 +40,7 @@ jobs: Your Pull Request was automatically labelled as: "${{ steps.labeller.outputs.applied }}" Thank you for contributing to this project! ❤️ - - uses: thollander/actions-comment-pull-request@v2.3.0 + - uses: thollander/actions-comment-pull-request@v2.3.1 name: Leave a comment about our branch naming convention if: ${{ steps.labeller.outputs.applied == 0 }} with: From 666d00584954718b043e0a7a5acfceaed0c40246 Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Tue, 24 Jan 2023 13:48:39 +0100 Subject: [PATCH 102/146] updated readme, bug report form, pull request form and other comments. --- .github/ISSUE_TEMPLATE/bug-report.yaml | 2 -- .github/PULL_REQUEST_TEMPLATE.md | 2 +- CHANGELOG.md | 3 ++- README.md | 22 +++++++++---------- .../items/magical/MagicalZombiePills.java | 3 --- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index 82477eda2..08d28dac1 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -117,8 +117,6 @@ body: - 1.18.x - 1.17.x - 1.16.x - - 1.15.x - - 1.14.x - (Older versions are not supported) - id: slimefun-version diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5895c9969..8b1b50518 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -17,7 +17,7 @@ - [ ] I have fully tested the proposed changes and promise that they will not break everything into chaos. - [ ] I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them. -- [ ] I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.14.* - 1.19.*). +- [ ] I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.16.* - 1.19.*). - [ ] I followed the existing code standards and didn't mess up the formatting. - [ ] I did my best to add documentation to any public classes or methods I added. - [ ] I have added `Nonnull` and `Nullable` annotations to my methods to indicate their behaviour for null values diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bee566d8..7c0202fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,7 +40,8 @@ #### Additions #### Changes - +* Removed 1.14.* and 1.15.* support +* #### Fixes ## Release Candidate 33 (07 Jan 2023) diff --git a/README.md b/README.md index 2861e9d88..404d9eda5 100644 --- a/README.md +++ b/README.md @@ -28,17 +28,17 @@ Slimefun 4 can be downloaded **for free** on our builds page.
We currently provide two distinct versions of Slimefun, development builds and "stable" builds.
Here is a full summary of the differences between the two different versions of Slimefun. -| | development (latest) | "stable" | -| ------------------ | -------- | -------- | -| **Minecraft version(s)** | :video_game: **1.14.\* - 1.19.\*** | :video_game: **1.14.\* - 1.19.\*** | -| **Java version** | :computer: **Java 16 (or higher)** | :computer: **Java 8 (or higher)** | -| **automatic updates** | :heavy_check_mark: | :heavy_check_mark: | -| **frequent updates** | :heavy_check_mark: | :x: | -| **latest content** | :heavy_check_mark: | :x: | -| **Discord support** | :heavy_check_mark: | :x: | -| **Bug Reports** | :heavy_check_mark: | :x: | -| **testing before release** | :x: | :heavy_check_mark: | -| **change logs** | :x: | :memo: **[change log](https://github.com/Slimefun/Slimefun4/blob/master/CHANGELOG.md)** | +| | development (latest) | "stable" | +| ------------------ |---------------------------------------------------------------------------------------------------------------| -------- | +| **Minecraft version(s)** | :video_game: **1.16.\* - 1.19.\*** | :video_game: **1.14.\* - 1.19.\*** | +| **Java version** | :computer: **Java 16 (or higher)** | :computer: **Java 8 (or higher)** | +| **automatic updates** | :heavy_check_mark: | :heavy_check_mark: | +| **frequent updates** | :heavy_check_mark: | :x: | +| **latest content** | :heavy_check_mark: | :x: | +| **Discord support** | :heavy_check_mark: | :x: | +| **Bug Reports** | :heavy_check_mark: | :x: | +| **testing before release** | :x: | :heavy_check_mark: | +| **change logs** | :x: | :memo: **[change log](https://github.com/Slimefun/Slimefun4/blob/master/CHANGELOG.md)** | | **Download link** | :floppy_disk: **[download latest](https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/master/)** | :floppy_disk: **[download "stable"](https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/)** | **:exclamation: We wholeheartedly recommend you to use _development builds_, they are the most recent version of Slimefun and also receive the most frequent updates! In fact, "stable" builds are so outdated that we won't accept bug reports from them at all.** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java index 804250bfd..584985303 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicalZombiePills.java @@ -30,9 +30,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunIte /** * This {@link SlimefunItem} allows you to convert any {@link ZombieVillager} to * their {@link Villager} variant. It is also one of the very few utilisations of {@link EntityInteractHandler}. - * - * This item does not work on earlier versions than 1.14 as the {@link ZombieVillager} {@link EntityType} - * did not exist back then. * * @author Linox * From 2dd94b93f95e0f0e4b67152caaab0167a90489d7 Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Tue, 24 Jan 2023 13:50:29 +0100 Subject: [PATCH 103/146] stupid auto format --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 404d9eda5..55cf2aab6 100644 --- a/README.md +++ b/README.md @@ -28,17 +28,17 @@ Slimefun 4 can be downloaded **for free** on our builds page.
We currently provide two distinct versions of Slimefun, development builds and "stable" builds.
Here is a full summary of the differences between the two different versions of Slimefun. -| | development (latest) | "stable" | -| ------------------ |---------------------------------------------------------------------------------------------------------------| -------- | -| **Minecraft version(s)** | :video_game: **1.16.\* - 1.19.\*** | :video_game: **1.14.\* - 1.19.\*** | -| **Java version** | :computer: **Java 16 (or higher)** | :computer: **Java 8 (or higher)** | -| **automatic updates** | :heavy_check_mark: | :heavy_check_mark: | -| **frequent updates** | :heavy_check_mark: | :x: | -| **latest content** | :heavy_check_mark: | :x: | -| **Discord support** | :heavy_check_mark: | :x: | -| **Bug Reports** | :heavy_check_mark: | :x: | -| **testing before release** | :x: | :heavy_check_mark: | -| **change logs** | :x: | :memo: **[change log](https://github.com/Slimefun/Slimefun4/blob/master/CHANGELOG.md)** | +| | development (latest) | "stable" | +| ------------------ | -------- | -------- | +| **Minecraft version(s)** | :video_game: **1.16.\* - 1.19.\*** | :video_game: **1.14.\* - 1.19.\*** | +| **Java version** | :computer: **Java 16 (or higher)** | :computer: **Java 8 (or higher)** | +| **automatic updates** | :heavy_check_mark: | :heavy_check_mark: | +| **frequent updates** | :heavy_check_mark: | :x: | +| **latest content** | :heavy_check_mark: | :x: | +| **Discord support** | :heavy_check_mark: | :x: | +| **Bug Reports** | :heavy_check_mark: | :x: | +| **testing before release** | :x: | :heavy_check_mark: | +| **change logs** | :x: | :memo: **[change log](https://github.com/Slimefun/Slimefun4/blob/master/CHANGELOG.md)** | | **Download link** | :floppy_disk: **[download latest](https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/master/)** | :floppy_disk: **[download "stable"](https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/)** | **:exclamation: We wholeheartedly recommend you to use _development builds_, they are the most recent version of Slimefun and also receive the most frequent updates! In fact, "stable" builds are so outdated that we won't accept bug reports from them at all.** From 243d0b8a7677bdb53b57e7fa8ed1e8a8d46ea76d Mon Sep 17 00:00:00 2001 From: J3fftw <44972470+J3fftw1@users.noreply.github.com> Date: Tue, 24 Jan 2023 14:05:27 +0100 Subject: [PATCH 104/146] Apply suggestions from code review Co-authored-by: Varian Anora --- CHANGELOG.md | 1 - README.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c0202fb5..715fab72b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,6 @@ #### Changes * Removed 1.14.* and 1.15.* support -* #### Fixes ## Release Candidate 33 (07 Jan 2023) diff --git a/README.md b/README.md index 55cf2aab6..df2e27a11 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Here is a full summary of the differences between the two different versions of | | development (latest) | "stable" | | ------------------ | -------- | -------- | | **Minecraft version(s)** | :video_game: **1.16.\* - 1.19.\*** | :video_game: **1.14.\* - 1.19.\*** | -| **Java version** | :computer: **Java 16 (or higher)** | :computer: **Java 8 (or higher)** | +| **Java version** | :computer: **Java 16 (or higher)** | :computer: **Java 16 (or higher)** | | **automatic updates** | :heavy_check_mark: | :heavy_check_mark: | | **frequent updates** | :heavy_check_mark: | :x: | | **latest content** | :heavy_check_mark: | :x: | From 5ec2842c91db81d052327f332b5ab880f9ca9357 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Jan 2023 14:12:20 +0100 Subject: [PATCH 105/146] [CI skip] Update dependency org.mockito:mockito-core to v5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 67e64eb33..ddf3afe25 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ org.mockito mockito-core - 4.11.0 + 5.0.0 test From d662306058292548de1b62c2694093539ce404ec Mon Sep 17 00:00:00 2001 From: J3fftw <44972470+J3fftw1@users.noreply.github.com> Date: Tue, 24 Jan 2023 14:14:32 +0100 Subject: [PATCH 106/146] Update CHANGELOG.md Co-authored-by: Varian Anora --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 715fab72b..7142b2f95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ #### Changes * Removed 1.14.* and 1.15.* support + #### Fixes ## Release Candidate 33 (07 Jan 2023) From efab9186f9aaeea37243ef66e15a16b4cc0d4f86 Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Wed, 25 Jan 2023 12:41:06 +0100 Subject: [PATCH 107/146] Added bamboo as a fuel type for androids --- .../implementation/items/androids/ProgrammableAndroid.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java index cd91ef4e5..f39d42af8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java @@ -602,9 +602,10 @@ public class ProgrammableAndroid extends SlimefunItem implements InventoryBlock, registerFuelType(new MachineFuel(45, new ItemStack(Material.BLAZE_ROD))); registerFuelType(new MachineFuel(70, new ItemStack(Material.DRIED_KELP_BLOCK))); - // Coal & Charcoal + // Coal, Charcoal & Bamboo registerFuelType(new MachineFuel(8, new ItemStack(Material.COAL))); registerFuelType(new MachineFuel(8, new ItemStack(Material.CHARCOAL))); + registerFuelType(new MachineFuel(8, new ItemStack(Material.BAMBOO))); // Logs for (Material mat : Tag.LOGS.getValues()) { From 234923e618483918d53e523a9b7efa07b2d7c652 Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Wed, 25 Jan 2023 12:45:03 +0100 Subject: [PATCH 108/146] adjusted the value --- .../implementation/items/androids/ProgrammableAndroid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java index f39d42af8..6704b0fd0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java @@ -605,7 +605,7 @@ public class ProgrammableAndroid extends SlimefunItem implements InventoryBlock, // Coal, Charcoal & Bamboo registerFuelType(new MachineFuel(8, new ItemStack(Material.COAL))); registerFuelType(new MachineFuel(8, new ItemStack(Material.CHARCOAL))); - registerFuelType(new MachineFuel(8, new ItemStack(Material.BAMBOO))); + registerFuelType(new MachineFuel(1, new ItemStack(Material.BAMBOO))); // Logs for (Material mat : Tag.LOGS.getValues()) { From c21e2f30763f587b198ad271da0aee28677a11ea Mon Sep 17 00:00:00 2001 From: J3fftw1 Date: Mon, 30 Jan 2023 16:33:09 +0100 Subject: [PATCH 109/146] Fix smelting null items --- .../implementation/listeners/EnhancedFurnaceListener.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EnhancedFurnaceListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EnhancedFurnaceListener.java index 323be5c55..e779bdb34 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EnhancedFurnaceListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/EnhancedFurnaceListener.java @@ -70,6 +70,11 @@ public class EnhancedFurnaceListener implements Listener { if (state instanceof Furnace furnace) { FurnaceInventory inventory = furnace.getInventory(); + // This if statement fixes #3741 + if (inventory.getSmelting() == null) { + return; + } + boolean multiplier = SlimefunTag.ENHANCED_FURNACE_LUCK_MATERIALS.isTagged(inventory.getSmelting().getType()); int amount = multiplier ? enhancedFurnace.getRandomOutputAmount() : 1; Optional result = Slimefun.getMinecraftRecipeService().getFurnaceOutput(inventory.getSmelting()); From d463f50e85ec4bed83299431476f5a6720e57cea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 17:49:39 +0100 Subject: [PATCH 110/146] [CI skip] Update dependency org.mockito:mockito-core to v5.1.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ddf3afe25..195d223d7 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ org.mockito mockito-core - 5.0.0 + 5.1.0 test From 1d5d5fc680023df14d3c7ab23195de05c6b66f72 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Mon, 30 Jan 2023 17:53:53 +0100 Subject: [PATCH 111/146] [CI skip] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7142b2f95..7dd5677d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,11 +38,14 @@ ## Release Candidate 34 (TBD) #### Additions +* Added "Cobbled Deepslate -> Gravel" recipe to the Grind Stone +* Added "Cobbled Deepslate -> Sand" recipe to the Ore Crusher #### Changes * Removed 1.14.* and 1.15.* support #### Fixes +* Fixed #3741 ## Release Candidate 33 (07 Jan 2023) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#33 From b4083a480fdfaf37c6a6691983d1d800fbd5e3be Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 19:49:27 +0100 Subject: [PATCH 112/146] [CI skip] Update dependency org.mockito:mockito-core to v5.1.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 195d223d7..d77aaedf6 100644 --- a/pom.xml +++ b/pom.xml @@ -388,7 +388,7 @@ org.mockito mockito-core - 5.1.0 + 5.1.1 test From 424b889588e5fd73a7cf0266ee68b0e6dd27c14a Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Fri, 10 Feb 2023 12:46:55 -0600 Subject: [PATCH 113/146] Add API Methods & Small Cleanup --- .../core/networks/energy/EnergyNet.java | 68 +++++++++++-------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index eb1ee277c..6971d0bef 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -1,20 +1,5 @@ package io.github.thebusybiscuit.slimefun4.core.networks.energy; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.atomic.AtomicLong; -import java.util.function.LongConsumer; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; - import io.github.thebusybiscuit.slimefun4.api.ErrorReport; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.api.network.Network; @@ -25,13 +10,26 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.HologramOwner; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; - import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.Slimefun.api.BlockStorage; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.LongConsumer; /** * The {@link EnergyNet} is an implementation of {@link Network} that deals with - * electrical energy being send from and to nodes. + * electrical energy being sent from and to nodes. * * @author meiamsome * @author TheBusyBiscuit @@ -58,7 +56,23 @@ public class EnergyNet extends Network implements HologramOwner { public int getRange() { return RANGE; } + + @Nonnull + public Map getGenerators() { + return Collections.unmodifiableMap(generators); + } + + @Nonnull + public Map getCapacitors() { + return Collections.unmodifiableMap(capacitors); + } + + @Nonnull + public Map getConsumers() { + return Collections.unmodifiableMap(consumers); + } + @Nonnull @Override public String getId() { return "ENERGY_NETWORK"; @@ -96,21 +110,17 @@ public class EnergyNet extends Network implements HologramOwner { if (component != null) { switch (component.getEnergyComponentType()) { - case CAPACITOR: - capacitors.put(l, component); - break; - case CONSUMER: - consumers.put(l, component); - break; - case GENERATOR: + case CAPACITOR -> capacitors.put(l, component); + case CONSUMER -> consumers.put(l, component); + case GENERATOR -> { if (component instanceof EnergyNetProvider provider) { generators.put(l, provider); } else if (component instanceof SlimefunItem item) { item.warn("This Item is marked as a GENERATOR but does not implement the interface EnergyNetProvider!"); } - break; - default: - break; + } + default -> { + } } } } @@ -261,10 +271,10 @@ public class EnergyNet extends Network implements HologramOwner { private void updateHologram(@Nonnull Block b, double supply, double demand) { if (demand > supply) { String netLoss = NumberUtils.getCompactDouble(demand - supply); - updateHologram(b, "&4&l- &c" + netLoss + " &7J &e\u26A1"); + updateHologram(b, "&4&l- &c" + netLoss + " &7J &e⚡"); } else { String netGain = NumberUtils.getCompactDouble(supply - demand); - updateHologram(b, "&2&l+ &a" + netGain + " &7J &e\u26A1"); + updateHologram(b, "&2&l+ &a" + netGain + " &7J &e⚡"); } } From e7372064d547c1564c4f6bb0238215f5b8a37900 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Fri, 10 Feb 2023 13:05:50 -0600 Subject: [PATCH 114/146] Requested Changes --- .../core/networks/energy/EnergyNet.java | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index 6971d0bef..dfddf25b4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -1,5 +1,21 @@ package io.github.thebusybiscuit.slimefun4.core.networks.energy; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.LongConsumer; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; + import io.github.thebusybiscuit.slimefun4.api.ErrorReport; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.api.network.Network; @@ -10,22 +26,9 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.HologramOwner; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; + import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.Slimefun.api.BlockStorage; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.atomic.AtomicLong; -import java.util.function.LongConsumer; /** * The {@link EnergyNet} is an implementation of {@link Network} that deals with @@ -56,7 +59,7 @@ public class EnergyNet extends Network implements HologramOwner { public int getRange() { return RANGE; } - + @Nonnull public Map getGenerators() { return Collections.unmodifiableMap(generators); @@ -110,17 +113,21 @@ public class EnergyNet extends Network implements HologramOwner { if (component != null) { switch (component.getEnergyComponentType()) { - case CAPACITOR -> capacitors.put(l, component); - case CONSUMER -> consumers.put(l, component); - case GENERATOR -> { + case CAPACITOR: + capacitors.put(l, component); + break; + case CONSUMER: + consumers.put(l, component); + break; + case GENERATOR: if (component instanceof EnergyNetProvider provider) { generators.put(l, provider); } else if (component instanceof SlimefunItem item) { item.warn("This Item is marked as a GENERATOR but does not implement the interface EnergyNetProvider!"); } - } - default -> { - } + break; + default: + break; } } } @@ -271,10 +278,10 @@ public class EnergyNet extends Network implements HologramOwner { private void updateHologram(@Nonnull Block b, double supply, double demand) { if (demand > supply) { String netLoss = NumberUtils.getCompactDouble(demand - supply); - updateHologram(b, "&4&l- &c" + netLoss + " &7J &e⚡"); + updateHologram(b, "&4&l- &c" + netLoss + " &7J &e\u26A1"); } else { String netGain = NumberUtils.getCompactDouble(supply - demand); - updateHologram(b, "&2&l+ &a" + netGain + " &7J &e⚡"); + updateHologram(b, "&2&l+ &a" + netGain + " &7J &e\u26A1"); } } From 17d2ffd731184bc49223528e8489db95ab251c72 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Feb 2023 22:53:30 +0100 Subject: [PATCH 115/146] [CI skip] Update actions/setup-java action to v3.10.0 --- .github/workflows/discord-webhook.yml | 2 +- .github/workflows/maven-compiler.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index 1f87019f9..328bb6d03 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v3.3.0 - name: Set up Java JDK 17 - uses: actions/setup-java@v3.9.0 + uses: actions/setup-java@v3.10.0 with: distribution: 'adopt' java-version: '17' diff --git a/.github/workflows/maven-compiler.yml b/.github/workflows/maven-compiler.yml index a8ab1c105..0da2120f2 100644 --- a/.github/workflows/maven-compiler.yml +++ b/.github/workflows/maven-compiler.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v3 - name: Set up JDK 17 - uses: actions/setup-java@v3.9.0 + uses: actions/setup-java@v3.10.0 with: distribution: 'adopt' java-version: '17' diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 571794210..1f2ab58e8 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v3.9.0 + uses: actions/setup-java@v3.10.0 with: distribution: 'adopt' java-version: '17' From 29757f1379826d353234136913a23c67d25dfd76 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Fri, 10 Feb 2023 16:03:37 -0600 Subject: [PATCH 116/146] Update src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java Co-authored-by: TheBusyBiscuit --- .../slimefun4/core/networks/energy/EnergyNet.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index dfddf25b4..c581880d5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -60,24 +60,20 @@ public class EnergyNet extends Network implements HologramOwner { return RANGE; } - @Nonnull - public Map getGenerators() { + public @Nonnull Map getGenerators() { return Collections.unmodifiableMap(generators); } - @Nonnull - public Map getCapacitors() { + public @Nonnull Map getCapacitors() { return Collections.unmodifiableMap(capacitors); } - @Nonnull - public Map getConsumers() { + public @Nonnull Map getConsumers() { return Collections.unmodifiableMap(consumers); } - @Nonnull @Override - public String getId() { + public @Nonnull String getId() { return "ENERGY_NETWORK"; } From 33d47414492d9adb7fe5dd4a95dbe20212cc5304 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Fri, 10 Feb 2023 16:20:52 -0600 Subject: [PATCH 117/146] Add Javadocs --- .../core/networks/energy/EnergyNet.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index c581880d5..d873a8a05 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -59,15 +59,32 @@ public class EnergyNet extends Network implements HologramOwner { public int getRange() { return RANGE; } - + + /** + * @return An immutable {@link HashMap} + * With a Key of {@link Location} to a Value of {@link EnergyNetProvider} + * Containing all {@link EnergyNetProvider} in the Energy Network + */ public @Nonnull Map getGenerators() { return Collections.unmodifiableMap(generators); } + /** + * @return An immutable {@link HashMap} + * With a Key of {@link Location} to a Value of {@link EnergyNetProvider} + * Containing all {@link EnergyNetComponent} with the {@link EnergyNetComponentType#CAPACITOR} + * in the Energy Network + */ public @Nonnull Map getCapacitors() { return Collections.unmodifiableMap(capacitors); } + /** + * @return An immutable {@link HashMap} + * With a Key of {@link Location} to a Value of {@link EnergyNetProvider} + * Containing all {@link EnergyNetComponent} with the {@link EnergyNetComponentType#CONSUMER} + * in the Energy Network + */ public @Nonnull Map getConsumers() { return Collections.unmodifiableMap(consumers); } From 2a012cd9c3e752a82950c5e386b5af02b426929b Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Fri, 10 Feb 2023 16:45:12 -0600 Subject: [PATCH 118/146] Javadoc Changes --- .../core/networks/energy/EnergyNet.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index d873a8a05..bcf6d6d5d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -61,29 +61,32 @@ public class EnergyNet extends Network implements HologramOwner { } /** - * @return An immutable {@link HashMap} - * With a Key of {@link Location} to a Value of {@link EnergyNetProvider} - * Containing all {@link EnergyNetProvider} in the Energy Network + * This creates an Immutable Version of {@link #generators}. + * Using a Key of {@link Location} to a Value of {@link EnergyNetProvider}. + * This Map contains all the {@link EnergyNetProvider} in this Energy Network + * @return {@link HashMap} */ public @Nonnull Map getGenerators() { return Collections.unmodifiableMap(generators); } /** - * @return An immutable {@link HashMap} - * With a Key of {@link Location} to a Value of {@link EnergyNetProvider} - * Containing all {@link EnergyNetComponent} with the {@link EnergyNetComponentType#CAPACITOR} - * in the Energy Network + * This creates an Immutable Version of {@link #capacitors}. + * Using a Key of {@link Location} to a Value of {@link EnergyNetProvider}. + * This Map contains all the {@link EnergyNetComponent} with the {@link EnergyNetComponentType#CAPACITOR} + * in this Energy Network + * @return {@link Map} */ public @Nonnull Map getCapacitors() { return Collections.unmodifiableMap(capacitors); } /** - * @return An immutable {@link HashMap} - * With a Key of {@link Location} to a Value of {@link EnergyNetProvider} - * Containing all {@link EnergyNetComponent} with the {@link EnergyNetComponentType#CONSUMER} - * in the Energy Network + * This creates an Immutable Version of {@link #consumers}. + * Using a Key of {@link Location} to a Value of {@link EnergyNetProvider}. + * This Map contains all the {@link EnergyNetComponent} with the {@link EnergyNetComponentType#CONSUMER} + * in this Energy . + * @return {@link Map} */ public @Nonnull Map getConsumers() { return Collections.unmodifiableMap(consumers); From 08af8b2f996921c5c9b1b7f79eaae2fa7798ac7a Mon Sep 17 00:00:00 2001 From: Daniel Walsh Date: Sat, 11 Feb 2023 00:01:20 +0000 Subject: [PATCH 119/146] Apply suggestions from code review --- .../core/networks/energy/EnergyNet.java | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index bcf6d6d5d..21aafcaf2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -61,32 +61,27 @@ public class EnergyNet extends Network implements HologramOwner { } /** - * This creates an Immutable Version of {@link #generators}. - * Using a Key of {@link Location} to a Value of {@link EnergyNetProvider}. - * This Map contains all the {@link EnergyNetProvider} in this Energy Network - * @return {@link HashMap} + * This creates an immutable {@link Map} of {@link EnergyNetProvider}s. + * + * @return An immutable {@link Map} of generators */ public @Nonnull Map getGenerators() { return Collections.unmodifiableMap(generators); } /** - * This creates an Immutable Version of {@link #capacitors}. - * Using a Key of {@link Location} to a Value of {@link EnergyNetProvider}. - * This Map contains all the {@link EnergyNetComponent} with the {@link EnergyNetComponentType#CAPACITOR} - * in this Energy Network - * @return {@link Map} + * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CAPACITOR} {@link EnergyNetComponent}s. + * + * @return An immutable {@link Map} of capacitors */ public @Nonnull Map getCapacitors() { return Collections.unmodifiableMap(capacitors); } /** - * This creates an Immutable Version of {@link #consumers}. - * Using a Key of {@link Location} to a Value of {@link EnergyNetProvider}. - * This Map contains all the {@link EnergyNetComponent} with the {@link EnergyNetComponentType#CONSUMER} - * in this Energy . - * @return {@link Map} + * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CONSUMER} {@link EnergyNetComponent}s. + * + * @return An immutable {@link Map} of consumers */ public @Nonnull Map getConsumers() { return Collections.unmodifiableMap(consumers); From 6f2a4e369a38f2d3d68e7efe8f28908f96565ed3 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Sat, 11 Feb 2023 07:43:19 -0600 Subject: [PATCH 120/146] Specify within this instance --- .../slimefun4/core/networks/energy/EnergyNet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index 21aafcaf2..9fc8680c1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -61,7 +61,7 @@ public class EnergyNet extends Network implements HologramOwner { } /** - * This creates an immutable {@link Map} of {@link EnergyNetProvider}s. + * This creates an immutable {@link Map} of {@link EnergyNetProvider}s within this EnergyNet instance. * * @return An immutable {@link Map} of generators */ @@ -70,7 +70,7 @@ public class EnergyNet extends Network implements HologramOwner { } /** - * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CAPACITOR} {@link EnergyNetComponent}s. + * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CAPACITOR} {@link EnergyNetComponent}s within this EnergyNet instance. * * @return An immutable {@link Map} of capacitors */ @@ -79,7 +79,7 @@ public class EnergyNet extends Network implements HologramOwner { } /** - * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CONSUMER} {@link EnergyNetComponent}s. + * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CONSUMER} {@link EnergyNetComponent}s within this EnergyNet instance. * * @return An immutable {@link Map} of consumers */ From f4440b9b2dc119a94950ec416744117bea2fc080 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 11 Feb 2023 15:10:26 +0100 Subject: [PATCH 121/146] Apply suggestions from code review --- .../slimefun4/core/networks/energy/EnergyNet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index 9fc8680c1..516c3dba5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -61,7 +61,7 @@ public class EnergyNet extends Network implements HologramOwner { } /** - * This creates an immutable {@link Map} of {@link EnergyNetProvider}s within this EnergyNet instance. + * This creates an immutable {@link Map} of {@link EnergyNetProvider}s within this {@link EnergyNet} instance. * * @return An immutable {@link Map} of generators */ @@ -70,7 +70,7 @@ public class EnergyNet extends Network implements HologramOwner { } /** - * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CAPACITOR} {@link EnergyNetComponent}s within this EnergyNet instance. + * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CAPACITOR} {@link EnergyNetComponent}s within this {@link EnergyNet} instance. * * @return An immutable {@link Map} of capacitors */ @@ -79,7 +79,7 @@ public class EnergyNet extends Network implements HologramOwner { } /** - * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CONSUMER} {@link EnergyNetComponent}s within this EnergyNet instance. + * This creates an immutable {@link Map} of {@link EnergyNetComponentType#CONSUMER} {@link EnergyNetComponent}s within this {@link EnergyNet} instance. * * @return An immutable {@link Map} of consumers */ From 4f1949fb2e78e7bc93914b83f2950f0a8c4ee5ce Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sun, 12 Feb 2023 21:25:42 +0100 Subject: [PATCH 122/146] [CI skip] Update translators list --- src/main/resources/languages/translators.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/resources/languages/translators.json b/src/main/resources/languages/translators.json index 99825f674..eca5421a1 100644 --- a/src/main/resources/languages/translators.json +++ b/src/main/resources/languages/translators.json @@ -174,5 +174,11 @@ "Day-OS", "ooicram", "Sxigames" + ], + "fa" : [ + "mohammadamin22", + "AmirYaKuZa", + "amooking", + "taha2hosseini1" ] } From 41f7f9a914df28ad61fe71c65e5486b96bcc9fb6 Mon Sep 17 00:00:00 2001 From: The Busy Bot Date: Sun, 12 Feb 2023 21:49:04 +0100 Subject: [PATCH 123/146] [CI skip] New locale updates from Crowdin --- src/main/resources/languages/fa/messages.yml | 37 +++++++++ src/main/resources/languages/id/messages.yml | 9 +++ src/main/resources/languages/pt/messages.yml | 79 +++++++++++++++++++ .../resources/languages/zh-CN/messages.yml | 2 +- 4 files changed, 126 insertions(+), 1 deletion(-) diff --git a/src/main/resources/languages/fa/messages.yml b/src/main/resources/languages/fa/messages.yml index 99b3d1130..1daccfc6f 100644 --- a/src/main/resources/languages/fa/messages.yml +++ b/src/main/resources/languages/fa/messages.yml @@ -1,7 +1,18 @@ --- commands: + help: اين صفحه ي کمک را نشان بده + cheat: به شما اجازه ي تقلب آيتم مي دهد + teleporter: محل تلپورت پلير ديگر را ببينيد + versions: همه ي افزونه های نصب شده را به صورت يک ليست به شما نشان ميدهد + search: دنبال کلمه داده شده در کتاب راهنما می گردد research: + description: تحقیقات یک پلیر را باز یا ریست میکند reset-target: '&cدانش شما بازنشانی شده است' + backpack: + description: يک کپي از کوله پشتي موجود را بازیابي کنید + charge: + charge-success: وسیله شما شارژ شد! + not-rechargeable: اين وسیله قابل شارژ نيست! debug: description: 'ثبت اشکال زدایی را برای توسعه دهندگان اجرا کنید' disabled: '&7حالت اشکال زدایی غیرفعال شد.' @@ -23,6 +34,8 @@ guide: open-itemgroup: 'براي باز کردن کليک کنيد' versions-notice: 'این موارد هنگام گزارش باگ بسیار مهم هستند!' wiki: 'این آیتم را در ویکی رسمی Slimefun مشاهده کنید' + recipes: + generator: 'نوع هاي موجود سوخت' pages: previous: 'صفحه ي قبل' next: 'صفحه ی بعد' @@ -45,9 +58,15 @@ guide: title: main: 'راهنمای Slimefun' settings: 'تنظیمات و اطلاعات' + credits: 'مشارکت کنندگان Slimefun4' + wiki: 'ویکی Slimefun4' + addons: 'افزون ها برای Slimefun4' bugs: 'گزارش اشکال ها' source: 'کد منبع' + versions: 'نسخه های نصب شده' credits: + profile-link: 'برای دیدن نمایه آنها در GitHub کلیک کنید' + open: 'برای دیدن مشارکت کنندگان ما کلیک کنید' roles: developer: '&6توسعه دهندگان' wiki: '&3ویرایش کننده ویکی' @@ -56,6 +75,8 @@ guide: messages: hungry: '&cشما برای انجام این کار زیادی گرسنه هستید! برای انجام آن نوار گرسنگی خود را پر کنید!' disabled-in-world: '&4&lاين آيتم در این جهان غير فعال شده است' + auto-crafting: + select: 'این دستور غذا را انتخاب کنید' soulbound-rune: fail: '&cشما نمی توانید چند وسیله را به طور همزمان به روح خود متصل کنید.' success: '&aشما با موفقیت این مورد را به روح خود متصل کردید! در صورت مردن شما این وسیله را از دست نمی دهید.' @@ -64,13 +85,19 @@ messages: no-pvp: '&cشما نمی توانید در اینجا مبارزه کنید!' link-prompt: '&eاینجا کلیک کنید:' machines: + HOLOGRAM_PROJECTOR: + inventory-title: 'ویرایشگر هولوگرام' ELEVATOR: no-destinations: '&4مقصدی پیدا نشد' TELEPORTER: teleporting: '&3درحال جا به جایی...' teleported: '&3جا به جا شدی!' gui: + title: 'نقاط راه شما' + tooltip: 'کلیک برای جا به جایی' time: 'زمان تخمین زده شده' + GPS_CONTROL_PANEL: + waypoints: 'نمای کلی نقطه راه' CARGO_NODES: connected: '&2وصل است!' not-connected: '&4وصل نیست!' @@ -79,6 +106,7 @@ gps: status-offline: 'آفلاین' android: scripts: + editor: 'ویرایش برنامه' uploaded: - '&bدرحال آپلود...' - '&aSuccessfully uploaded your script!' @@ -89,6 +117,7 @@ languages: fr: 'فرانسوی' it: 'ایتالیایی' es: 'اسپانیایی' + pl: 'لهستانی' nl: 'هلندی' cs: 'کشور چک' hu: 'مجارستانی' @@ -111,3 +140,11 @@ languages: th: 'تایلندی' tl: 'تاگالوگی' ro: 'رومانیایی' + bg: 'بلغاری' + ko: 'کره ای' + tr: 'ترکی' + hr: 'کرواتی' + mk: 'مقدونی' + sr: 'صربی' + si-LK: 'سینهالی' + lt: 'لیتوانیایی' diff --git a/src/main/resources/languages/id/messages.yml b/src/main/resources/languages/id/messages.yml index 07b17b5aa..cc5c9157f 100644 --- a/src/main/resources/languages/id/messages.yml +++ b/src/main/resources/languages/id/messages.yml @@ -25,6 +25,7 @@ placeholderapi: profile-loading: 'Memuat...' guide: locked: 'TERKUNCI' + work-in-progress: 'Fitur ini belum sepenuhnya selesai!' locked-itemgroup: - 'Untuk membuka kategori ini anda' - 'harus membuka semua barang dari' @@ -57,6 +58,7 @@ guide: selected-language: 'Yang sedang dipilih:' select: 'Klik untuk memilih bahasa ini' select-default: 'Klik untuk menggunakan bahasa standar server' + change: 'Klik untuk memilih sebuah bahasa baru' translations: name: '&aAda yang kurang?' lore: 'Klik untuk menambahkan terjemahan anda' @@ -84,6 +86,7 @@ guide: addons: 'Addons untuk Slimefun4' bugs: 'Laporkan masalah' source: 'Kode sumber' + versions: 'Versi Terinstal' credits: commit: 'Melakukan' profile-link: 'Klik untuk mengunjungi profil mereka di GitHub' @@ -196,6 +199,8 @@ machines: waypoints: 'Gambaran titik jalan' CARGO_NODES: must-be-placed: '&4Harus diletakan di dalam peti atau mesin!' + connected: '&2Terhubung!' + not-connected: '&4Tidak Terhubung!' INDUSTRIAL_MINER: no-fuel: '&c Penambang Industri Anda kehabisan bahan bakar! Masuklah bahan bakar Anda ke peti di atas.' piston-facing: '& c Penambang Industri Anda membutuhkan piston untuk menghadap ke atas!' @@ -311,4 +316,8 @@ languages: ko: 'Korea' tr: 'Turki' hr: 'Croation' + mk: 'Makedonia' + sr: 'Serbian' be: 'Belarusian' + si-LK: 'Sinhala' + lt: 'Lithuanian' diff --git a/src/main/resources/languages/pt/messages.yml b/src/main/resources/languages/pt/messages.yml index db241b5fe..773cfd368 100644 --- a/src/main/resources/languages/pt/messages.yml +++ b/src/main/resources/languages/pt/messages.yml @@ -2,15 +2,56 @@ commands: help: Mostra este ecrã de ajuda cheat: Deixa-te fazer batota + give: Dá itens de Slimefun a alguém + guide: Dá-te um guia de Slimefun + teleporter: Vê os Waypoints de outros versions: Lista os Addons Instalados + open_guide: Abre o guia de slimefun sem utilizar o livro + stats: Mostra estatísticas de um jogador + research: + description: Desbloqueia/Apaga pesquisas de um jogador + reset: '&cTu apagaste a sabedoria do %player%' + reset-target: '&cA tua sabedoria foi apagada' + backpack: + description: Recuperar uma cópia de uma mochila existente + invalid-id: '&4O id deve ser um número não-negativo!' + player-never-joined: '&4Nenhum jogador com este nome foi encontrado!' + backpack-does-not-exist: 'A mochila especificada não existe!' + restored-backpack-given: '&aA sua mochila foi restaurada e adicionada ao seu inventário!' + charge: + description: Carrega o item que estás a segurar + charge-success: O item foi carregado! + not-rechargeable: Este item não pode ser carregado! + timings: + description: Timings de Slimefun e addons + please-wait: '&ePor favor, espere um segundo... Os resultados estão a chegar!' + verbose-player: '&4A flag verbose não pode ser utilizada por um jogador!' + unknown-flag: '&4Flag desconhecida: &c%flag%' + debug: + disabled: '&7Modo de debug desabilitado.' placeholderapi: profile-loading: 'A carregar...' guide: locked: 'BLOQUEADO' + work-in-progress: 'Isto ainda não está totalmente concluído!' + locked-itemgroup: + - 'Para desbloquear esta categoria tu vais ter de' + - 'precisas de desbloquear todos os itens das' + - 'categorias seguintes' search: + message: '&bO que gostarias de procurar?' name: '&7Pesquisar...' + tooltip: '&bClica para procurar um item' + inventory: 'À procura de: %item%' tooltips: open-itemgroup: 'Clique para abrir' + versions-notice: 'Estes são muito importantes para dar report a bugs!' + wiki: 'Veja este item na Wiki oficial do Slimefun' + recipes: + machine: 'Itens feitos nesta máquina' + miner: 'Recursos que podes obter com este Miner' + generator: 'Tipos de combustível disponíveis' + gold-pan: 'Recursos que podes obter' pages: previous: 'Página anterior' next: 'Página seguinte' @@ -24,6 +65,11 @@ guide: select: 'Clique para selecionar esta linguagem' select-default: 'Clique para selecionar a linguagem padrão' change: 'Cliqua para selecionar uma linguagem nova' + description: + - '&7Agora tens a opção de alterar' + - '&7o idioma em que Slimefun' + - '&7lhe irá ser apresentado. Itens' + - '&7não podem ser traduzido por agora.' translations: name: '&aFalta alguma coisa?' lore: 'Cliqua para adicionar a tua própria tradução' @@ -64,6 +110,9 @@ guide: resourcepack: '&cArtista de Resourcepack' translator: '&9Tradutor' messages: + only-players: '&4Este comando é apenas para Jogadores' + unknown-player: '&4Jogador Desconhecido: &c%player%' + no-permission: '&4Não tens as permissões necessárias para fazer isto' usage: '&4Utilização: &c%usage%' not-online: '&4%player% &cnão está online!' invalid-item: '&4%item% &cnão é um item válido!' @@ -71,20 +120,49 @@ messages: hungry: '&cEstás com demasiada fome para fazer isso!' disabled-in-world: '&4&lEsse item foi desativado neste mundo' disabled-item: '&4&lEsse item foi desativado! Como é que o conseguiste?' + piglin-barter: '&4Não podes trocar com piglins utilizando itens de Slimefun' + auto-crafting: + tooltips: + disabled: + - '&cEsta receita está desativada no momento' + - '' + - '&eLeft Click &7to re-enable this recipe' + - '&eRight Click &7to remove this recipe' + no-pvp: '&cNão podes fazer pvp aqui!' + opening-guide: '&bA abrir o guia, isto pode demorar alguns segundos...' + opening-backpack: '&bA abrir a mochila, isto pode demorar alguns segundos...' link-prompt: '&eClique aqui:' machines: full-inventory: '&eDesculpa, o meu inventário está cheio!' HOLOGRAM_PROJECTOR: inventory-title: 'Editor de Holograma' ELEVATOR: + no-destinations: '&4Não foram encontrados destinos' pick-a-floor: '&3- Escolha um piso -' TELEPORTER: teleporting: '&3A teletransportar...' teleported: '&3Teletransportado!' cancelled: '&4Teletransporte cancelado!' gui: + title: 'Os teus waypoints' tooltip: 'Clica para te teletransportares' time: 'Tempo estimado' + GPS_CONTROL_PANEL: + transmitters: 'Transmissores' + waypoints: 'Waypoints' +anvil: + not-working: '&4Não podes usar itens de Slimefun em uma bigorna!' + mcmmo-salvaging: '&4Não podes destruir itens do Slimefun!' +brewing_stand: + not-working: '&4Não podes usar itens do Slimefun em um suporte de poções!' +cartography_table: + not-working: '&4Não podes usar itens do Slimefun em uma mesa de cartografia!' +smithing_table: + not-working: '&4Você não pode usar um item do Slimefun como um material de ferreiro!' +villagers: + no-trading: '&4Não podes trocar itens de Slimefun com Villagers!' +backpack: + already-open: '&cEsta mochila está aberta em outro lugar!' inventory: no-access: '&4Não tens permissão para aceder este bloco' android: @@ -134,6 +212,7 @@ languages: fr: 'Francês' it: 'Italiano' es: 'Espanhol' + pl: 'Polaco' sv: 'Sueco' nl: 'Holandês' cs: 'Checo' diff --git a/src/main/resources/languages/zh-CN/messages.yml b/src/main/resources/languages/zh-CN/messages.yml index 306072f4c..ea7d7da10 100644 --- a/src/main/resources/languages/zh-CN/messages.yml +++ b/src/main/resources/languages/zh-CN/messages.yml @@ -93,7 +93,7 @@ guide: click: '&e单击禁用解锁研究动画' disabled: text: - - '&b解锁动画: &a禁用' + - '&b解锁动画: &4禁用' - '' - '&7现在你可以选择是否' - '&7跳过解锁物品研究' From 4de76869c2ffa5335a58721d5116b5e5cc9e563c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 18 Feb 2023 20:56:12 +0100 Subject: [PATCH 124/146] [CI skip] Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.0.0-M9 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d77aaedf6..63cf87126 100644 --- a/pom.xml +++ b/pom.xml @@ -146,7 +146,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M8 + 3.0.0-M9 org.junit.jupiter:junit-jupiter From d87b508e27ac2e658c98fcc578b7e481a088aeb3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 03:04:47 +0100 Subject: [PATCH 125/146] [CI skip] Update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.5.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 63cf87126..2f0eb93ae 100644 --- a/pom.xml +++ b/pom.xml @@ -239,7 +239,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.5.0 ${project.basedir} From eb1bdc464ca35b9dfcc2e84fa6a3444996078e02 Mon Sep 17 00:00:00 2001 From: Ritwik-main <116669493+Ritwik-main@users.noreply.github.com> Date: Thu, 23 Feb 2023 12:34:03 +0530 Subject: [PATCH 126/146] updated climbing pickaxe adding the new 1.18 and 1.19 blocks into climbing pick surfaces, as new blcoks generate in the world --- src/main/resources/tags/climbing_pick_strong_surfaces.json | 5 +++++ src/main/resources/tags/climbing_pick_weak_surfaces.json | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/resources/tags/climbing_pick_strong_surfaces.json b/src/main/resources/tags/climbing_pick_strong_surfaces.json index ca798a9bd..24d86b185 100644 --- a/src/main/resources/tags/climbing_pick_strong_surfaces.json +++ b/src/main/resources/tags/climbing_pick_strong_surfaces.json @@ -4,6 +4,11 @@ "#slimefun:terracotta", "#slimefun:stone_variants", "minecraft:netherrack", + "minecraft:calcite", + "minecraft:deepslate", + "minecraft:dripstone_block", + "minecraft:smooth_basalt", + "minecraft:tuff", { "id" : "minecraft:blackstone", "required" : false diff --git a/src/main/resources/tags/climbing_pick_weak_surfaces.json b/src/main/resources/tags/climbing_pick_weak_surfaces.json index 902bfac23..37cee9bd2 100644 --- a/src/main/resources/tags/climbing_pick_weak_surfaces.json +++ b/src/main/resources/tags/climbing_pick_weak_surfaces.json @@ -2,6 +2,9 @@ "values" : [ "#slimefun:concrete_powders", "#minecraft:sand", - "minecraft:gravel" + "minecraft:gravel", + "minecraft:gravel", + "minecraft:skulk", + "minecraft:clay" ] } From e2df602c30c40331e0775dc583197264cd7eb9cf Mon Sep 17 00:00:00 2001 From: Ritwik-main <116669493+Ritwik-main@users.noreply.github.com> Date: Thu, 23 Feb 2023 12:37:36 +0530 Subject: [PATCH 127/146] Revert "updated climbing pickaxe" This reverts commit eb1bdc464ca35b9dfcc2e84fa6a3444996078e02. --- src/main/resources/tags/climbing_pick_strong_surfaces.json | 5 ----- src/main/resources/tags/climbing_pick_weak_surfaces.json | 5 +---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/resources/tags/climbing_pick_strong_surfaces.json b/src/main/resources/tags/climbing_pick_strong_surfaces.json index 24d86b185..ca798a9bd 100644 --- a/src/main/resources/tags/climbing_pick_strong_surfaces.json +++ b/src/main/resources/tags/climbing_pick_strong_surfaces.json @@ -4,11 +4,6 @@ "#slimefun:terracotta", "#slimefun:stone_variants", "minecraft:netherrack", - "minecraft:calcite", - "minecraft:deepslate", - "minecraft:dripstone_block", - "minecraft:smooth_basalt", - "minecraft:tuff", { "id" : "minecraft:blackstone", "required" : false diff --git a/src/main/resources/tags/climbing_pick_weak_surfaces.json b/src/main/resources/tags/climbing_pick_weak_surfaces.json index 37cee9bd2..902bfac23 100644 --- a/src/main/resources/tags/climbing_pick_weak_surfaces.json +++ b/src/main/resources/tags/climbing_pick_weak_surfaces.json @@ -2,9 +2,6 @@ "values" : [ "#slimefun:concrete_powders", "#minecraft:sand", - "minecraft:gravel", - "minecraft:gravel", - "minecraft:skulk", - "minecraft:clay" + "minecraft:gravel" ] } From 66140e79ee94c2adb62af0d8b8ce17f0497248b0 Mon Sep 17 00:00:00 2001 From: Ritwik-main <116669493+Ritwik-main@users.noreply.github.com> Date: Thu, 23 Feb 2023 12:44:08 +0530 Subject: [PATCH 128/146] adding more blocks to climbing pickaxe table adding the new 1.18 and 1.19 blocks into climbing pick surfaces, as new blcoks generate in the world --- src/main/resources/tags/climbing_pick_strong_surfaces.json | 5 +++++ src/main/resources/tags/climbing_pick_weak_surfaces.json | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/resources/tags/climbing_pick_strong_surfaces.json b/src/main/resources/tags/climbing_pick_strong_surfaces.json index ca798a9bd..0d827d9b0 100644 --- a/src/main/resources/tags/climbing_pick_strong_surfaces.json +++ b/src/main/resources/tags/climbing_pick_strong_surfaces.json @@ -4,6 +4,11 @@ "#slimefun:terracotta", "#slimefun:stone_variants", "minecraft:netherrack", + "minecraft:calcite", + "minecraft:deepslate", + "minecraft:dripstone_block", + "minecraft:smooth_basalt", + "minecraft:tuff", { "id" : "minecraft:blackstone", "required" : false diff --git a/src/main/resources/tags/climbing_pick_weak_surfaces.json b/src/main/resources/tags/climbing_pick_weak_surfaces.json index 902bfac23..88fa36993 100644 --- a/src/main/resources/tags/climbing_pick_weak_surfaces.json +++ b/src/main/resources/tags/climbing_pick_weak_surfaces.json @@ -2,6 +2,8 @@ "values" : [ "#slimefun:concrete_powders", "#minecraft:sand", - "minecraft:gravel" + "minecraft:gravel", + "minecraft:skulk", + "minecraft:clay" ] } From b81f2cc0a074c1ad5416a1b0de2da70c513fa2d7 Mon Sep 17 00:00:00 2001 From: Ritwik-main <116669493+Ritwik-main@users.noreply.github.com> Date: Thu, 23 Feb 2023 13:02:55 +0530 Subject: [PATCH 129/146] Revert "adding more blocks to climbing pickaxe table" This reverts commit 66140e79ee94c2adb62af0d8b8ce17f0497248b0. --- src/main/resources/tags/climbing_pick_strong_surfaces.json | 5 ----- src/main/resources/tags/climbing_pick_weak_surfaces.json | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/resources/tags/climbing_pick_strong_surfaces.json b/src/main/resources/tags/climbing_pick_strong_surfaces.json index 0d827d9b0..ca798a9bd 100644 --- a/src/main/resources/tags/climbing_pick_strong_surfaces.json +++ b/src/main/resources/tags/climbing_pick_strong_surfaces.json @@ -4,11 +4,6 @@ "#slimefun:terracotta", "#slimefun:stone_variants", "minecraft:netherrack", - "minecraft:calcite", - "minecraft:deepslate", - "minecraft:dripstone_block", - "minecraft:smooth_basalt", - "minecraft:tuff", { "id" : "minecraft:blackstone", "required" : false diff --git a/src/main/resources/tags/climbing_pick_weak_surfaces.json b/src/main/resources/tags/climbing_pick_weak_surfaces.json index 88fa36993..902bfac23 100644 --- a/src/main/resources/tags/climbing_pick_weak_surfaces.json +++ b/src/main/resources/tags/climbing_pick_weak_surfaces.json @@ -2,8 +2,6 @@ "values" : [ "#slimefun:concrete_powders", "#minecraft:sand", - "minecraft:gravel", - "minecraft:skulk", - "minecraft:clay" + "minecraft:gravel" ] } From bf11828e34f94dc3b59c23762b3780b0bfca2f18 Mon Sep 17 00:00:00 2001 From: Varian Anora Date: Thu, 23 Feb 2023 14:44:52 +0700 Subject: [PATCH 130/146] make mud not required --- src/main/resources/tags/mangrove_base_blocks.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/resources/tags/mangrove_base_blocks.json b/src/main/resources/tags/mangrove_base_blocks.json index 14312fe4b..640b0da6f 100644 --- a/src/main/resources/tags/mangrove_base_blocks.json +++ b/src/main/resources/tags/mangrove_base_blocks.json @@ -2,6 +2,9 @@ "values" : [ "#slimefun:dirt_variants", "minecraft:clay", - "minecraft:mud" + { + "id" : "minecraft:mud", + "required" : false + } ] } From da3f6bd04973d66dfe69643afd0cdf960e378679 Mon Sep 17 00:00:00 2001 From: Ritwik-main <116669493+Ritwik-main@users.noreply.github.com> Date: Thu, 23 Feb 2023 13:15:48 +0530 Subject: [PATCH 131/146] more blocks for climbing pickaxe take 3? adding the new 1.18 and 1.19 blocks into climbing pick surfaces, as new blcoks generate in the world naturally and might need to be climbed --- .../tags/climbing_pick_strong_surfaces.json | 24 +++++++++++++++++-- .../tags/climbing_pick_weak_surfaces.json | 7 +++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/main/resources/tags/climbing_pick_strong_surfaces.json b/src/main/resources/tags/climbing_pick_strong_surfaces.json index ca798a9bd..7b69bd4d5 100644 --- a/src/main/resources/tags/climbing_pick_strong_surfaces.json +++ b/src/main/resources/tags/climbing_pick_strong_surfaces.json @@ -11,6 +11,26 @@ { "id" : "minecraft:basalt", "required" : false - } + }, + { + "id" : "minecraft:calcite", + "required" : false + }, + { + "id" : "minecraft:deepslate", + "required" : false + }, + { + "id" : "minecraft:dripstone_block", + "required" : false + }, + { + "id" : "minecraft:smooth_basalt", + "required" : false + }, + { + "id" : "minecraft:tuff", + "required" : false + } ] -} +} \ No newline at end of file diff --git a/src/main/resources/tags/climbing_pick_weak_surfaces.json b/src/main/resources/tags/climbing_pick_weak_surfaces.json index 902bfac23..f737e2841 100644 --- a/src/main/resources/tags/climbing_pick_weak_surfaces.json +++ b/src/main/resources/tags/climbing_pick_weak_surfaces.json @@ -2,6 +2,11 @@ "values" : [ "#slimefun:concrete_powders", "#minecraft:sand", - "minecraft:gravel" + "minecraft:gravel", + "minecraft:clay", + { + "id" : "minecraft:skulk", + "required" : false + } ] } From d111b1bffb3bff42e2156e2ea64cf4b2587121ef Mon Sep 17 00:00:00 2001 From: Ritwik-main <116669493+Ritwik-main@users.noreply.github.com> Date: Thu, 23 Feb 2023 13:24:55 +0530 Subject: [PATCH 132/146] Update src/main/resources/tags/climbing_pick_strong_surfaces.json Co-authored-by: Varian Anora --- src/main/resources/tags/climbing_pick_strong_surfaces.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/tags/climbing_pick_strong_surfaces.json b/src/main/resources/tags/climbing_pick_strong_surfaces.json index 7b69bd4d5..2079ac218 100644 --- a/src/main/resources/tags/climbing_pick_strong_surfaces.json +++ b/src/main/resources/tags/climbing_pick_strong_surfaces.json @@ -33,4 +33,4 @@ "required" : false } ] -} \ No newline at end of file +} From 0622261e862549cbcc250180a8a4c25480f5d754 Mon Sep 17 00:00:00 2001 From: Ritwik-main <116669493+Ritwik-main@users.noreply.github.com> Date: Thu, 23 Feb 2023 13:25:02 +0530 Subject: [PATCH 133/146] Update src/main/resources/tags/climbing_pick_strong_surfaces.json Co-authored-by: Varian Anora --- src/main/resources/tags/climbing_pick_strong_surfaces.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/tags/climbing_pick_strong_surfaces.json b/src/main/resources/tags/climbing_pick_strong_surfaces.json index 2079ac218..148f66f4b 100644 --- a/src/main/resources/tags/climbing_pick_strong_surfaces.json +++ b/src/main/resources/tags/climbing_pick_strong_surfaces.json @@ -14,7 +14,7 @@ }, { "id" : "minecraft:calcite", - "required" : false + "required" : false }, { "id" : "minecraft:deepslate", From ad2b425cd64f1289e07bd6a4ca0b68aa383e979c Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 23 Feb 2023 16:25:57 +0100 Subject: [PATCH 134/146] [CI skip] Updated changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dd5677d9..c659ebac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,9 +40,20 @@ #### Additions * Added "Cobbled Deepslate -> Gravel" recipe to the Grind Stone * Added "Cobbled Deepslate -> Sand" recipe to the Ore Crusher +* (API) Added EnergyNet#getGenerators() +* (API) Added EnergyNet#getCapacitors() +* (API) Added EnergyNet#getConsumers() #### Changes * Removed 1.14.* and 1.15.* support +* The Climbing Pick now also works on: + * Calcite + * Deepslate + * Dripstone blocks + * Smooth Basalt + * Tuff + * Clay + * Skulk #### Fixes * Fixed #3741 From 34905ebffa2afb99eeb4eadd856cd008adc80f50 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Sun, 26 Feb 2023 06:28:27 -0600 Subject: [PATCH 135/146] Add overflow protection (untested) --- .../core/networks/energy/EnergyNet.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index 516c3dba5..834dcd925 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -157,7 +157,9 @@ public class EnergyNet extends Network implements HologramOwner { if (connectorNodes.isEmpty() && terminusNodes.isEmpty()) { updateHologram(b, "&4No Energy Network found"); } else { - int supply = tickAllGenerators(timestamp::getAndAdd) + tickAllCapacitors(); + int generatorsSupply = tickAllGenerators(timestamp::getAndAdd); + int capacitorsSupply = tickAllCapacitors(); + int supply = overflowSafeAddition(generatorsSupply, capacitorsSupply); int remainingEnergy = supply; int demand = 0; @@ -245,7 +247,7 @@ public class EnergyNet extends Network implements HologramOwner { int energy = provider.getGeneratedOutput(loc, data); if (provider.isChargeable()) { - energy += provider.getCharge(loc, data); + energy = overflowSafeAddition(energy, provider.getCharge(loc, data)); } if (provider.willExplode(loc, data)) { @@ -257,7 +259,7 @@ public class EnergyNet extends Network implements HologramOwner { loc.getWorld().createExplosion(loc, 0F, false); }); } else { - supply += energy; + supply = overflowSafeAddition(supply, energy); } } catch (Exception | LinkageError throwable) { explodedBlocks.add(loc); @@ -280,11 +282,22 @@ public class EnergyNet extends Network implements HologramOwner { int supply = 0; for (Map.Entry entry : capacitors.entrySet()) { - supply += entry.getValue().getCharge(entry.getKey()); + supply = overflowSafeAddition(supply, entry.getValue().getCharge(entry.getKey())); } return supply; } + + /** + * This detects if 2 integers will overflow and if they will, returns {@link Integer#MAX_VALUE} + * @param i1 the first integer + * @param i2 the second integer + * @return {@link Integer#MAX_VALUE} if overflow detected else the sum of i1 and i2 + */ + private int overflowSafeAddition(int i1, int i2) { + boolean willOverflow = (i1 == Integer.MAX_VALUE || i2 == Integer.MAX_VALUE) || i1 >= 0 ? i2 > Integer.MAX_VALUE - i1 : i2 < Integer.MIN_VALUE - i1; + return willOverflow ? Integer.MAX_VALUE : i1 + i2; + } private void updateHologram(@Nonnull Block b, double supply, double demand) { if (demand > supply) { From e51f9106339f02855fba17dc9696ffb079d773c0 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Sun, 26 Feb 2023 08:02:22 -0600 Subject: [PATCH 136/146] Handle underflow properly --- .../core/networks/energy/EnergyNet.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index 834dcd925..195f276fe 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -159,7 +159,7 @@ public class EnergyNet extends Network implements HologramOwner { } else { int generatorsSupply = tickAllGenerators(timestamp::getAndAdd); int capacitorsSupply = tickAllCapacitors(); - int supply = overflowSafeAddition(generatorsSupply, capacitorsSupply); + int supply = flowSafeAddition(generatorsSupply, capacitorsSupply); int remainingEnergy = supply; int demand = 0; @@ -171,7 +171,7 @@ public class EnergyNet extends Network implements HologramOwner { if (charge < capacity) { int availableSpace = capacity - charge; - demand += availableSpace; + demand = flowSafeAddition(demand, availableSpace); if (remainingEnergy > 0) { if (remainingEnergy > availableSpace) { @@ -247,7 +247,7 @@ public class EnergyNet extends Network implements HologramOwner { int energy = provider.getGeneratedOutput(loc, data); if (provider.isChargeable()) { - energy = overflowSafeAddition(energy, provider.getCharge(loc, data)); + energy = flowSafeAddition(energy, provider.getCharge(loc, data)); } if (provider.willExplode(loc, data)) { @@ -259,7 +259,7 @@ public class EnergyNet extends Network implements HologramOwner { loc.getWorld().createExplosion(loc, 0F, false); }); } else { - supply = overflowSafeAddition(supply, energy); + supply = flowSafeAddition(supply, energy); } } catch (Exception | LinkageError throwable) { explodedBlocks.add(loc); @@ -282,21 +282,28 @@ public class EnergyNet extends Network implements HologramOwner { int supply = 0; for (Map.Entry entry : capacitors.entrySet()) { - supply = overflowSafeAddition(supply, entry.getValue().getCharge(entry.getKey())); + supply = flowSafeAddition(supply, entry.getValue().getCharge(entry.getKey())); } return supply; } /** - * This detects if 2 integers will overflow and if they will, returns {@link Integer#MAX_VALUE} + * This detects if 2 integers will overflow/underflow and if they will, returns the corresponding value * @param i1 the first integer * @param i2 the second integer - * @return {@link Integer#MAX_VALUE} if overflow detected else the sum of i1 and i2 + * @return {@link Integer#MAX_VALUE} if overflow detected, {@link Integer#MIN_VALUE} if underflow detected, otherwise the sum of i1 and i2 */ - private int overflowSafeAddition(int i1, int i2) { - boolean willOverflow = (i1 == Integer.MAX_VALUE || i2 == Integer.MAX_VALUE) || i1 >= 0 ? i2 > Integer.MAX_VALUE - i1 : i2 < Integer.MIN_VALUE - i1; - return willOverflow ? Integer.MAX_VALUE : i1 + i2; + private int flowSafeAddition(int i1, int i2) { + boolean willOverflow = (i1 == Integer.MAX_VALUE && i2 > 0|| i2 == Integer.MAX_VALUE && i1 > 0) || i1 > 0 && i2 > Integer.MAX_VALUE - i1; + boolean willUnderflow = (i1 == Integer.MIN_VALUE && i2 < 0|| i2 == Integer.MIN_VALUE && i1 < 0) || i1 < 0 && i2 < Integer.MIN_VALUE - i1; + if (willOverflow) { + return Integer.MAX_VALUE; + } else if (willUnderflow) { + return Integer.MIN_VALUE; + } else { + return i1 + i2; + } } private void updateHologram(@Nonnull Block b, double supply, double demand) { From 800abe0f3c556f2fb776c5012f83bd7ff3d97b1c Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Sun, 26 Feb 2023 09:01:12 -0600 Subject: [PATCH 137/146] Add Spaces before Or Operators Co-authored-by: J3fftw <44972470+J3fftw1@users.noreply.github.com> --- .../slimefun4/core/networks/energy/EnergyNet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index 195f276fe..af28ce9a2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -295,8 +295,8 @@ public class EnergyNet extends Network implements HologramOwner { * @return {@link Integer#MAX_VALUE} if overflow detected, {@link Integer#MIN_VALUE} if underflow detected, otherwise the sum of i1 and i2 */ private int flowSafeAddition(int i1, int i2) { - boolean willOverflow = (i1 == Integer.MAX_VALUE && i2 > 0|| i2 == Integer.MAX_VALUE && i1 > 0) || i1 > 0 && i2 > Integer.MAX_VALUE - i1; - boolean willUnderflow = (i1 == Integer.MIN_VALUE && i2 < 0|| i2 == Integer.MIN_VALUE && i1 < 0) || i1 < 0 && i2 < Integer.MIN_VALUE - i1; + boolean willOverflow = (i1 == Integer.MAX_VALUE && i2 > 0 || i2 == Integer.MAX_VALUE && i1 > 0) || i1 > 0 && i2 > Integer.MAX_VALUE - i1; + boolean willUnderflow = (i1 == Integer.MIN_VALUE && i2 < 0 || i2 == Integer.MIN_VALUE && i1 < 0) || i1 < 0 && i2 < Integer.MIN_VALUE - i1; if (willOverflow) { return Integer.MAX_VALUE; } else if (willUnderflow) { From 137cdc94bf73b06a8a6c850557f66734c5be0c1d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 11:20:21 +0100 Subject: [PATCH 138/146] [CI skip] Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.11.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2f0eb93ae..bebefcf44 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 From 1d24e832b551f98f687b8c6cd17f2ab5f973076c Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Thu, 2 Mar 2023 06:16:07 -0600 Subject: [PATCH 139/146] Requested Changes (Next Up Unit Tests) --- .../core/networks/energy/EnergyNet.java | 28 ++++------------- .../slimefun4/utils/NumberUtils.java | 30 +++++++++++++++++++ 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java index af28ce9a2..cb7c2c910 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/networks/energy/EnergyNet.java @@ -159,7 +159,7 @@ public class EnergyNet extends Network implements HologramOwner { } else { int generatorsSupply = tickAllGenerators(timestamp::getAndAdd); int capacitorsSupply = tickAllCapacitors(); - int supply = flowSafeAddition(generatorsSupply, capacitorsSupply); + int supply = NumberUtils.flowSafeAddition(generatorsSupply, capacitorsSupply); int remainingEnergy = supply; int demand = 0; @@ -171,7 +171,7 @@ public class EnergyNet extends Network implements HologramOwner { if (charge < capacity) { int availableSpace = capacity - charge; - demand = flowSafeAddition(demand, availableSpace); + demand = NumberUtils.flowSafeAddition(demand, availableSpace); if (remainingEnergy > 0) { if (remainingEnergy > availableSpace) { @@ -247,7 +247,7 @@ public class EnergyNet extends Network implements HologramOwner { int energy = provider.getGeneratedOutput(loc, data); if (provider.isChargeable()) { - energy = flowSafeAddition(energy, provider.getCharge(loc, data)); + energy = NumberUtils.flowSafeAddition(energy, provider.getCharge(loc, data)); } if (provider.willExplode(loc, data)) { @@ -259,7 +259,7 @@ public class EnergyNet extends Network implements HologramOwner { loc.getWorld().createExplosion(loc, 0F, false); }); } else { - supply = flowSafeAddition(supply, energy); + supply = NumberUtils.flowSafeAddition(supply, energy); } } catch (Exception | LinkageError throwable) { explodedBlocks.add(loc); @@ -282,29 +282,11 @@ public class EnergyNet extends Network implements HologramOwner { int supply = 0; for (Map.Entry entry : capacitors.entrySet()) { - supply = flowSafeAddition(supply, entry.getValue().getCharge(entry.getKey())); + supply = NumberUtils.flowSafeAddition(supply, entry.getValue().getCharge(entry.getKey())); } return supply; } - - /** - * This detects if 2 integers will overflow/underflow and if they will, returns the corresponding value - * @param i1 the first integer - * @param i2 the second integer - * @return {@link Integer#MAX_VALUE} if overflow detected, {@link Integer#MIN_VALUE} if underflow detected, otherwise the sum of i1 and i2 - */ - private int flowSafeAddition(int i1, int i2) { - boolean willOverflow = (i1 == Integer.MAX_VALUE && i2 > 0 || i2 == Integer.MAX_VALUE && i1 > 0) || i1 > 0 && i2 > Integer.MAX_VALUE - i1; - boolean willUnderflow = (i1 == Integer.MIN_VALUE && i2 < 0 || i2 == Integer.MIN_VALUE && i1 < 0) || i1 < 0 && i2 < Integer.MIN_VALUE - i1; - if (willOverflow) { - return Integer.MAX_VALUE; - } else if (willUnderflow) { - return Integer.MIN_VALUE; - } else { - return i1 + i2; - } - } private void updateHologram(@Nonnull Block b, double supply, double demand) { if (demand > supply) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java index 274361710..154085b54 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java @@ -281,4 +281,34 @@ public final class NumberUtils { return 0; } } + + /** + * This detects if 2 integers will overflow/underflow and if they will, returns the corresponding value + * @param a the first integer + * @param b the second integer + * @return {@link Integer#MAX_VALUE} if overflow detected, {@link Integer#MIN_VALUE} if underflow detected, otherwise the sum of i1 and i2 + */ + public static int flowSafeAddition(int a, int b) { + return limitedAddition(a, b, Integer.MAX_VALUE, Integer.MIN_VALUE); + } + + /** + * This detects if 2 integers will overflow/underflow past a maximum or minimum value and if they will, returns the corresponding value + * @param a the first integer + * @param b the second integer + * @param max the maximum value for the operation + * @param min the minimum value for the operation + * @return {@link Integer#MAX_VALUE} if overflow detected, {@link Integer#MIN_VALUE} if underflow detected, otherwise the sum of i1 and i2 + */ + public static int limitedAddition(int a, int b, int max, int min) { + boolean willOverflow = (a == max && b > 0 || b == max && a > 0) || a > 0 && b > max - a; + boolean willUnderflow = (a == min && b < 0 || b == min && a < 0) || a < 0 && b < min - a; + if (willOverflow) { + return max; + } else if (willUnderflow) { + return min; + } else { + return a + b; + } + } } From cc557a19cf9e29a7c267da20b5db2631b9193456 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Thu, 2 Mar 2023 06:20:00 -0600 Subject: [PATCH 140/146] Javadocs --- .../io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java index 154085b54..2c935f1bd 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java @@ -286,7 +286,7 @@ public final class NumberUtils { * This detects if 2 integers will overflow/underflow and if they will, returns the corresponding value * @param a the first integer * @param b the second integer - * @return {@link Integer#MAX_VALUE} if overflow detected, {@link Integer#MIN_VALUE} if underflow detected, otherwise the sum of i1 and i2 + * @return {@link Integer#MAX_VALUE} if overflow detected, {@link Integer#MIN_VALUE} if underflow detected, otherwise the sum of a and b */ public static int flowSafeAddition(int a, int b) { return limitedAddition(a, b, Integer.MAX_VALUE, Integer.MIN_VALUE); @@ -298,7 +298,7 @@ public final class NumberUtils { * @param b the second integer * @param max the maximum value for the operation * @param min the minimum value for the operation - * @return {@link Integer#MAX_VALUE} if overflow detected, {@link Integer#MIN_VALUE} if underflow detected, otherwise the sum of i1 and i2 + * @return max if overflow detected, min if underflow detected, otherwise the sum of a and b */ public static int limitedAddition(int a, int b, int max, int min) { boolean willOverflow = (a == max && b > 0 || b == max && a > 0) || a > 0 && b > max - a; From 9029dbadbaa3c4cf00c19c68351df9a8c2d6f262 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Thu, 2 Mar 2023 06:44:44 -0600 Subject: [PATCH 141/146] Add Unit Tests Testing these locally the tests were pasted --- .../slimefun4/utils/TestNumberUtils.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestNumberUtils.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestNumberUtils.java index e5eca34a1..c6672e000 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestNumberUtils.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestNumberUtils.java @@ -91,4 +91,29 @@ class TestNumberUtils { Assertions.assertEquals("-2Q", NumberUtils.getCompactDouble(-2000000000000000.0)); } + @Test + @DisplayName("Test flow safe addition") + void testFlowSafeAddition() { + Assertions.assertEquals(Integer.MAX_VALUE, NumberUtils.flowSafeAddition(Integer.MAX_VALUE, 1)); + Assertions.assertEquals(Integer.MAX_VALUE, NumberUtils.flowSafeAddition(1, Integer.MAX_VALUE)); + Assertions.assertEquals(Integer.MAX_VALUE, NumberUtils.flowSafeAddition(Integer.MAX_VALUE - 1, 2)); + Assertions.assertEquals(Integer.MAX_VALUE, NumberUtils.flowSafeAddition(2, Integer.MAX_VALUE - 1)); + Assertions.assertEquals(Integer.MIN_VALUE, NumberUtils.flowSafeAddition(Integer.MIN_VALUE, -1)); + Assertions.assertEquals(Integer.MIN_VALUE, NumberUtils.flowSafeAddition(-1, Integer.MIN_VALUE)); + Assertions.assertEquals(Integer.MIN_VALUE, NumberUtils.flowSafeAddition(Integer.MIN_VALUE + 1, -2)); + Assertions.assertEquals(Integer.MIN_VALUE, NumberUtils.flowSafeAddition(-2, Integer.MIN_VALUE + 1)); + } + + @Test + @DisplayName("Test limited addition") + void testLimitedAddition() { + Assertions.assertEquals(1000, NumberUtils.limitedAddition(1000, 1, 1000, -1000)); + Assertions.assertEquals(1000, NumberUtils.limitedAddition(1, 1000, 1000, -1000)); + Assertions.assertEquals(1000, NumberUtils.limitedAddition(999, 2, 1000, -1000)); + Assertions.assertEquals(1000, NumberUtils.limitedAddition(2, 999, 1000, -1000)); + Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-1000, -1, 1000, -1000)); + Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-1, -1000, 1000, -1000)); + Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-999, -2, 1000, -1000)); + Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-2, -999, 1000, -1000)); + } } From e32f95bc56506b83dd85a507712575b12b5938a7 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Thu, 2 Mar 2023 08:17:48 -0600 Subject: [PATCH 142/146] Flip the parameters By checking if the unique id as a string equals the locationinfo, we avoid the null pointer exception, this is how it is achieved in this same class line 177 --- .../implementation/items/androids/ProgrammableAndroid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java index cd91ef4e5..182b293d9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java @@ -94,7 +94,7 @@ public class ProgrammableAndroid extends SlimefunItem implements InventoryBlock, @Override public boolean canOpen(Block b, Player p) { - boolean open = BlockStorage.getLocationInfo(b.getLocation(), "owner").equals(p.getUniqueId().toString()) || p.hasPermission("slimefun.android.bypass"); + boolean open = p.getUniqueId().toString().equals(BlockStorage.getLocationInfo(b.getLocation(), "owner")) || p.hasPermission("slimefun.android.bypass"); if (!open) { Slimefun.getLocalization().sendMessage(p, "inventory.no-access", true); From 7821258589af497656bed4ad34b75f678ae17524 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Thu, 2 Mar 2023 09:11:55 -0600 Subject: [PATCH 143/146] Update src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java Co-authored-by: TheBusyBiscuit --- .../thebusybiscuit/slimefun4/utils/NumberUtils.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java index 2c935f1bd..d56ee113a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java @@ -302,10 +302,14 @@ public final class NumberUtils { */ public static int limitedAddition(int a, int b, int max, int min) { boolean willOverflow = (a == max && b > 0 || b == max && a > 0) || a > 0 && b > max - a; - boolean willUnderflow = (a == min && b < 0 || b == min && a < 0) || a < 0 && b < min - a; + if (willOverflow) { return max; - } else if (willUnderflow) { + } + + boolean willUnderflow = (a == min && b < 0 || b == min && a < 0) || a < 0 && b < min - a; + + if (willUnderflow) { return min; } else { return a + b; From adf5ae7a6f965dcb8f1d58f22d16b01700f60c4d Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Thu, 2 Mar 2023 09:15:47 -0600 Subject: [PATCH 144/146] Flip the order of max and min --- .../slimefun4/utils/NumberUtils.java | 6 +++--- .../slimefun4/utils/TestNumberUtils.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java index d56ee113a..0b85e6e68 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/NumberUtils.java @@ -289,18 +289,18 @@ public final class NumberUtils { * @return {@link Integer#MAX_VALUE} if overflow detected, {@link Integer#MIN_VALUE} if underflow detected, otherwise the sum of a and b */ public static int flowSafeAddition(int a, int b) { - return limitedAddition(a, b, Integer.MAX_VALUE, Integer.MIN_VALUE); + return limitedAddition(a, b, Integer.MIN_VALUE, Integer.MAX_VALUE); } /** * This detects if 2 integers will overflow/underflow past a maximum or minimum value and if they will, returns the corresponding value * @param a the first integer * @param b the second integer - * @param max the maximum value for the operation * @param min the minimum value for the operation + * @param max the maximum value for the operation * @return max if overflow detected, min if underflow detected, otherwise the sum of a and b */ - public static int limitedAddition(int a, int b, int max, int min) { + public static int limitedAddition(int a, int b, int min, int max) { boolean willOverflow = (a == max && b > 0 || b == max && a > 0) || a > 0 && b > max - a; if (willOverflow) { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestNumberUtils.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestNumberUtils.java index c6672e000..cb6d40a23 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestNumberUtils.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestNumberUtils.java @@ -107,13 +107,13 @@ class TestNumberUtils { @Test @DisplayName("Test limited addition") void testLimitedAddition() { - Assertions.assertEquals(1000, NumberUtils.limitedAddition(1000, 1, 1000, -1000)); - Assertions.assertEquals(1000, NumberUtils.limitedAddition(1, 1000, 1000, -1000)); - Assertions.assertEquals(1000, NumberUtils.limitedAddition(999, 2, 1000, -1000)); - Assertions.assertEquals(1000, NumberUtils.limitedAddition(2, 999, 1000, -1000)); - Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-1000, -1, 1000, -1000)); - Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-1, -1000, 1000, -1000)); - Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-999, -2, 1000, -1000)); - Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-2, -999, 1000, -1000)); + Assertions.assertEquals(1000, NumberUtils.limitedAddition(1000, 1, -1000, 1000)); + Assertions.assertEquals(1000, NumberUtils.limitedAddition(1, 1000, -1000, 1000)); + Assertions.assertEquals(1000, NumberUtils.limitedAddition(999, 2, -1000, 1000)); + Assertions.assertEquals(1000, NumberUtils.limitedAddition(2, 999, -1000, 1000)); + Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-1000, -1, -1000, 1000)); + Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-1, -1000, -1000, 1000)); + Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-999, -2, -1000, 1000)); + Assertions.assertEquals(-1000, NumberUtils.limitedAddition(-2, -999, -1000, 1000)); } } From 8f36b199258b115248c22e8762808454f168da23 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 4 Mar 2023 11:12:22 +0100 Subject: [PATCH 145/146] [CI skip] Updated changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c659ebac7..0bc49535d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ * (API) Added EnergyNet#getGenerators() * (API) Added EnergyNet#getCapacitors() * (API) Added EnergyNet#getConsumers() +* Added Bamboo as a fuel type for Tier 1 Androids #### Changes * Removed 1.14.* and 1.15.* support @@ -57,6 +58,8 @@ #### Fixes * Fixed #3741 +* Fixed #3724 +* Fixed #3462 ## Release Candidate 33 (07 Jan 2023) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#33 From 8606aa66cc6d65e8261ace73913ad4d8ec9e34c1 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Sat, 4 Mar 2023 11:21:04 +0100 Subject: [PATCH 146/146] [CI skip] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bc49535d..73c8fc8a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ * Fixed #3741 * Fixed #3724 * Fixed #3462 +* Fixed #3758 ## Release Candidate 33 (07 Jan 2023) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#33