and some more patches

This commit is contained in:
Jake 2021-11-23 16:44:41 -08:00 committed by MiniDigger | Martin
parent 76879ba957
commit 9ae92d26b8
15 changed files with 62 additions and 74 deletions

View File

@ -95,6 +95,7 @@ public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z
# Add PlayerConnectionCloseEvent # Add PlayerConnectionCloseEvent
public net.minecraft.server.network.ServerLoginPacketListenerImpl$State public net.minecraft.server.network.ServerLoginPacketListenerImpl$State
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 # Entity Activation Range 2.0
public net.minecraft.world.entity.Entity isInsidePortal public net.minecraft.world.entity.Entity isInsidePortal

View File

@ -20,10 +20,10 @@ this is going to be the best soultion all around.
Improvements/suggestions welcome! Improvements/suggestions welcome!
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index d32e6feca6c39a28f80574e4b080ddd4cbb60fdc..42035548577b7c60806a557dd9f9931ca9584e8c 100644 index db7f2715534ed71a2b285de095238586fe6a35b0..f51c416e7938b7905f7efb154ab14cad643962e9 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1296,11 +1296,13 @@ public class ServerPlayer extends Player { @@ -1323,11 +1323,13 @@ public class ServerPlayer extends Player {
} }
} }
@ -41,16 +41,16 @@ index d32e6feca6c39a28f80574e4b080ddd4cbb60fdc..42035548577b7c60806a557dd9f9931c
if (entity1 != entity && this.connection != null) { if (entity1 != entity && this.connection != null) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b4f2b969ad30be38c0a9e3f8efd2a57c3e0f7df0..3c7e75b8fc1bfbe08e232fcba412c83f4aba274c 100644 index 752e4593bed746e663f018f85ae1ac43cd7b0795..a1744b820a49cd4195b0e9ced960dc6bd2d58d45 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2245,12 +2245,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2279,11 +2279,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
} }
- public void removeVehicle() { public void removeVehicle() {
+ // Paper start + // Paper start
+ public void removeVehicle() { stopRiding(false); } + stopRiding(false);
+ }
+ public void stopRiding(boolean suppressCancellation) { + public void stopRiding(boolean suppressCancellation) {
+ // Paper end + // Paper end
if (this.vehicle != null) { if (this.vehicle != null) {
@ -62,7 +62,7 @@ index b4f2b969ad30be38c0a9e3f8efd2a57c3e0f7df0..3c7e75b8fc1bfbe08e232fcba412c83f
} }
} }
@@ -2313,7 +2316,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2346,7 +2351,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
return true; // CraftBukkit return true; // CraftBukkit
} }
@ -74,7 +74,7 @@ index b4f2b969ad30be38c0a9e3f8efd2a57c3e0f7df0..3c7e75b8fc1bfbe08e232fcba412c83f
if (entity.getVehicle() == this) { if (entity.getVehicle() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else { } else {
@@ -2323,7 +2329,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2356,7 +2364,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
VehicleExitEvent event = new VehicleExitEvent( VehicleExitEvent event = new VehicleExitEvent(
(Vehicle) this.getBukkitEntity(), (Vehicle) this.getBukkitEntity(),
@ -83,7 +83,7 @@ index b4f2b969ad30be38c0a9e3f8efd2a57c3e0f7df0..3c7e75b8fc1bfbe08e232fcba412c83f
); );
// Suppress during worldgen // Suppress during worldgen
if (this.valid) { if (this.valid) {
@@ -2337,7 +2343,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2370,7 +2378,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
} }
// CraftBukkit end // CraftBukkit end
// Spigot start // Spigot start
@ -93,18 +93,18 @@ index b4f2b969ad30be38c0a9e3f8efd2a57c3e0f7df0..3c7e75b8fc1bfbe08e232fcba412c83f
if (this.valid) { if (this.valid) {
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index a7aa62e52105b7adb7725f7abeae376df8f7bb3e..472b8db386dfb580734999900562d358e5ea146a 100644 index 5d47b536e89f192b10aa1434cd9cdccc49cd3eec..00900427e88f8e9118df4fb2e0e98c26b9f1b7d4 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3335,11 +3335,13 @@ public abstract class LivingEntity extends Entity { @@ -3336,9 +3336,15 @@ public abstract class LivingEntity extends Entity {
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 4) != 0;
}
- @Override @Override
- public void stopRiding() { public void stopRiding() {
+ // Paper start + // Paper start
+ @Override public void stopRiding() { stopRiding(false); } + stopRiding(false);
+ @Override public void stopRiding(boolean suppressCancellation) { + }
+ @Override
+ public void stopRiding(boolean suppressCancellation) {
+ // Paper end + // Paper end
Entity entity = this.getVehicle(); Entity entity = this.getVehicle();
@ -114,19 +114,19 @@ index a7aa62e52105b7adb7725f7abeae376df8f7bb3e..472b8db386dfb580734999900562d358
this.dismountVehicle(entity); this.dismountVehicle(entity);
} }
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index f5bc151aae4f8335994507c89a094177347dfce1..19b5538e54f1c6073c3478393c1388ffca33291e 100644 index 37b65c7a12b4dc8ff4e9017015abbb86890dbf5e..6927eeb04a9aa1a33666f3655f2bb889bf046dc9 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1094,9 +1094,11 @@ public abstract class Player extends LivingEntity { @@ -1094,7 +1094,13 @@ public abstract class Player extends LivingEntity {
return -0.35D;
}
- @Override @Override
- public void removeVehicle() { public void removeVehicle() {
- super.removeVehicle(); - super.removeVehicle();
+ // Paper start + // Paper start
+ @Override public void removeVehicle() { stopRiding(false); } + stopRiding(false);
+ @Override public void stopRiding(boolean suppressCancellation) { + }
+ @Override
+ public void stopRiding(boolean suppressCancellation) {
+ // Paper end + // Paper end
+ super.stopRiding(suppressCancellation); // Paper - suppress + super.stopRiding(suppressCancellation); // Paper - suppress
this.boardingCooldown = 0; this.boardingCooldown = 0;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add more Zombie API
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index f17a91a654d11aaace39f04b3f4c3e061a374dc9..96d172c428c6293b346201159422e2a581e350d9 100644 index 42f3f632caba1897b762a6897923585901a63bd1..8c7c621f09e8669a6874a2ce101972cb1c03f8ae 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -96,6 +96,7 @@ public class Zombie extends Monster { @@ -93,6 +93,7 @@ public class Zombie extends Monster {
private int inWaterTime; private int inWaterTime;
public int conversionTime; public int conversionTime;
private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
@ -16,7 +16,7 @@ index f17a91a654d11aaace39f04b3f4c3e061a374dc9..96d172c428c6293b346201159422e2a5
public Zombie(EntityType<? extends Zombie> type, Level world) { public Zombie(EntityType<? extends Zombie> type, Level world) {
super(type, world); super(type, world);
@@ -264,6 +265,12 @@ public class Zombie extends Monster { @@ -261,6 +262,12 @@ public class Zombie extends Monster {
super.aiStep(); super.aiStep();
} }
@ -29,7 +29,7 @@ index f17a91a654d11aaace39f04b3f4c3e061a374dc9..96d172c428c6293b346201159422e2a5
public void startUnderWaterConversion(int ticksUntilWaterConversion) { public void startUnderWaterConversion(int ticksUntilWaterConversion) {
this.lastTick = MinecraftServer.currentTick; // CraftBukkit this.lastTick = MinecraftServer.currentTick; // CraftBukkit
this.conversionTime = ticksUntilWaterConversion; this.conversionTime = ticksUntilWaterConversion;
@@ -293,9 +300,15 @@ public class Zombie extends Monster { @@ -290,9 +297,15 @@ public class Zombie extends Monster {
} }
public boolean isSunSensitive() { public boolean isSunSensitive() {
@ -46,7 +46,7 @@ index f17a91a654d11aaace39f04b3f4c3e061a374dc9..96d172c428c6293b346201159422e2a5
@Override @Override
public boolean hurt(DamageSource source, float amount) { public boolean hurt(DamageSource source, float amount) {
if (!super.hurt(source, amount)) { if (!super.hurt(source, amount)) {
@@ -415,6 +428,7 @@ public class Zombie extends Monster { @@ -412,6 +425,7 @@ public class Zombie extends Monster {
nbt.putBoolean("CanBreakDoors", this.canBreakDoors()); nbt.putBoolean("CanBreakDoors", this.canBreakDoors());
nbt.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1); nbt.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1);
nbt.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1); nbt.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1);
@ -54,7 +54,7 @@ index f17a91a654d11aaace39f04b3f4c3e061a374dc9..96d172c428c6293b346201159422e2a5
} }
@Override @Override
@@ -426,6 +440,11 @@ public class Zombie extends Monster { @@ -423,6 +437,11 @@ public class Zombie extends Monster {
if (nbt.contains("DrownedConversionTime", 99) && nbt.getInt("DrownedConversionTime") > -1) { if (nbt.contains("DrownedConversionTime", 99) && nbt.getInt("DrownedConversionTime") > -1) {
this.startUnderWaterConversion(nbt.getInt("DrownedConversionTime")); this.startUnderWaterConversion(nbt.getInt("DrownedConversionTime"));
} }

View File

@ -24,10 +24,10 @@ index 769353df1fcdaacecd80085165a1d72f99b577ee..4875e323e8ba52cf91259262b8418310
private static void asyncChunks() { private static void asyncChunks() {
ConfigurationSection section; ConfigurationSection section;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a615821cf605208c61be27f8bd026437b799de14..0103c76c183d0e866a98c26f2d1cf557ba4f67e8 100644 index 25ec1613f4c9ecc59ec5e27717ff7de9ad9e4398..2d2b1a293a1359ffa6d33635856406a909c452ce 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1001,6 +1001,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1000,6 +1000,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override @Override
public void handleEditBook(ServerboundEditBookPacket packet) { public void handleEditBook(ServerboundEditBookPacket packet) {

View File

@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent
is undefined. is undefined.
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 3b943894750022aa84de8af97db3eebf71db1afa..e5f8c48c8d57ce0df4e7aacdbc3a6d3e9b3cb6e1 100644 index 0b3f1585618e29685ffcba704f03ff5e581f0851..821f22b8fde2d76bfcb417138f9bd83af766dcd7 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -418,6 +418,26 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -418,6 +418,26 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@ -55,7 +55,7 @@ index 3b943894750022aa84de8af97db3eebf71db1afa..e5f8c48c8d57ce0df4e7aacdbc3a6d3e
+ case READY_TO_ACCEPT: + case READY_TO_ACCEPT:
+ case DELAY_ACCEPT: + case DELAY_ACCEPT:
+ case ACCEPTED: + 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(), + new com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent(profile.getId(), profile.getName(),
+ ((java.net.InetSocketAddress)address).getAddress(), false).callEvent(); + ((java.net.InetSocketAddress)address).getAddress(), false).callEvent();
+ } + }
@ -64,16 +64,3 @@ index 3b943894750022aa84de8af97db3eebf71db1afa..e5f8c48c8d57ce0df4e7aacdbc3a6d3e
} }
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 3fd913f3e963cf2da849a52364356e3b2da11eee..b5d8987d2903086d69bbd6ba8092e568c94be63f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -59,7 +59,7 @@ 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;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent Enderman from loading chunks
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
index de167655a556a700bdc7d92fa54b802924b2a61a..b27e2e1e2270a7a2f3e36b90a19237e39e4175b8 100644 index c7714824d8e85087397047cf9bcb0528968b1f93..cfdb631500962ec19007db55bd4453687b91c2f8 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -465,7 +465,8 @@ public class EnderMan extends Monster implements NeutralMob { @@ -490,7 +490,8 @@ public class EnderMan extends Monster implements NeutralMob {
int j = Mth.floor(this.enderman.getY() + random.nextDouble() * 2.0D); int j = Mth.floor(this.enderman.getY() + random.nextDouble() * 2.0D);
int k = Mth.floor(this.enderman.getZ() - 1.0D + random.nextDouble() * 2.0D); int k = Mth.floor(this.enderman.getZ() - 1.0D + random.nextDouble() * 2.0D);
BlockPos blockposition = new BlockPos(i, j, k); BlockPos blockposition = new BlockPos(i, j, k);
@ -18,7 +18,7 @@ index de167655a556a700bdc7d92fa54b802924b2a61a..b27e2e1e2270a7a2f3e36b90a19237e3
BlockPos blockposition1 = blockposition.below(); BlockPos blockposition1 = blockposition.below();
BlockState iblockdata1 = world.getBlockState(blockposition1); BlockState iblockdata1 = world.getBlockState(blockposition1);
BlockState iblockdata2 = this.enderman.getCarriedBlock(); BlockState iblockdata2 = this.enderman.getCarriedBlock();
@@ -511,7 +512,8 @@ public class EnderMan extends Monster implements NeutralMob { @@ -536,7 +537,8 @@ public class EnderMan extends Monster implements NeutralMob {
int j = Mth.floor(this.enderman.getY() + random.nextDouble() * 3.0D); int j = Mth.floor(this.enderman.getY() + random.nextDouble() * 3.0D);
int k = Mth.floor(this.enderman.getZ() - 2.0D + random.nextDouble() * 4.0D); int k = Mth.floor(this.enderman.getZ() - 2.0D + random.nextDouble() * 4.0D);
BlockPos blockposition = new BlockPos(i, j, k); BlockPos blockposition = new BlockPos(i, j, k);

View File

@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and
documented as to their purpose. documented as to their purpose.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a45b21a882b34cce3f36ce71a5f803d53331deb0..936e8070f9612cc1d1d960ef873afa4df52911d7 100644 index f51c416e7938b7905f7efb154ab14cad643962e9..71cd61112fa36d1de2f5fc0dd75993fafc3d76ab 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -219,6 +219,7 @@ public class ServerPlayer extends Player { @@ -222,6 +222,7 @@ public class ServerPlayer extends Player {
public int latency; public int latency;
public boolean wonGame; public boolean wonGame;
private int containerUpdateDelay; // Paper private int containerUpdateDelay; // Paper
@ -28,10 +28,10 @@ index a45b21a882b34cce3f36ce71a5f803d53331deb0..936e8070f9612cc1d1d960ef873afa4d
public boolean queueHealthUpdatePacket = false; public boolean queueHealthUpdatePacket = false;
public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 69c32801d219d992143ab6f90d01d93963b7ff5e..f8827ca44a6e099d0a8a05265b01e6f5da3567e0 100644 index fb16158ed403abaac740729cb351cd94a36653ac..e9447ac47a858fbc9e16559c18e377517b8089ac 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -172,6 +172,7 @@ public abstract class PlayerList { @@ -173,6 +173,7 @@ public abstract class PlayerList {
} }
public void placeNewPlayer(Connection connection, ServerPlayer player) { public void placeNewPlayer(Connection connection, ServerPlayer player) {
@ -40,7 +40,7 @@ index 69c32801d219d992143ab6f90d01d93963b7ff5e..f8827ca44a6e099d0a8a05265b01e6f5
GameProfileCache usercache = this.server.getProfileCache(); GameProfileCache usercache = this.server.getProfileCache();
Optional<GameProfile> optional = usercache.get(gameprofile.getId()); Optional<GameProfile> optional = usercache.get(gameprofile.getId());
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
index 93de44b05a698515457052c9c684c4ef44c5cc40..b20bfe5ab165bf86985e5ff2f93f415d9710e0e4 100644 index c7e4c6d29378675b76ebb179022ddbb02831a1dc..88bc0807e8bf66a65422f85f1112336334eb3de2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
@@ -244,6 +244,61 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -244,6 +244,61 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
@ -106,10 +106,10 @@ index 93de44b05a698515457052c9c684c4ef44c5cc40..b20bfe5ab165bf86985e5ff2f93f415d
public Location getBedSpawnLocation() { public Location getBedSpawnLocation() {
CompoundTag data = this.getData(); CompoundTag data = this.getData();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7b7ceefbcc1f0be710dd8995f0afaad98f9c044d..97dd1831cfa1a74ccd80fb79a222d228bc694072 100644 index c5a29d7ca512eddfd01fe1f89f9c1b82bbfd6535..b1e6edae0de15e2b03c5e9a1344886e790f079e3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -151,6 +151,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -154,6 +154,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
private String resourcePackHash; private String resourcePackHash;
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
@ -117,7 +117,7 @@ index 7b7ceefbcc1f0be710dd8995f0afaad98f9c044d..97dd1831cfa1a74ccd80fb79a222d228
// Paper end // Paper end
public CraftPlayer(CraftServer server, ServerPlayer entity) { public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -1520,6 +1521,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1524,6 +1525,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = firstPlayed; this.firstPlayed = firstPlayed;
} }
@ -136,7 +136,7 @@ index 7b7ceefbcc1f0be710dd8995f0afaad98f9c044d..97dd1831cfa1a74ccd80fb79a222d228
public void readExtraData(CompoundTag nbttagcompound) { public void readExtraData(CompoundTag nbttagcompound) {
this.hasPlayedBefore = true; this.hasPlayedBefore = true;
if (nbttagcompound.contains("bukkit")) { if (nbttagcompound.contains("bukkit")) {
@@ -1542,6 +1555,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1546,6 +1559,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void setExtraData(CompoundTag nbttagcompound) { public void setExtraData(CompoundTag nbttagcompound) {
@ -145,7 +145,7 @@ index 7b7ceefbcc1f0be710dd8995f0afaad98f9c044d..97dd1831cfa1a74ccd80fb79a222d228
if (!nbttagcompound.contains("bukkit")) { if (!nbttagcompound.contains("bukkit")) {
nbttagcompound.put("bukkit", new CompoundTag()); nbttagcompound.put("bukkit", new CompoundTag());
} }
@@ -1556,6 +1571,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1560,6 +1575,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.putLong("firstPlayed", this.getFirstPlayed()); data.putLong("firstPlayed", this.getFirstPlayed());
data.putLong("lastPlayed", System.currentTimeMillis()); data.putLong("lastPlayed", System.currentTimeMillis());
data.putString("lastKnownName", handle.getScoreboardName()); data.putString("lastKnownName", handle.getScoreboardName());

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 03257305e1364a6dbda3358ff2cfba5565b4d5da..366d1de99479b53d2e9dac03d71a5a3b1be31ee3 100644 index 71cd61112fa36d1de2f5fc0dd75993fafc3d76ab..e8ef3adad0bfddf17271e095ec928c8acb9413f2 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1539,6 +1539,13 @@ public class ServerPlayer extends Player { @@ -1565,6 +1565,13 @@ public class ServerPlayer extends Player {
public void disconnect() { public void disconnect() {
this.disconnected = true; this.disconnected = true;
this.ejectPassengers(); this.ejectPassengers();

View File

@ -24,10 +24,10 @@ Instead we opt to remove the check entirely so that the event fires for
all piston types. all piston types.
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
index ca9e94b92d26eb6cd3ca6ff4b8cb1cd98aabf4e0..c345bd7542f3ffa09719864887e1516f1182e7e3 100644 index aa4c582172221f7d48c9a64e91bdfb95a2453a6c..2f1345d3c3671953a806cb243a152e080fbb9108 100644
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java --- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java +++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
@@ -147,7 +147,7 @@ public class PistonBaseBlock extends DirectionalBlock { @@ -146,7 +146,7 @@ public class PistonBaseBlock extends DirectionalBlock {
} }
// CraftBukkit start // CraftBukkit start
@ -36,7 +36,7 @@ index ca9e94b92d26eb6cd3ca6ff4b8cb1cd98aabf4e0..c345bd7542f3ffa09719864887e1516f
org.bukkit.block.Block block = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); org.bukkit.block.Block block = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.<org.bukkit.block.Block>of(), CraftBlock.notchToBlockFace(enumdirection)); BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.<org.bukkit.block.Block>of(), CraftBlock.notchToBlockFace(enumdirection));
world.getCraftServer().getPluginManager().callEvent(event); world.getCraftServer().getPluginManager().callEvent(event);
@@ -155,7 +155,7 @@ public class PistonBaseBlock extends DirectionalBlock { @@ -154,7 +154,7 @@ public class PistonBaseBlock extends DirectionalBlock {
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;
} }

View File

@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to
be unintentional in the few cases we've seen so far. be unintentional in the few cases we've seen so far.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 97dd1831cfa1a74ccd80fb79a222d228bc694072..0a5aeafbb47b4bd10a471572ef04b4b9f1e31ace 100644 index b1e6edae0de15e2b03c5e9a1344886e790f079e3..131a8fcf8b0e9ddb5e9f456c494ddea27d4cb88e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2343,6 +2343,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2352,6 +2352,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetCooldown() { public void resetCooldown() {
getHandle().resetAttackStrengthTicker(); getHandle().resetAttackStrengthTicker();
} }
@ -29,5 +29,5 @@ index 97dd1831cfa1a74ccd80fb79a222d228bc694072..0a5aeafbb47b4bd10a471572ef04b4b9
+ } + }
+ } + }
// Paper end // Paper end
// Spigot start // Spigot start
private final Player.Spigot spigot = new Player.Spigot()