From c639d372cde94a37469f6f01e5c690be5f1d8ed1 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 24 Nov 2021 13:30:55 +0100 Subject: [PATCH] More more more more more more more more more more more more work --- ...implement-PlayerRecipeBookClickEvent.patch | 0 .../api/Expose-Arrow-getItemStack.patch | 0 ...Holder-method-without-block-snapshot.patch | 0 ...rioritise-own-classes-where-possible.patch | 0 ...-a-useful-PluginClassLoader-toString.patch | 0 ...implement-PlayerRecipeBookClickEvent.patch | 0 .../Add-permission-for-command-blocks.patch | 2 +- .../Don-t-allow-null-UUID-s-for-chat.patch | 0 ...sure-Entity-AABB-s-are-never-invalid.patch | 6 +-- .../server/Expose-Arrow-getItemStack.patch | 0 ...er-runTaskTimerAsynchronously-Plugin.patch | 0 ...ld-Difficulty-Remembering-Difficulty.patch | 2 +- ...ssing-chunks-due-to-integer-overflow.patch | 0 ...ston-physics-inconsistency-MC-188840.patch | 0 .../server/Fix-sand-duping.patch | 2 +- .../Hide-sync-chunk-writes-behind-flag.patch | 4 +- ...-Legacy-Component-serialization-size.patch | 0 ...Holder-method-without-block-snapshot.patch | 0 .../server/Paper-dumpitem-command.patch | 0 ...-desync-in-playerconnection-causing-.patch | 0 ...WorldBorder-collision-checks-and-air.patch | 50 ------------------- todo.txt | 1 + 22 files changed, 9 insertions(+), 58 deletions(-) rename patches/{unapplied => }/api/Add-and-implement-PlayerRecipeBookClickEvent.patch (100%) rename patches/{unapplied => }/api/Expose-Arrow-getItemStack.patch (100%) rename patches/{unapplied => }/api/Inventory-getHolder-method-without-block-snapshot.patch (100%) rename patches/{unapplied => }/api/Prioritise-own-classes-where-possible.patch (100%) rename patches/{unapplied => }/api/Provide-a-useful-PluginClassLoader-toString.patch (100%) rename patches/{unapplied => }/server/Add-and-implement-PlayerRecipeBookClickEvent.patch (100%) rename patches/{unapplied => }/server/Add-permission-for-command-blocks.patch (98%) rename patches/{unapplied => }/server/Don-t-allow-null-UUID-s-for-chat.patch (100%) rename patches/{unapplied => }/server/Ensure-Entity-AABB-s-are-never-invalid.patch (95%) rename patches/{unapplied => }/server/Expose-Arrow-getItemStack.patch (100%) rename patches/{unapplied => }/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch (100%) rename patches/{unapplied => }/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch (99%) rename patches/{unapplied => }/server/Fix-missing-chunks-due-to-integer-overflow.patch (100%) rename patches/{unapplied => }/server/Fix-piston-physics-inconsistency-MC-188840.patch (100%) rename patches/{unapplied => }/server/Fix-sand-duping.patch (95%) rename patches/{unapplied => }/server/Hide-sync-chunk-writes-behind-flag.patch (89%) rename patches/{unapplied => }/server/Improve-Legacy-Component-serialization-size.patch (100%) rename patches/{unapplied => }/server/Inventory-getHolder-method-without-block-snapshot.patch (100%) rename patches/{unapplied => }/server/Paper-dumpitem-command.patch (100%) rename patches/{unapplied => }/server/Prevent-position-desync-in-playerconnection-causing-.patch (100%) delete mode 100644 patches/unapplied/server/Optimize-WorldBorder-collision-checks-and-air.patch diff --git a/patches/unapplied/api/Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/api/Add-and-implement-PlayerRecipeBookClickEvent.patch similarity index 100% rename from patches/unapplied/api/Add-and-implement-PlayerRecipeBookClickEvent.patch rename to patches/api/Add-and-implement-PlayerRecipeBookClickEvent.patch diff --git a/patches/unapplied/api/Expose-Arrow-getItemStack.patch b/patches/api/Expose-Arrow-getItemStack.patch similarity index 100% rename from patches/unapplied/api/Expose-Arrow-getItemStack.patch rename to patches/api/Expose-Arrow-getItemStack.patch diff --git a/patches/unapplied/api/Inventory-getHolder-method-without-block-snapshot.patch b/patches/api/Inventory-getHolder-method-without-block-snapshot.patch similarity index 100% rename from patches/unapplied/api/Inventory-getHolder-method-without-block-snapshot.patch rename to patches/api/Inventory-getHolder-method-without-block-snapshot.patch diff --git a/patches/unapplied/api/Prioritise-own-classes-where-possible.patch b/patches/api/Prioritise-own-classes-where-possible.patch similarity index 100% rename from patches/unapplied/api/Prioritise-own-classes-where-possible.patch rename to patches/api/Prioritise-own-classes-where-possible.patch diff --git a/patches/unapplied/api/Provide-a-useful-PluginClassLoader-toString.patch b/patches/api/Provide-a-useful-PluginClassLoader-toString.patch similarity index 100% rename from patches/unapplied/api/Provide-a-useful-PluginClassLoader-toString.patch rename to patches/api/Provide-a-useful-PluginClassLoader-toString.patch diff --git a/patches/unapplied/server/Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/server/Add-and-implement-PlayerRecipeBookClickEvent.patch similarity index 100% rename from patches/unapplied/server/Add-and-implement-PlayerRecipeBookClickEvent.patch rename to patches/server/Add-and-implement-PlayerRecipeBookClickEvent.patch diff --git a/patches/unapplied/server/Add-permission-for-command-blocks.patch b/patches/server/Add-permission-for-command-blocks.patch similarity index 98% rename from patches/unapplied/server/Add-permission-for-command-blocks.patch rename to patches/server/Add-permission-for-command-blocks.patch index 9e4eb1a6bf..9e0cafaa90 100644 --- a/patches/unapplied/server/Add-permission-for-command-blocks.patch +++ b/patches/server/Add-permission-for-command-blocks.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (block instanceof GameMasterBlock && !this.player.canUseGameMasterBlocks() && !(block instanceof net.minecraft.world.level.block.CommandBlock && (this.player.isCreative() && this.player.getBukkitEntity().hasPermission("minecraft.commandblock")))) { // Paper - command block permission this.level.sendBlockUpdated(pos, iblockdata, iblockdata, 3); return false; - } else if (this.player.blockActionRestricted((Level) this.level, pos, this.gameModeForPlayer)) { + } else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/patches/unapplied/server/Don-t-allow-null-UUID-s-for-chat.patch b/patches/server/Don-t-allow-null-UUID-s-for-chat.patch similarity index 100% rename from patches/unapplied/server/Don-t-allow-null-UUID-s-for-chat.patch rename to patches/server/Don-t-allow-null-UUID-s-for-chat.patch diff --git a/patches/unapplied/server/Ensure-Entity-AABB-s-are-never-invalid.patch b/patches/server/Ensure-Entity-AABB-s-are-never-invalid.patch similarity index 95% rename from patches/unapplied/server/Ensure-Entity-AABB-s-are-never-invalid.patch rename to patches/server/Ensure-Entity-AABB-s-are-never-invalid.patch index 3607da3d2d..c04ba05b86 100644 --- a/patches/unapplied/server/Ensure-Entity-AABB-s-are-never-invalid.patch +++ b/patches/server/Ensure-Entity-AABB-s-are-never-invalid.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } public void setPos(double x, double y, double z) { @@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } protected AABB makeBoundingBox() { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } public final void setPosRaw(double x, double y, double z) { @@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.position.x != x || this.position.y != y || this.position.z != z) { this.position = new Vec3(x, y, z); int i = Mth.floor(x); -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } } diff --git a/patches/unapplied/server/Expose-Arrow-getItemStack.patch b/patches/server/Expose-Arrow-getItemStack.patch similarity index 100% rename from patches/unapplied/server/Expose-Arrow-getItemStack.patch rename to patches/server/Expose-Arrow-getItemStack.patch diff --git a/patches/unapplied/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch b/patches/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch rename to patches/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch diff --git a/patches/unapplied/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch similarity index 99% rename from patches/unapplied/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch rename to patches/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 808e4dee06..d2d55adf81 100644 --- a/patches/unapplied/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0L) { @@ -0,0 +0,0 @@ public class FallingBlockEntity extends Entity { this.move(MoverType.SELF, this.getDeltaMovement()); diff --git a/patches/unapplied/server/Hide-sync-chunk-writes-behind-flag.patch b/patches/server/Hide-sync-chunk-writes-behind-flag.patch similarity index 89% rename from patches/unapplied/server/Hide-sync-chunk-writes-behind-flag.patch rename to patches/server/Hide-sync-chunk-writes-behind-flag.patch index b828a45af7..29f37fe4b3 100644 --- a/patches/unapplied/server/Hide-sync-chunk-writes-behind-flag.patch +++ b/patches/server/Hide-sync-chunk-writes-behind-flag.patch @@ -14,10 +14,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java @@ -0,0 +0,0 @@ public class DedicatedServerProperties extends Settings { - return Mth.clamp(integer, 1, 29999984); + return Mth.clamp(integer, (int) 1, 29999984); }, 29999984); - this.syncChunkWrites = this.get("sync-chunk-writes", true); + this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false); this.enableStatus = this.get("enable-status", true); - this.entityBroadcastRangePercentage = this.get("entity-broadcast-range-percentage", (integer) -> { + this.hideOnlinePlayers = this.get("hide-online-players", false); diff --git a/patches/unapplied/server/Improve-Legacy-Component-serialization-size.patch b/patches/server/Improve-Legacy-Component-serialization-size.patch similarity index 100% rename from patches/unapplied/server/Improve-Legacy-Component-serialization-size.patch rename to patches/server/Improve-Legacy-Component-serialization-size.patch diff --git a/patches/unapplied/server/Inventory-getHolder-method-without-block-snapshot.patch b/patches/server/Inventory-getHolder-method-without-block-snapshot.patch similarity index 100% rename from patches/unapplied/server/Inventory-getHolder-method-without-block-snapshot.patch rename to patches/server/Inventory-getHolder-method-without-block-snapshot.patch diff --git a/patches/unapplied/server/Paper-dumpitem-command.patch b/patches/server/Paper-dumpitem-command.patch similarity index 100% rename from patches/unapplied/server/Paper-dumpitem-command.patch rename to patches/server/Paper-dumpitem-command.patch diff --git a/patches/unapplied/server/Prevent-position-desync-in-playerconnection-causing-.patch b/patches/server/Prevent-position-desync-in-playerconnection-causing-.patch similarity index 100% rename from patches/unapplied/server/Prevent-position-desync-in-playerconnection-causing-.patch rename to patches/server/Prevent-position-desync-in-playerconnection-causing-.patch diff --git a/patches/unapplied/server/Optimize-WorldBorder-collision-checks-and-air.patch b/patches/unapplied/server/Optimize-WorldBorder-collision-checks-and-air.patch deleted file mode 100644 index e6b6259ce7..0000000000 --- a/patches/unapplied/server/Optimize-WorldBorder-collision-checks-and-air.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Spottedleaf -Date: Sun, 10 May 2020 22:49:05 -0400 -Subject: [PATCH] Optimize WorldBorder collision checks and air - - -diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/Entity.java -+++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n - AABB axisalignedbb = this.getBoundingBox(); - CollisionContext voxelshapecollision = CollisionContext.of(this); - VoxelShape voxelshape = this.level.getWorldBorder().getCollisionShape(); -- Stream stream = Shapes.joinIsNotEmpty(voxelshape, Shapes.create(axisalignedbb.deflate(1.0E-7D)), BooleanOp.AND) ? Stream.empty() : Stream.of(voxelshape); -+ Stream stream = !this.level.getWorldBorder().isWithinBounds(axisalignedbb) ? Stream.empty() : Stream.of(voxelshape); // Paper - Stream stream1 = this.level.getEntityCollisions(this, axisalignedbb.expandTowards(movement), (entity) -> { - return true; - }); -diff --git a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java -+++ b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java -@@ -0,0 +0,0 @@ public class CollisionSpliterator extends AbstractSpliterator { - WorldBorder worldBorder = this.collisionGetter.getWorldBorder(); - AABB aABB = this.source.getBoundingBox(); - if (!isBoxFullyWithinWorldBorder(worldBorder, aABB)) { -- VoxelShape voxelShape = worldBorder.getCollisionShape(); -- if (!isOutsideBorder(voxelShape, aABB) && isCloseToBorder(voxelShape, aABB)) { -- action.accept(voxelShape); -+ // Paper start -+ if (worldBorder.isWithinBounds(aABB.deflate(1.0E-7D)) && !worldBorder.isWithinBounds(aABB.inflate(1.0E-7D))) { -+ action.accept(worldBorder.getCollisionShape()); -+ // Paper end - return true; - } - } -diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java -+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java -@@ -0,0 +0,0 @@ public final class Shapes { - mutableBlockPos.set(axisCycle, q, r, p); - BlockState blockState = world.getTypeIfLoaded(mutableBlockPos); // Paper - if (blockState == null) return 0.0D; // Paper -- if ((s != 1 || blockState.hasLargeCollisionShape()) && (s != 2 || blockState.is(Blocks.MOVING_PISTON))) { -+ if (!blockState.isAir() && (s != 1 || blockState.hasLargeCollisionShape()) && (s != 2 || blockState.is(Blocks.MOVING_PISTON))) { // Paper - initial = blockState.getCollisionShape(world, mutableBlockPos, context).collide(axis3, box.move((double)(-mutableBlockPos.getX()), (double)(-mutableBlockPos.getY()), (double)(-mutableBlockPos.getZ())), initial); - if (Math.abs(initial) < 1.0E-7D) { - return 0.0D; diff --git a/todo.txt b/todo.txt index add4ec4078..fd43ae8e68 100644 --- a/todo.txt +++ b/todo.txt @@ -5,3 +5,4 @@ Make sure fluids aren't completly fucked, there may be more sync loads to nuke t Improve Server Thread Pool and Thread Priorities: mojang added a max thread count property Use Vanilla Minecart Speeds: is this needed? Handle Oversized Tile Entities: make sure impl is correct +0467-Optimize-WorldBorder-collision-checks-and-air check first hunk that has been removed