From 2b17f5cc156e59595f29edcf0c5716143c51e0f8 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <jake.m.potrebic@gmail.com> Date: Tue, 23 Nov 2021 16:44:41 -0800 Subject: [PATCH] and some more patches --- build-data/paper.at | 1 + ...-replace-OfflinePlayer-getLastPlayed.patch | 0 .../api/Add-PlayerConnectionCloseEvent.patch | 0 .../api/Add-more-Zombie-API.patch | 0 ...eserved-channel-check-to-be-sensible.patch | 0 ...tion-supression-of-EntityDismount-Ve.patch | 0 ...-replace-OfflinePlayer-getLastPlayed.patch | 0 .../Add-PlayerConnectionCloseEvent.patch | 15 +----- .../server/Add-more-Zombie-API.patch | 0 ...-remove-from-being-called-on-Players.patch | 2 +- .../server/Book-Size-Limits.patch | 0 ...onRetractEvent-for-all-empty-pistons.patch | 0 ...Prevent-Enderman-from-loading-chunks.patch | 0 ...vehicle-tracking-issue-on-disconnect.patch | 0 ...entity-dismount-during-teleportation.patch | 46 +++++++++---------- 15 files changed, 26 insertions(+), 38 deletions(-) rename patches/{unapplied => }/api/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch (100%) rename patches/{unapplied => }/api/Add-PlayerConnectionCloseEvent.patch (100%) rename patches/{unapplied => }/api/Add-more-Zombie-API.patch (100%) rename patches/{unapplied => }/api/Change-the-reserved-channel-check-to-be-sensible.patch (100%) rename patches/{unapplied => }/api/Support-cancellation-supression-of-EntityDismount-Ve.patch (100%) rename patches/{unapplied => }/server/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch (100%) rename patches/{unapplied => }/server/Add-PlayerConnectionCloseEvent.patch (78%) rename patches/{unapplied => }/server/Add-more-Zombie-API.patch (100%) rename patches/{unapplied => }/server/Block-Entity-remove-from-being-called-on-Players.patch (96%) rename patches/{unapplied => }/server/Book-Size-Limits.patch (100%) rename patches/{unapplied => }/server/Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch (100%) rename patches/{unapplied => }/server/Prevent-Enderman-from-loading-chunks.patch (100%) rename patches/{unapplied => }/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch (100%) rename patches/{unapplied => }/server/force-entity-dismount-during-teleportation.patch (87%) diff --git a/build-data/paper.at b/build-data/paper.at index 777d1ed2a2..dba668950c 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -95,6 +95,7 @@ public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z # Add PlayerConnectionCloseEvent public net.minecraft.server.network.ServerLoginPacketListenerImpl$State public net.minecraft.server.network.ServerLoginPacketListenerImpl state +public net.minecraft.server.network.ServerLoginPacketListenerImpl gameProfile # Entity Activation Range 2.0 public net.minecraft.world.entity.Entity isInsidePortal diff --git a/patches/unapplied/api/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/api/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch similarity index 100% rename from patches/unapplied/api/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch rename to patches/api/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch diff --git a/patches/unapplied/api/Add-PlayerConnectionCloseEvent.patch b/patches/api/Add-PlayerConnectionCloseEvent.patch similarity index 100% rename from patches/unapplied/api/Add-PlayerConnectionCloseEvent.patch rename to patches/api/Add-PlayerConnectionCloseEvent.patch diff --git a/patches/unapplied/api/Add-more-Zombie-API.patch b/patches/api/Add-more-Zombie-API.patch similarity index 100% rename from patches/unapplied/api/Add-more-Zombie-API.patch rename to patches/api/Add-more-Zombie-API.patch diff --git a/patches/unapplied/api/Change-the-reserved-channel-check-to-be-sensible.patch b/patches/api/Change-the-reserved-channel-check-to-be-sensible.patch similarity index 100% rename from patches/unapplied/api/Change-the-reserved-channel-check-to-be-sensible.patch rename to patches/api/Change-the-reserved-channel-check-to-be-sensible.patch diff --git a/patches/unapplied/api/Support-cancellation-supression-of-EntityDismount-Ve.patch b/patches/api/Support-cancellation-supression-of-EntityDismount-Ve.patch similarity index 100% rename from patches/unapplied/api/Support-cancellation-supression-of-EntityDismount-Ve.patch rename to patches/api/Support-cancellation-supression-of-EntityDismount-Ve.patch diff --git a/patches/unapplied/server/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/server/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch similarity index 100% rename from patches/unapplied/server/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch rename to patches/server/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch diff --git a/patches/unapplied/server/Add-PlayerConnectionCloseEvent.patch b/patches/server/Add-PlayerConnectionCloseEvent.patch similarity index 78% rename from patches/unapplied/server/Add-PlayerConnectionCloseEvent.patch rename to patches/server/Add-PlayerConnectionCloseEvent.patch index 3de17ccbe6..fa8fb8361a 100644 --- a/patches/unapplied/server/Add-PlayerConnectionCloseEvent.patch +++ b/patches/server/Add-PlayerConnectionCloseEvent.patch @@ -55,7 +55,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + case READY_TO_ACCEPT: + case DELAY_ACCEPT: + case ACCEPTED: -+ final com.mojang.authlib.GameProfile profile = loginListener.getGameProfile(); /* Should be non-null at this stage */ ++ final com.mojang.authlib.GameProfile profile = loginListener.gameProfile; /* Should be non-null at this stage */ + new com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent(profile.getId(), profile.getName(), + ((java.net.InetSocketAddress)address).getAddress(), false).callEvent(); + } @@ -64,16 +64,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener - public ServerLoginPacketListenerImpl.State state; - private int tick; - @Nullable -- GameProfile gameProfile; -+ GameProfile gameProfile; @Deprecated private void setGameProfile(final GameProfile profile) { this.gameProfile = profile; } @Deprecated public GameProfile getGameProfile() { return this.gameProfile; } // Paper - OBFHELPER - private final String serverId; - @Nullable - private ServerPlayer delayedAcceptPlayer; diff --git a/patches/unapplied/server/Add-more-Zombie-API.patch b/patches/server/Add-more-Zombie-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Zombie-API.patch rename to patches/server/Add-more-Zombie-API.patch diff --git a/patches/unapplied/server/Block-Entity-remove-from-being-called-on-Players.patch b/patches/server/Block-Entity-remove-from-being-called-on-Players.patch similarity index 96% rename from patches/unapplied/server/Block-Entity-remove-from-being-called-on-Players.patch rename to patches/server/Block-Entity-remove-from-being-called-on-Players.patch index 4ba8aa64de..7d6f94bb60 100644 --- a/patches/unapplied/server/Block-Entity-remove-from-being-called-on-Players.patch +++ b/patches/server/Block-Entity-remove-from-being-called-on-Players.patch @@ -29,5 +29,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } // Paper end - // Spigot start + private final Player.Spigot spigot = new Player.Spigot() diff --git a/patches/unapplied/server/Book-Size-Limits.patch b/patches/server/Book-Size-Limits.patch similarity index 100% rename from patches/unapplied/server/Book-Size-Limits.patch rename to patches/server/Book-Size-Limits.patch diff --git a/patches/unapplied/server/Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch b/patches/server/Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch similarity index 100% rename from patches/unapplied/server/Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch rename to patches/server/Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch diff --git a/patches/unapplied/server/Prevent-Enderman-from-loading-chunks.patch b/patches/server/Prevent-Enderman-from-loading-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-Enderman-from-loading-chunks.patch rename to patches/server/Prevent-Enderman-from-loading-chunks.patch diff --git a/patches/unapplied/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/patches/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch similarity index 100% rename from patches/unapplied/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch rename to patches/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch diff --git a/patches/unapplied/server/force-entity-dismount-during-teleportation.patch b/patches/server/force-entity-dismount-during-teleportation.patch similarity index 87% rename from patches/unapplied/server/force-entity-dismount-during-teleportation.patch rename to patches/server/force-entity-dismount-during-teleportation.patch index 9416c67f2f..889d7855c3 100644 --- a/patches/unapplied/server/force-entity-dismount-during-teleportation.patch +++ b/patches/server/force-entity-dismount-during-teleportation.patch @@ -44,15 +44,15 @@ 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 removeVehicle() { -+ // Paper start -+ public void removeVehicle() { stopRiding(false); } + public void removeVehicle() { ++ // Paper start ++ stopRiding(false); ++ } + public void stopRiding(boolean suppressCancellation) { -+ // Paper end ++ // Paper end if (this.vehicle != null) { Entity entity = this.vehicle; @@ -62,7 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -@@ -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 return true; // CraftBukkit } @@ -74,7 +74,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (entity.getVehicle() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { -@@ -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 if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { VehicleExitEvent event = new VehicleExitEvent( (Vehicle) this.getBukkitEntity(), @@ -83,7 +83,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ); // Suppress during worldgen if (this.valid) { -@@ -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 } // CraftBukkit end // Spigot start @@ -97,14 +97,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { - return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 4) != 0; - } -- @Override -- public void stopRiding() { -+ // Paper start -+ @Override public void stopRiding() { stopRiding(false); } -+ @Override public void stopRiding(boolean suppressCancellation) { + @Override + public void stopRiding() { ++ // Paper start ++ stopRiding(false); ++ } ++ @Override ++ public void stopRiding(boolean suppressCancellation) { + // Paper end Entity entity = this.getVehicle(); @@ -118,15 +118,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - return -0.35D; - } -- @Override -- public void removeVehicle() { + @Override + public void removeVehicle() { - super.removeVehicle(); -+ // Paper start -+ @Override public void removeVehicle() { stopRiding(false); } -+ @Override public void stopRiding(boolean suppressCancellation) { ++ // Paper start ++ stopRiding(false); ++ } ++ @Override ++ public void stopRiding(boolean suppressCancellation) { + // Paper end + super.stopRiding(suppressCancellation); // Paper - suppress this.boardingCooldown = 0;