From de0b173ff5253bbc17adb1272f005a2ae7d2d77d Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 24 Oct 2021 23:53:00 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9Wiki=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E4=B8=BA=E9=9D=9E=E5=AE=98=E6=96=B9=E4=B8=AD=E6=96=87Wiki?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../slimefun4/api/items/SlimefunItem.java | 2 +- .../guide/options/SlimefunGuideSettings.java | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java index edfd06ebd0..e638efcba5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java @@ -860,7 +860,7 @@ public void postRegister() { */ public final void addOfficialWikipage(@Nonnull String page) { Validate.notNull(page, "Wiki page cannot be null."); - wikiURL = Optional.of("https://github.com/Slimefun/Slimefun4/wiki/" + page); + wikiURL = Optional.of("https://slimefun.guizhanss.wiki/#/" + page); } /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java index 48b7ac5a50..17a6ad4255 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java @@ -124,40 +124,40 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { // @formatter:off menu.addItem(6, new CustomItemStack(Material.COMPARATOR, "&e" + locale.getMessage(p, "guide.title.source"), - "", "&7Last Activity: &a" + NumberUtils.getElapsedTime(github.getLastUpdate()) + " ago", + "", "&7最近活动于: &a" + NumberUtils.getElapsedTime(github.getLastUpdate()) + " 前", "&7Forks: &e" + github.getForks(), "&7Stars: &e" + github.getStars(), "", - "&7&oSlimefun 4 is a community project,", - "&7&othe source code is available on GitHub", - "&7&oand if you want to keep this Plugin alive,", - "&7&othen please consider contributing to it", + "&7&oSlimefun 4 是一个由社区参与的项目,", + "&7&o源代码可以在 GitHub 上找到", + "&7&o如果你想让这个项目持续下去", + "&7&o你可以考虑对项目做出贡献", "", - "&7\u21E8 &eClick to go to GitHub" + "&7\u21E8 &e点击前往汉化版 GitHub 仓库" )); // @formatter:on menu.addMenuClickHandler(6, (pl, slot, item, action) -> { pl.closeInventory(); - ChatUtils.sendURL(pl, "https://github.com/Slimefun/Slimefun4"); + ChatUtils.sendURL(pl, "https://github.com/StarwishSama/Slimefun4"); return false; }); // @formatter:off menu.addItem(8, new CustomItemStack(Material.KNOWLEDGE_BOOK, "&3" + locale.getMessage(p, "guide.title.wiki"), - "", "&7Do you need help with an Item or machine?", - "&7You cannot figure out what to do?", - "&7Check out our community-maintained Wiki", - "&7and become one of our Editors!", + "", "&7你需要对物品或机器方面的帮助吗?", + "&7你不知道要干什么?", + "&7查看我们的由社区维护的维基", + "&7并考虑成为一名编辑者!", "", - "&7\u21E8 &eClick to go to the official Slimefun Wiki" + "&7\u21E8 &e点击前往非官方中文 Wiki" )); // @formatter:on menu.addMenuClickHandler(8, (pl, slot, item, action) -> { pl.closeInventory(); - ChatUtils.sendURL(pl, "https://github.com/Slimefun/Slimefun4/wiki"); + ChatUtils.sendURL(pl, "https://slimefun.guizhanss.wiki/"); return false; }); @@ -165,19 +165,19 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { menu.addItem(47, new CustomItemStack(Material.BOOKSHELF, "&3" + locale.getMessage(p, "guide.title.addons"), "", - "&7Slimefun is huge. But its addons are what makes", - "&7this plugin truly shine. Go check them out, some", - "&7of them may be exactly what you were missing out on!", + "&7Slimefun 是一个大型项目,但附属插件的存在", + "&7能让Slimefun真正的发光发亮", + "&7看一看它们,也许你要寻找的附属插件就在那里!", "", - "&7Installed on this Server: &b" + Slimefun.getInstalledAddons().size(), + "&7该服务器已安装附属插件: &b" + Slimefun.getInstalledAddons().size(), "", - "&7\u21E8 &eClick to see all available addons for Slimefun4" + "&7\u21E8 &e点击查看Slimefun4所有可用的附属插件列表" )); // @formatter:on menu.addMenuClickHandler(47, (pl, slot, item, action) -> { pl.closeInventory(); - ChatUtils.sendURL(pl, "https://github.com/Slimefun/Slimefun4/wiki/Addons"); + ChatUtils.sendURL(pl, "https://slimefun.guizhanss.wiki/#/Addons"); return false; }); From 576185017c1ab3fe8dba94b5f82e43f960b44a55 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Mon, 25 Oct 2021 13:20:51 +0800 Subject: [PATCH 02/13] Update src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java Co-authored-by: StarWishsama --- .../slimefun4/core/guide/options/SlimefunGuideSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java index 17a6ad4255..80b275d974 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java @@ -166,7 +166,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { "&3" + locale.getMessage(p, "guide.title.addons"), "", "&7Slimefun 是一个大型项目,但附属插件的存在", - "&7能让Slimefun真正的发光发亮", + "&7能让 Slimefun 真正的发光发亮", "&7看一看它们,也许你要寻找的附属插件就在那里!", "", "&7该服务器已安装附属插件: &b" + Slimefun.getInstalledAddons().size(), From 4a562cbb073061cc7613c0f6200c709d7dc43a10 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Mon, 25 Oct 2021 13:21:08 +0800 Subject: [PATCH 03/13] Update src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java Co-authored-by: StarWishsama --- .../slimefun4/core/guide/options/SlimefunGuideSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java index 80b275d974..2a46c521cf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java @@ -171,7 +171,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { "", "&7该服务器已安装附属插件: &b" + Slimefun.getInstalledAddons().size(), "", - "&7\u21E8 &e点击查看Slimefun4所有可用的附属插件列表" + "&7\u21E8 &e点击查看 Slimefun4 可用的附属插件" )); // @formatter:on From a19c64a9746f517cb46d2134141c8502d0f3be60 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Tue, 26 Oct 2021 23:58:36 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=E5=B8=A6#?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E7=9A=84=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java index e638efcba5..55bc34e750 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java @@ -860,6 +860,8 @@ public void postRegister() { */ public final void addOfficialWikipage(@Nonnull String page) { Validate.notNull(page, "Wiki page cannot be null."); + // 转换链接 + page = page.replace("#", "?id="); wikiURL = Optional.of("https://slimefun.guizhanss.wiki/#/" + page); } From 577ee33cb33544d6dfe6bc8f6fea788bb0c74575 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 9 Nov 2021 14:46:09 +0000 Subject: [PATCH 05/13] Update dependency org.sonarsource.scanner.maven:sonar-maven-plugin to v3.9.1.2184 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 064ac66454..46ef405f65 100644 --- a/pom.xml +++ b/pom.xml @@ -158,7 +158,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.0.2155 + 3.9.1.2184 From 09b3f0789a7afe005a1c96e0cb0cb80e0fcefb10 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 14 Nov 2021 21:43:11 +0800 Subject: [PATCH 06/13] =?UTF-8?q?chore(trans):=20=E5=87=8B=E7=81=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../slimefun4/implementation/SlimefunItems.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 42272a7a41..f41bbbcd11 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -406,8 +406,8 @@ private SlimefunItems() { public static final SlimefunItemStack SCROLL_OF_DIMENSIONAL_TELEPOSITION = new SlimefunItemStack("SCROLL_OF_DIMENSIONAL_TELEPOSITION", Material.PAPER, "&6维度传送卷轴", "", "&c这个卷轴可以便携地创建", "&c一个临时的黑洞", "&c将附近的实体都传送至", "&c另一个维度上", "&c所有东西都反转了", "", "&r就是说: 让实体转180°"); public static final SlimefunItemStack TOME_OF_KNOWLEDGE_SHARING = new SlimefunItemStack("TOME_OF_KNOWLEDGE_SHARING", Material.ENCHANTED_BOOK, "&6学识巨著", "&7主人: &bNone", "", "&e右键&7 以绑定你的所有研究", "", "", "&e右键&7 以获得前任主人的所有研究"); public static final SlimefunItemStack HARDENED_GLASS = new SlimefunItemStack("HARDENED_GLASS", Material.LIGHT_GRAY_STAINED_GLASS, "&7钢化玻璃", "", "&r可以抵抗爆炸"); - public static final SlimefunItemStack WITHER_PROOF_OBSIDIAN = new SlimefunItemStack("WITHER_PROOF_OBSIDIAN", Material.OBSIDIAN, "&5防凋零黑曜石", "", "&r可以抵抗爆炸和", "&r凋零的攻击"); - public static final SlimefunItemStack WITHER_PROOF_GLASS = new SlimefunItemStack("WITHER_PROOF_GLASS", Material.PURPLE_STAINED_GLASS, "&5防凋零玻璃", "", "&r可以抵抗爆炸和", "&r凋零的攻击"); + public static final SlimefunItemStack WITHER_PROOF_OBSIDIAN = new SlimefunItemStack("WITHER_PROOF_OBSIDIAN", Material.OBSIDIAN, "&5防凋灵黑曜石", "", "&r可以抵抗爆炸和", "&r凋灵的攻击"); + public static final SlimefunItemStack WITHER_PROOF_GLASS = new SlimefunItemStack("WITHER_PROOF_GLASS", Material.PURPLE_STAINED_GLASS, "&5防凋灵玻璃", "", "&r可以抵抗爆炸和", "&r凋灵的攻击"); public static final SlimefunItemStack REINFORCED_PLATE = new SlimefunItemStack("REINFORCED_PLATE", Material.PAPER, "&7钢筋板"); public static final SlimefunItemStack ANCIENT_PEDESTAL = new SlimefunItemStack("ANCIENT_PEDESTAL", Material.DISPENSER, "&d古代基座", "", "&5古代祭坛的一部分"); public static final SlimefunItemStack ANCIENT_ALTAR = new SlimefunItemStack("ANCIENT_ALTAR", Material.ENCHANTING_TABLE, "&d古代祭坛", "", "&5在世界里建造祭坛", "&5并用古老的仪式合成物品"); @@ -853,7 +853,7 @@ private SlimefunItems() { public static final SlimefunItemStack ARMOR_AUTO_CRAFTER = new SlimefunItemStack("ARMOR_AUTO_CRAFTER", HeadTexture.ARMOR_AUTO_CRAFTER, "&2自动合成机 &8(盔甲锻造)", "", "&f将机器放在任意能装物品的方块上", "&f就能自动合成盔甲锻造台可以合成的东西", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), "&8\u21E8 &e\u26A1 &7合成物品消耗 32 J"); public static final SlimefunItemStack IRON_GOLEM_ASSEMBLER = new SlimefunItemStack("IRON_GOLEM_ASSEMBLER", Material.IRON_BLOCK, "&6铁傀儡装配机", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7冷却时间: &b30 秒", LoreBuilder.powerBuffer(4096), "&8\u21E8 &e\u26A1 &72048 J/个铁傀儡"); - public static final SlimefunItemStack WITHER_ASSEMBLER = new SlimefunItemStack("WITHER_ASSEMBLER", Material.OBSIDIAN, "&5凋零装配机", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7冷却时间: &b30 秒", "&8\u21E8 &e\u26A1 &74096 J 可储存", "&8\u21E8 &e\u26A1 &74096 J/个凋灵"); + public static final SlimefunItemStack WITHER_ASSEMBLER = new SlimefunItemStack("WITHER_ASSEMBLER", Material.OBSIDIAN, "&5凋灵装配机", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7冷却时间: &b30 秒", "&8\u21E8 &e\u26A1 &74096 J 可储存", "&8\u21E8 &e\u26A1 &74096 J/个凋灵"); public static final SlimefunItemStack TRASH_CAN = new SlimefunItemStack("TRASH_CAN_BLOCK", HeadTexture.TRASH_CAN, "&3垃圾箱", "", "&r可以把不要的物品放进这里"); From c5285e5bfc95e1aaeaf40ba58da9ec851de5031a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 19 Nov 2021 18:52:47 +0000 Subject: [PATCH 07/13] Update dependency org.mockito:mockito-core to v4.1.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 46ef405f65..54b5b3a8fb 100644 --- a/pom.xml +++ b/pom.xml @@ -382,7 +382,7 @@ org.mockito mockito-core - 4.0.0 + 4.1.0 test From 96fdd47a5c8ea3803abca35e9bd6dffb520bf16d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 20 Nov 2021 16:18:47 +0000 Subject: [PATCH 08/13] Update dependency com.konghq:unirest-java to v3.13.4 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 54b5b3a8fb..3e12893432 100644 --- a/pom.xml +++ b/pom.xml @@ -360,7 +360,7 @@ com.konghq unirest-java - 3.13.3 + 3.13.4 compile From 20652a8fe0c464a385723a0cfe2ba772bb400955 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 25 Nov 2021 12:47:04 +0000 Subject: [PATCH 09/13] Update dependency io.papermc:paperlib to v1.0.7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3e12893432..68ae05d466 100644 --- a/pom.xml +++ b/pom.xml @@ -354,7 +354,7 @@ io.papermc paperlib - 1.0.6 + 1.0.7 compile From f4ad3d4e79a61dc33176df399c0a27bc24a98d46 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 28 Nov 2021 16:28:02 +0000 Subject: [PATCH 10/13] Update dependency org.junit.jupiter:junit-jupiter to v5.8.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 68ae05d466..8555e1e10f 100644 --- a/pom.xml +++ b/pom.xml @@ -376,7 +376,7 @@ org.junit.jupiter junit-jupiter - 5.8.1 + 5.8.2 test From 76b6e399ee01f3467459cdc3c70d742235ef836e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 29 Nov 2021 11:48:44 +0000 Subject: [PATCH 11/13] Update actions/setup-java action to v2.4.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 1e0a5e81fd..bd9d3e12b9 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v2.4.0 - name: Set up Java JDK 11 - uses: actions/setup-java@v2.3.1 + uses: actions/setup-java@v2.4.0 with: distribution: 'adopt' java-version: '11' diff --git a/.github/workflows/maven-compiler.yml b/.github/workflows/maven-compiler.yml index df3cd01480..7b74f88281 100644 --- a/.github/workflows/maven-compiler.yml +++ b/.github/workflows/maven-compiler.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v2 - name: Set up JDK 1.8 - uses: actions/setup-java@v2.3.1 + uses: actions/setup-java@v2.4.0 with: distribution: 'adopt' java-version: '8' diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 0cfd0fc39a..e93cf2bb94 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -21,7 +21,7 @@ jobs: fetch-depth: 0 - name: Set up JDK 11 - uses: actions/setup-java@v2.3.1 + uses: actions/setup-java@v2.4.0 with: distribution: 'adopt' java-version: '11' From bacaceb22f3ef0f7247b572dc5855bf2f3af86e0 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 30 Nov 2021 19:45:10 +0100 Subject: [PATCH 12/13] Refactored Industrial Miner ore handling --- .../miner/AdvancedIndustrialMiner.java | 3 + .../multiblocks/miner/IndustrialMiner.java | 81 ++++++------------- .../multiblocks/miner/OreDictionary.java | 22 +++++ .../multiblocks/miner/OreDictionary14.java | 44 ++++++++++ .../multiblocks/miner/OreDictionary16.java | 33 ++++++++ .../multiblocks/miner/OreDictionary17.java | 52 ++++++++++++ 6 files changed, 178 insertions(+), 57 deletions(-) create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary.java create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary14.java create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary16.java create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary17.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/AdvancedIndustrialMiner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/AdvancedIndustrialMiner.java index 2a93db3b55..5cec6e1b1e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/AdvancedIndustrialMiner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/AdvancedIndustrialMiner.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.miner; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -21,6 +23,7 @@ */ public class AdvancedIndustrialMiner extends IndustrialMiner { + @ParametersAreNonnullByDefault public AdvancedIndustrialMiner(ItemGroup itemGroup, SlimefunItemStack item) { super(itemGroup, item, Material.DIAMOND_BLOCK, true, 5); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java index ed8b949ed2..b9ace2cd64 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java @@ -51,6 +51,7 @@ public class IndustrialMiner extends MultiBlockMachine { protected final Map activeMiners = new HashMap<>(); protected final List fuelTypes = new ArrayList<>(); + private final OreDictionary oreDictionary; private final ItemSetting canMineAncientDebris = new ItemSetting<>(this, "can-mine-ancient-debris", false); private final ItemSetting canMineDeepslateOres = new ItemSetting<>(this, "can-mine-deepslate-ores", true); private final boolean silkTouch; @@ -58,7 +59,23 @@ public class IndustrialMiner extends MultiBlockMachine { @ParametersAreNonnullByDefault public IndustrialMiner(ItemGroup itemGroup, SlimefunItemStack item, Material baseMaterial, boolean silkTouch, int range) { - super(itemGroup, item, new ItemStack[] { null, null, null, new CustomItemStack(Material.PISTON, "Piston (facing up)"), new ItemStack(Material.CHEST), new CustomItemStack(Material.PISTON, "Piston (facing up)"), new ItemStack(baseMaterial), new ItemStack(Material.BLAST_FURNACE), new ItemStack(baseMaterial) }, BlockFace.UP); + // @formatter:off + super(itemGroup, item, new ItemStack[] { + null, null, null, + new CustomItemStack(Material.PISTON, "Piston (facing up)"), new ItemStack(Material.CHEST), new CustomItemStack(Material.PISTON, "Piston (facing up)"), + new ItemStack(baseMaterial), new ItemStack(Material.BLAST_FURNACE), new ItemStack(baseMaterial) + }, BlockFace.UP); + // @formatter:on + + MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion(); + + if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { + this.oreDictionary = new OreDictionary17(); + } else if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { + this.oreDictionary = new OreDictionary16(); + } else { + this.oreDictionary = new OreDictionary14(); + } this.range = range; this.silkTouch = silkTouch; @@ -114,67 +131,17 @@ protected void registerDefaultFuelTypes() { /** * This method returns the outcome that mining certain ores yields. * - * @param ore + * @param material * The {@link Material} of the ore that was mined * * @return The outcome when mining this ore */ - public @Nonnull ItemStack getOutcome(@Nonnull Material ore) { + public @Nonnull ItemStack getOutcome(@Nonnull Material material) { if (hasSilkTouch()) { - return new ItemStack(ore); - } - - MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion(); - Random random = ThreadLocalRandom.current(); - - if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { - // In 1.17, breaking metal ores should get raw metals. Also support deepslate ores. - switch (ore) { - case DEEPSLATE_COAL_ORE: - return new ItemStack(Material.COAL); - case DEEPSLATE_DIAMOND_ORE: - return new ItemStack(Material.DIAMOND); - case DEEPSLATE_EMERALD_ORE: - return new ItemStack(Material.EMERALD); - case DEEPSLATE_REDSTONE_ORE: - return new ItemStack(Material.REDSTONE, 4 + random.nextInt(2)); - case DEEPSLATE_LAPIS_ORE: - return new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4)); - case COPPER_ORE: - case DEEPSLATE_COPPER_ORE: - return new ItemStack(Material.RAW_COPPER); - case IRON_ORE: - case DEEPSLATE_IRON_ORE: - return new ItemStack(Material.RAW_IRON); - case GOLD_ORE: - case DEEPSLATE_GOLD_ORE: - return new ItemStack(Material.RAW_GOLD); - default: - break; - } - } - - // In 1.16, breaking nether gold ores should get gold nuggets - if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16) && ore == Material.NETHER_GOLD_ORE) { - return new ItemStack(Material.GOLD_NUGGET, 2 + random.nextInt(4)); - } - - switch (ore) { - case COAL_ORE: - return new ItemStack(Material.COAL); - case DIAMOND_ORE: - return new ItemStack(Material.DIAMOND); - case EMERALD_ORE: - return new ItemStack(Material.EMERALD); - case REDSTONE_ORE: - return new ItemStack(Material.REDSTONE, 4 + random.nextInt(2)); - case LAPIS_ORE: - return new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4)); - case NETHER_QUARTZ_ORE: - return new ItemStack(Material.QUARTZ); - default: - // This includes Iron and Gold ore (and Ancient Debris) - return new ItemStack(ore); + return new ItemStack(material); + } else { + Random random = ThreadLocalRandom.current(); + return oreDictionary.forMaterial(material, random); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary.java new file mode 100644 index 0000000000..46e7438646 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary.java @@ -0,0 +1,22 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.miner; + +import java.util.Random; + +import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; + +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; + +/** + * Simple interface to map ore blocks to their respective item(s). + * + * @author TheBusyBiscuit + * + */ +interface OreDictionary { + + @Nonnull + @ParametersAreNonnullByDefault + ItemStack forMaterial(Material material, Random random); +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary14.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary14.java new file mode 100644 index 0000000000..9000783881 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary14.java @@ -0,0 +1,44 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.miner; + +import java.util.Random; + +import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; + +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; + +/** + * Our {@link OreDictionary} implementation for MC 1.14 or higher. + * + * @author TheBusyBiscuit + * + */ +class OreDictionary14 implements OreDictionary { + + @Override + @ParametersAreNonnullByDefault + public @Nonnull ItemStack forMaterial(Material material, Random random) { + switch (material) { + case COAL_ORE: + return new ItemStack(Material.COAL); + case DIAMOND_ORE: + return new ItemStack(Material.DIAMOND); + case EMERALD_ORE: + return new ItemStack(Material.EMERALD); + case REDSTONE_ORE: + return new ItemStack(Material.REDSTONE, 4 + random.nextInt(2)); + case LAPIS_ORE: + return new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4)); + case NETHER_QUARTZ_ORE: + return new ItemStack(Material.QUARTZ); + case IRON_ORE: + return new ItemStack(Material.IRON_ORE); + case GOLD_ORE: + return new ItemStack(Material.GOLD_ORE); + default: + return 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 new file mode 100644 index 0000000000..43ec84778a --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary16.java @@ -0,0 +1,33 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.miner; + +import java.util.Random; + +import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; + +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; + +/** + * Our {@link OreDictionary} implementation for MC 1.16 or higher. + * + * @author TheBusyBiscuit + * + */ +class OreDictionary16 extends OreDictionary14 { + + @Override + @ParametersAreNonnullByDefault + public @Nonnull ItemStack forMaterial(Material material, Random random) { + switch (material) { + case NETHER_GOLD_ORE: + // In 1.16, breaking nether gold ores should get gold nuggets + return new ItemStack(Material.GOLD_NUGGET, 2 + random.nextInt(4)); + case ANCIENT_DEBRIS: + return new ItemStack(Material.ANCIENT_DEBRIS); + default: + return super.forMaterial(material, random); + } + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary17.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary17.java new file mode 100644 index 0000000000..b637d3c2bf --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary17.java @@ -0,0 +1,52 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.miner; + +import java.util.Random; + +import javax.annotation.ParametersAreNonnullByDefault; + +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; + +/** + * Our {@link OreDictionary} implementation for MC 1.17 or higher. + * + * @author TheBusyBiscuit + * + */ +class OreDictionary17 extends OreDictionary16 { + + @Override + @ParametersAreNonnullByDefault + public ItemStack forMaterial(Material material, Random random) { + // In 1.17, breaking metal ores should get raw metals. Also support deepslate ores. + switch (material) { + case COAL_ORE: + case DEEPSLATE_COAL_ORE: + return new ItemStack(Material.COAL); + case DIAMOND_ORE: + case DEEPSLATE_DIAMOND_ORE: + return new ItemStack(Material.DIAMOND); + case EMERALD_ORE: + case DEEPSLATE_EMERALD_ORE: + return new ItemStack(Material.EMERALD); + case REDSTONE_ORE: + case DEEPSLATE_REDSTONE_ORE: + return new ItemStack(Material.REDSTONE, 4 + random.nextInt(2)); + case LAPIS_ORE: + case DEEPSLATE_LAPIS_ORE: + return new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4)); + case COPPER_ORE: + case DEEPSLATE_COPPER_ORE: + return new ItemStack(Material.RAW_COPPER); + case IRON_ORE: + case DEEPSLATE_IRON_ORE: + return new ItemStack(Material.RAW_IRON); + case GOLD_ORE: + case DEEPSLATE_GOLD_ORE: + return new ItemStack(Material.RAW_GOLD); + default: + return super.forMaterial(material, random); + } + } + +} From 1f3d0f5c20bf0220457c80475ad5cf62c4b91e01 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Tue, 30 Nov 2021 22:11:46 +0100 Subject: [PATCH 13/13] Fixed #3336 (untested) --- CHANGELOG.md | 13 +++++- .../multiblocks/miner/IndustrialMiner.java | 13 +----- .../items/multiblocks/miner/MiningTask.java | 43 ++++++++++--------- .../multiblocks/miner/OreDictionary.java | 17 +++++++- .../multiblocks/miner/OreDictionary14.java | 2 +- .../multiblocks/miner/OreDictionary16.java | 4 +- .../multiblocks/miner/OreDictionary17.java | 4 +- .../slimefun4/utils/SlimefunUtils.java | 4 +- .../slimefun4/utils/WorldUtils.java | 7 ++- 9 files changed, 67 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9486d35180..937eda2a1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Table of contents -- [Release Candidate 29 (07 Nov 2021)](#release-candidate-29-06-nov-2021) +- [Release Candidate 30 (TBD)](#release-candidate-30-tbd) +- [Release Candidate 29 (07 Nov 2021)](#release-candidate-29-07-nov-2021) - [Release Candidate 28 (06 Sep 2021)](#release-candidate-28-06-sep-2021) - [Release Candidate 27 (03 Sep 2021)](#release-candidate-27-03-sep-2021) - [Release Candidate 26 (20 Jul 2021)](#release-candidate-26-20-jul-2021) @@ -29,6 +30,16 @@ - [Release Candidate 2 (29 Sep 2019)](#release-candidate-2-29-sep-2019) - [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019) +## Release Candidate 30 (TBD) + +#### Additions + +#### Changes + +#### Fixes +* Crimson and Warped Pressure Plates are now properly recognized as pressure plates +* Fixed #3336 + ## Release Candidate 29 (07 Nov 2021) #### Additions diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java index b9ace2cd64..ec7d6cbac2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java @@ -67,16 +67,7 @@ public IndustrialMiner(ItemGroup itemGroup, SlimefunItemStack item, Material bas }, BlockFace.UP); // @formatter:on - MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion(); - - if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { - this.oreDictionary = new OreDictionary17(); - } else if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { - this.oreDictionary = new OreDictionary16(); - } else { - this.oreDictionary = new OreDictionary14(); - } - + this.oreDictionary = OreDictionary.forVersion(Slimefun.getMinecraftVersion()); this.range = range; this.silkTouch = silkTouch; @@ -141,7 +132,7 @@ protected void registerDefaultFuelTypes() { return new ItemStack(material); } else { Random random = ThreadLocalRandom.current(); - return oreDictionary.forMaterial(material, random); + return oreDictionary.getDrops(material, random); } } 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 f82d171916..60a15a4b7f 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 @@ -56,7 +56,7 @@ class MiningTask implements Runnable { private final int height; private boolean running = false; - private int fuel = 0; + private int fuelLevel = 0; private int ores = 0; private int x; @@ -120,14 +120,6 @@ void stop(@Nonnull MinerStoppingReason reason) { * This method starts the warm-up animation for the {@link IndustrialMiner}. */ private void warmUp() { - fuel = consumeFuel(); - - if (fuel <= 0) { - // This Miner has not enough fuel. - stop(MinerStoppingReason.NO_FUEL); - return; - } - /* * This is our warm up animation. * The pistons will push after another in decreasing intervals @@ -140,6 +132,21 @@ private void warmUp() { queue.thenRun(8, () -> setPistonState(pistons[1], true)); queue.thenRun(10, () -> setPistonState(pistons[1], false)); + /* + * Fixes #3336 + * Trigger each piston once, so that the structure is validated. + * Then consume fuel. + */ + queue.thenRun(() -> { + consumeFuel(); + + if (fuelLevel <= 0) { + // This Miner has not enough fuel. + stop(MinerStoppingReason.NO_FUEL); + return; + } + }); + queue.thenRun(6, () -> setPistonState(pistons[0], true)); queue.thenRun(9, () -> setPistonState(pistons[0], false)); @@ -196,7 +203,7 @@ public void run() { furnace.getWorld().playSound(furnace.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 0.2F, 1F); b.setType(Material.AIR); - fuel--; + fuelLevel--; ores++; // Repeat the same column when we hit an ore. @@ -251,13 +258,13 @@ private void nextColumn() { * @return Whether the operation was successful */ private boolean push(@Nonnull ItemStack item) { - if (fuel < 1) { + if (fuelLevel < 1) { // Restock fuel - fuel = consumeFuel(); + consumeFuel(); } // Check if there is enough fuel to run - if (fuel > 0) { + if (fuelLevel > 0) { if (chest.getType() == Material.CHEST) { BlockState state = PaperLib.getBlockState(chest, false).getState(); @@ -287,23 +294,19 @@ private boolean push(@Nonnull ItemStack item) { /** * This consumes fuel from the given {@link Chest}. - * - * @return The gained fuel value */ - private int consumeFuel() { + private void consumeFuel() { if (chest.getType() == Material.CHEST) { BlockState state = PaperLib.getBlockState(chest, false).getState(); if (state instanceof Chest) { Inventory inv = ((Chest) state).getBlockInventory(); - return consumeFuel(inv); + this.fuelLevel = grabFuelFrom(inv); } } - - return 0; } - private int consumeFuel(@Nonnull Inventory inv) { + private int grabFuelFrom(@Nonnull Inventory inv) { for (int i = 0; i < inv.getSize(); i++) { for (MachineFuel fuelType : miner.fuelTypes) { ItemStack item = inv.getContents()[i]; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary.java index 46e7438646..39b6b3477d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary.java @@ -8,6 +8,8 @@ import org.bukkit.Material; import org.bukkit.inventory.ItemStack; +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; + /** * Simple interface to map ore blocks to their respective item(s). * @@ -18,5 +20,18 @@ interface OreDictionary { @Nonnull @ParametersAreNonnullByDefault - ItemStack forMaterial(Material material, Random random); + ItemStack getDrops(Material material, Random random); + + static @Nonnull OreDictionary forVersion(@Nonnull MinecraftVersion version) { + if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { + // MC 1.17 - 1.18 + return new OreDictionary17(); + } else if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { + // MC 1.16 + return new OreDictionary16(); + } else { + // MC 1.14 - 1.15 + return new OreDictionary14(); + } + } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary14.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary14.java index 9000783881..54971fcf8f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary14.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary14.java @@ -18,7 +18,7 @@ class OreDictionary14 implements OreDictionary { @Override @ParametersAreNonnullByDefault - public @Nonnull ItemStack forMaterial(Material material, Random random) { + public @Nonnull ItemStack getDrops(Material material, Random random) { switch (material) { case COAL_ORE: return new ItemStack(Material.COAL); 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 43ec84778a..242c88ee92 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 @@ -18,7 +18,7 @@ class OreDictionary16 extends OreDictionary14 { @Override @ParametersAreNonnullByDefault - public @Nonnull ItemStack forMaterial(Material material, Random random) { + public @Nonnull ItemStack getDrops(Material material, Random random) { switch (material) { case NETHER_GOLD_ORE: // In 1.16, breaking nether gold ores should get gold nuggets @@ -26,7 +26,7 @@ class OreDictionary16 extends OreDictionary14 { case ANCIENT_DEBRIS: return new ItemStack(Material.ANCIENT_DEBRIS); default: - return super.forMaterial(material, random); + return super.getDrops(material, random); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary17.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary17.java index b637d3c2bf..ae1c140eb5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary17.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/OreDictionary17.java @@ -17,7 +17,7 @@ class OreDictionary17 extends OreDictionary16 { @Override @ParametersAreNonnullByDefault - public ItemStack forMaterial(Material material, Random random) { + public ItemStack getDrops(Material material, Random random) { // In 1.17, breaking metal ores should get raw metals. Also support deepslate ores. switch (material) { case COAL_ORE: @@ -45,7 +45,7 @@ public ItemStack forMaterial(Material material, Random random) { case DEEPSLATE_GOLD_ORE: return new ItemStack(Material.RAW_GOLD); default: - return super.forMaterial(material, random); + return super.getDrops(material, random); } } 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 409c61baf2..94de18c642 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java @@ -504,11 +504,13 @@ public static boolean canPlayerUseItem(@Nonnull Player p, @Nullable ItemStack it } /** - * Helper method to check if an Inventory is empty (has no items in "storage"). If the MC version is 1.16 or above + * 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) { 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 5bed8d729e..094600bd47 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/WorldUtils.java @@ -30,6 +30,11 @@ private WorldUtils() {} public static int getMinHeight(@Nonnull World world) { Validate.notNull(world, "World cannot be null!"); - return Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16) ? world.getMinHeight() : 0; + if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { + return world.getMinHeight(); + } else { + // Default to zero for pre-1.16 worlds + return 0; + } } }