From 16e2fd38b69d66a97f377d8e9291b6b310dbc296 Mon Sep 17 00:00:00 2001 From: ishland Date: Tue, 16 Feb 2021 01:17:57 +0800 Subject: [PATCH 1/2] Drop MyPet fix (#396) --- PATCHES.md | 1 - ...ollerLookWASD-and-ControllerMoveWASD.patch | 42 ------------------- 2 files changed, 43 deletions(-) delete mode 100644 patches/server/0065-Fix-NPE-in-ControllerLookWASD-and-ControllerMoveWASD.patch diff --git a/PATCHES.md b/PATCHES.md index b5aafb193..562990af9 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -173,7 +173,6 @@ This is an overview over all patches that are currently used. | 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 NPE in ControllerLookWASD and ControllerMoveWASD | ishland | | | server | Fix PlayerEditBookEvent not saving new book | BillyGalbreath | | | server | Fix cow rotation when shearing mooshroom | William Blake Galbreath | | | server | Fix death message colors | William Blake Galbreath | | diff --git a/patches/server/0065-Fix-NPE-in-ControllerLookWASD-and-ControllerMoveWASD.patch b/patches/server/0065-Fix-NPE-in-ControllerLookWASD-and-ControllerMoveWASD.patch deleted file mode 100644 index 4a9571c53..000000000 --- a/patches/server/0065-Fix-NPE-in-ControllerLookWASD-and-ControllerMoveWASD.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: ishland -Date: Mon, 1 Feb 2021 20:16:36 +0800 -Subject: [PATCH] Fix NPE in ControllerLookWASD and ControllerMoveWASD - - -diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java b/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java -index 0b16a7b6345ff42ea0f42ca79155a50e2fe4926b..13f54cdda27fb92dcb72f386cefdee457dc86076 100644 ---- a/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java -+++ b/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java -@@ -19,8 +19,11 @@ public class ControllerLookWASD extends ControllerLook { - // tick - @Override - public void a() { -- if (entity.hasRider()) { -- tick(entity.getRider()); -+ // Yatopia start - better null check - fix NPE with some plugins -+ final EntityHuman rider = entity.getRider(); -+ if (rider != null) { -+ tick(rider); -+ // Yatopia end - } else { - tick(); - } -diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java -index 426688b3a6dc197b41ddc4d1efed0405614f0f3b..66d87e39f42cac1b3e3142ea1ebfee60788d5251 100644 ---- a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java -+++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java -@@ -30,8 +30,11 @@ public class ControllerMoveWASD extends ControllerMove { - // tick - @Override - public void a() { -- if (entity.hasRider()) { -- tick(entity.getRider()); -+ // Yatopia start - better null check - fix NPE with some plugins -+ final EntityHuman rider = entity.getRider(); -+ if (rider != null) { -+ tick(rider); -+ // Yatopia end - } else { - tick(); - } From dede8ef2f5bab6e43a09979d248e8da6873e4f47 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 15 Feb 2021 14:09:05 -0500 Subject: [PATCH 2/2] Updated Upstream and Sidestream(s) (Airplane) (#407) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 8703980 Modify mutable block position --- .../0016-Reduce-memory-allocations.patch | 23 +++++++++++++++++-- ...ghly-optimize-VillagePlace-filtering.patch | 2 +- .../0030-Nuke-streams-off-BlockPosition.patch | 2 +- upstream/Airplane | 2 +- upstreamCommits/Airplane | 2 +- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/patches/Airplane/patches/server/0016-Reduce-memory-allocations.patch b/patches/Airplane/patches/server/0016-Reduce-memory-allocations.patch index 9316759da..c43e4581f 100644 --- a/patches/Airplane/patches/server/0016-Reduce-memory-allocations.patch +++ b/patches/Airplane/patches/server/0016-Reduce-memory-allocations.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Reduce memory allocations diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java -index 7b29d47dfdef7611db58068af285f76d92a9f12a..7009586430649a87722f6c73cd5a311d7c977196 100644 +index 7b29d47dfdef7611db58068af285f76d92a9f12a..6c5d96853d47850b81ce85e56a516c554819ef25 100644 --- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java @@ -43,8 +43,14 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow { @@ -15,7 +15,7 @@ index 7b29d47dfdef7611db58068af285f76d92a9f12a..7009586430649a87722f6c73cd5a311d + // Airplane start - use mutable position + BlockPosition.MutableBlockPosition blockposition1 = new BlockPosition.MutableBlockPosition(); for (int i = 0; i < 4; ++i) { -+ blockposition1.setValues(blockposition).add(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); ++ blockposition1.setValues(blockposition).addValues(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); + /* BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); + */ @@ -23,6 +23,25 @@ index 7b29d47dfdef7611db58068af285f76d92a9f12a..7009586430649a87722f6c73cd5a311d if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) { org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).a(Blocks.SNOW))); // CraftBukkit +diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java +index bc61aaff65a7dc1e7534452b285953b83adb7000..f38382cc681f03d9a6a0efa85f045e3770398739 100644 +--- a/src/main/java/net/minecraft/server/BlockPosition.java ++++ b/src/main/java/net/minecraft/server/BlockPosition.java +@@ -438,6 +438,14 @@ public class BlockPosition extends BaseBlockPosition { + public BlockPosition b(int i, int j, int k) { + return super.b(i, j, k).immutableCopy(); + } ++ // Airplane start - version of b that doesn't copy ++ public BlockPosition addValues(int x, int y, int z) { ++ ((BaseBlockPosition)this).a += x; ++ ((BaseBlockPosition)this).b += y; ++ ((BaseBlockPosition)this).e += z; ++ return this; ++ } ++ // Airplane end + + @Override + public BlockPosition shift(EnumDirection enumdirection, int i) { diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java index 631eb682e81e30d2a937fd1eafccd8a9ab82d21e..dc07376845f84ea949a2153cb75d2cd9d46a419e 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java diff --git a/patches/server/0028-Highly-optimize-VillagePlace-filtering.patch b/patches/server/0028-Highly-optimize-VillagePlace-filtering.patch index 740fa31a6..1b15804ba 100644 --- a/patches/server/0028-Highly-optimize-VillagePlace-filtering.patch +++ b/patches/server/0028-Highly-optimize-VillagePlace-filtering.patch @@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..e647624f4c9afe8bc603792ad88c807e + } +} diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index bc61aaff65a7dc1e7534452b285953b83adb7000..7fddef0afbcf1f9f391c540b8fce1bebf8faa452 100644 +index f38382cc681f03d9a6a0efa85f045e3770398739..97b0aee82e080a1225454317cbf0191ef8b14fca 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -341,6 +341,16 @@ public class BlockPosition extends BaseBlockPosition { diff --git a/patches/server/0030-Nuke-streams-off-BlockPosition.patch b/patches/server/0030-Nuke-streams-off-BlockPosition.patch index e24c80321..9c9fce720 100644 --- a/patches/server/0030-Nuke-streams-off-BlockPosition.patch +++ b/patches/server/0030-Nuke-streams-off-BlockPosition.patch @@ -17,7 +17,7 @@ index 8724ad342bec7c733b3c825bd62dbfa5c28c06dd..9907047028b754fe0e314a7d5c5238ce return this.getBlock().a(tag); } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7fddef0afbcf1f9f391c540b8fce1bebf8faa452..f13b4e6ec815792c2f2b49193707da94df427424 100644 +index 97b0aee82e080a1225454317cbf0191ef8b14fca..c4dd89d9bae1960d25b64e2a715a83adde65719a 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -318,7 +318,15 @@ public class BlockPosition extends BaseBlockPosition { diff --git a/upstream/Airplane b/upstream/Airplane index e71967b87..8703980b4 160000 --- a/upstream/Airplane +++ b/upstream/Airplane @@ -1 +1 @@ -Subproject commit e71967b87c76de81d85dd9750719f3110669d52f +Subproject commit 8703980b48dc20f7266c77bcbdf51f376eed6204 diff --git a/upstreamCommits/Airplane b/upstreamCommits/Airplane index 206f7b9a7..ba5cd5b4e 100644 --- a/upstreamCommits/Airplane +++ b/upstreamCommits/Airplane @@ -1 +1 @@ -e71967b87c76de81d85dd9750719f3110669d52f \ No newline at end of file +8703980b48dc20f7266c77bcbdf51f376eed6204 \ No newline at end of file