From b186d78f884252ba8f18de12f2b90931bb832e97 Mon Sep 17 00:00:00 2001 From: Mgazul Date: Fri, 29 Mar 2024 12:57:29 +0800 Subject: [PATCH] Fixed #3035 --- .../net/minecraft/block/PortalSize.java.patch | 15 ++++++++------- .../java/com/mohistmc/MohistMCStart.java | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/patches/minecraft/net/minecraft/block/PortalSize.java.patch b/patches/minecraft/net/minecraft/block/PortalSize.java.patch index 0c9208eee6..ce0210c159 100644 --- a/patches/minecraft/net/minecraft/block/PortalSize.java.patch +++ b/patches/minecraft/net/minecraft/block/PortalSize.java.patch @@ -77,27 +77,28 @@ } return 21; -@@ -151,13 +_,38 @@ +@@ -151,6 +_,7 @@ return this.field_150861_f != null && this.field_150868_h >= 2 && this.field_150868_h <= 21 && this.field_150862_g >= 3 && this.field_150862_g <= 21; } -+ // Mohist start -+ private AtomicReference mohist$state = new AtomicReference<>(); + public void func_150859_c() { BlockState blockstate = Blocks.field_150427_aO.func_176223_P().func_206870_a(NetherPortalBlock.field_176550_a, this.field_150865_b); -+ mohist$state.set(blockstate); BlockPos.func_218278_a(this.field_150861_f, this.field_150861_f.func_177967_a(Direction.UP, this.field_150862_g - 1).func_177967_a(this.field_150866_c, this.field_150868_h - 1)).forEach((p_242967_2_) -> { - this.field_150867_a.func_180501_a(p_242967_2_, blockstate, 18); +@@ -158,6 +_,31 @@ }); } ++ // Mohist start + // CraftBukkit start - return boolean + public boolean createPortal() { + org.bukkit.World bworld = this.field_150867_a.getMinecraftWorld().getWorld(); + + // Copy below for loop -+ func_150859_c(); // Mohist ++ BlockState blockstate = Blocks.field_150427_aO.func_176223_P().func_206870_a(NetherPortalBlock.field_176550_a, this.field_150865_b); ++ BlockPos.func_218278_a(this.field_150861_f, this.field_150861_f.func_177967_a(Direction.UP, this.field_150862_g - 1).func_177967_a(this.field_150866_c, this.field_150868_h - 1)).forEach((p_242967_2_) -> { ++ blocks.func_180501_a(p_242967_2_, blockstate, 18); ++ }); + + PortalCreateEvent event = new PortalCreateEvent((java.util.List) (java.util.List) blocks.getList(), bworld, null, PortalCreateEvent.CreateReason.FIRE); + Bukkit.getPluginManager().callEvent(event); @@ -107,7 +108,7 @@ + } + // CraftBukkit end + BlockPos.func_218278_a(this.field_150861_f, this.field_150861_f.func_177967_a(Direction.UP, this.field_150862_g - 1).func_177967_a(this.field_150866_c, this.field_150868_h - 1)).forEach((p_242967_2_) -> { -+ this.field_150867_a.func_180501_a(p_242967_2_, mohist$state.getAndSet(null), 18); ++ this.field_150867_a.func_180501_a(p_242967_2_, blockstate, 18); + }); + return true; // CraftBukkit + // Mohist end diff --git a/src/fmllauncher/java/com/mohistmc/MohistMCStart.java b/src/fmllauncher/java/com/mohistmc/MohistMCStart.java index 36093a5ad7..c29427b075 100644 --- a/src/fmllauncher/java/com/mohistmc/MohistMCStart.java +++ b/src/fmllauncher/java/com/mohistmc/MohistMCStart.java @@ -61,7 +61,7 @@ public static void main() throws Exception { " \\ \\_\\ \\ \\_\\\\ \\_____\\\\ \\_\\ \\_\\\\ \\_\\\\/\\_____\\ \\ \\_\\ \n" + " \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_____/ \\/_/ \n" + " \n" + "\n" + - " " + i18n.get("mohist.launch.welcomemessage") +" - "+getVersion()+", Java "+ServerMain.javaVersion); + i18n.get("mohist.launch.welcomemessage") +" - "+getVersion()+", Java "+ServerMain.javaVersion); //Alert the user that Java 11 is still recommended to use to have a better compatibility. if(ServerMain.javaVersion <= 52.0) {