diff --git a/PATCHES.md b/PATCHES.md index 2578364d..b65edaac 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -53,6 +53,7 @@ # Patches | server | Fix "Unable to save chunk" error | Ivan Pekov | | | server | Fix 'outdated server' showing in ping before server fully | William Blake Galbreath | | | server | Fix Bukkit.createInventory() with type LECTERN | willies952002 | | +| server | Fix IndexOutOfBoundsException when sending too many changes | Ivan Pekov | | | server | Fix LightEngineThreaded memory leak | Ivan Pekov | | | server | Fix exp drop of zombie pigmen (MC-56653) | Phoenix616 | | | server | Fix lead fall dmg config | tr7zw | | @@ -117,6 +118,7 @@ # Patches | server | Stop squids floating on top of water | William Blake Galbreath | | | server | Stop wasting resources on JsonList#get | Ivan Pekov | | | server | Swaps the predicate order of collision | ㄗㄠˋ ㄑㄧˊ | | +| server | Tic-Tacs Threading Fix | gegy1000 | | | server | Timings stuff | William Blake Galbreath | | | server | Tulips change fox type | William Blake Galbreath | | | server | Use block distance in portal search radius | Patrick Hemmer | | diff --git a/patches/server/0001-Yatopia-Server-Fixes.patch b/patches/server/0001-Yatopia-Server-Fixes.patch index 941d3d79..bab7e9fc 100644 --- a/patches/server/0001-Yatopia-Server-Fixes.patch +++ b/patches/server/0001-Yatopia-Server-Fixes.patch @@ -3134,7 +3134,7 @@ index 44b67715e6c1b113b4651a965e8006e9a10a05bf..00000000000000000000000000000000 - // Purpur end - } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 16fd48c617ebced744966fd1b4cd155c20774ef4..b3651d69720cd40593d0febb58380203972ca87b 100644 +index 210cb10ea75b99d3b5d7b5bce5cea44e3cc0fc20..62012d2b780d3399bd641ca3ca4a4ac127e3bcb5 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -154,6 +154,14 @@ public class Main { diff --git a/patches/server/0006-Yatopia-configuration.patch b/patches/server/0006-Yatopia-configuration.patch index 578739ba..7bbe5b30 100644 --- a/patches/server/0006-Yatopia-configuration.patch +++ b/patches/server/0006-Yatopia-configuration.patch @@ -304,7 +304,7 @@ index 4bae0e82bc25b576a23b5f05af7c3ad944a54bcf..78d7fc805a1aeb0d31e51a5aa68e92d9 public void restart() { org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index b3651d69720cd40593d0febb58380203972ca87b..e1fdb891ca612cd360983ce121b01faab3f50d68 100644 +index 62012d2b780d3399bd641ca3ca4a4ac127e3bcb5..dddba89eee0181c066ad979bc2b75e8de36e7458 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -162,6 +162,14 @@ public class Main { diff --git a/patches/server/0023-Redirect-Configs.patch b/patches/server/0023-Redirect-Configs.patch index da09fbe7..4661a760 100644 --- a/patches/server/0023-Redirect-Configs.patch +++ b/patches/server/0023-Redirect-Configs.patch @@ -58,7 +58,7 @@ index 72d7a017f2aa7f2fde3b5de437e7fd2e051edd24..6c280d64bb069fba0d52a7d8b4eb6a08 this.setPVP(dedicatedserverproperties.pvp); this.setAllowFlight(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index e1fdb891ca612cd360983ce121b01faab3f50d68..ced65104baf3a8a7d4a1aaaba0a863eaf0a5c169 100644 +index dddba89eee0181c066ad979bc2b75e8de36e7458..2b7bfeb79200458912aef6b20ee53c4c276b3451 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -303,7 +303,7 @@ public class Main { diff --git a/patches/server/0061-Fix-IndexOutOfBoundsException-when-sending-too-many-.patch b/patches/server/0061-Fix-IndexOutOfBoundsException-when-sending-too-many-.patch new file mode 100644 index 00000000..ab044302 --- /dev/null +++ b/patches/server/0061-Fix-IndexOutOfBoundsException-when-sending-too-many-.patch @@ -0,0 +1,124 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ivan Pekov +Date: Tue, 29 Sep 2020 19:25:49 +0300 +Subject: [PATCH] Fix IndexOutOfBoundsException when sending too many changes + + +diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java +index f43193c1090238f2241b878120247d1b3d0d4e57..a7783944e8e4ee2a164aa19b3cc342252bc84ee2 100644 +--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java ++++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java +@@ -182,6 +182,7 @@ public class PacketDataSerializer extends ByteBuf { + return i; + } + ++ public final long readVarLong() { return j(); } // Yatopia - OBFHELPER + public long j() { + long i = 0L; + int j = 0; +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMultiBlockChange.java b/src/main/java/net/minecraft/server/PacketPlayOutMultiBlockChange.java +index f260459d70053ffd17952aebf3e0410666f9bcd0..cae074a9a29fe5ddab74ec983a07c05d1439283d 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutMultiBlockChange.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutMultiBlockChange.java +@@ -8,8 +8,8 @@ import java.util.function.BiConsumer; + public class PacketPlayOutMultiBlockChange implements Packet { + + private SectionPosition a; +- private short[] b; +- private IBlockData[] c; ++ private java.util.List b; // Yatopia - change to list ++ private java.util.List c; // Yatopia - change to list + private boolean d; + + public PacketPlayOutMultiBlockChange() {} +@@ -17,6 +17,8 @@ public class PacketPlayOutMultiBlockChange implements Packet(); ++ c = new java.util.ArrayList<>(); ++ for (short s : shortset) { ++ b.add(s); ++ if (chunksection != null) { ++ c.add(chunksection.getType(SectionPosition.a(s), SectionPosition.b(s), SectionPosition.c(s))); ++ } else { ++ c.add(Blocks.AIR.getBlockData()); ++ } ++ } ++ // Yatopia end + + } + ++ + private void a(int i) { ++ /* // Yatopia start + this.b = new short[i]; + this.c = new IBlockData[i]; ++ */ // Yatopia end + } + + @Override +@@ -40,6 +57,8 @@ public class PacketPlayOutMultiBlockChange implements Packet>> 12)); + } ++ */ ++ b = new java.util.ArrayList<>(); ++ c = new java.util.ArrayList<>(); ++ for (int j = 0; j < i; j++) { ++ long k = packetdataserializer.readVarLong(); ++ b.add((short) ((int) (k & 4095L))); ++ c.add(Block.REGISTRY_ID.fromId((int) (k >>> 12))); ++ } ++ // Yatopia end + + } + +@@ -55,10 +83,10 @@ public class PacketPlayOutMultiBlockChange implements Packet biconsumer) { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); + +- for (int i = 0; i < this.b.length; ++i) { +- short short0 = this.b[i]; ++ for (int i = 0; i < this.b.size(); ++i) { // Yatopia ++ short short0 = this.b.get(i); // Yatopia + + blockposition_mutableblockposition.d(this.a.d(short0), this.a.e(short0), this.a.f(short0)); +- biconsumer.accept(blockposition_mutableblockposition, this.c[i]); ++ biconsumer.accept(blockposition_mutableblockposition, this.c.get(i)); // Yatopia + } + + }