3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 19:10:09 +01:00

Fix Player#setPlayerProfile (#8939)

Dieser Commit ist enthalten in:
Owen 2023-03-06 18:15:25 -05:00 committet von GitHub
Ursprung 27c05030e5
Commit bf2053a156
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
12 geänderte Dateien mit 63 neuen und 51 gelöschten Zeilen

Datei anzeigen

@ -42,7 +42,7 @@ index e7442952ef1f03969949014492a7ddc6d0796ba5..69a1852905dd4724c30ac8ab88c14251
public Server getServer() { public Server getServer() {
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 d7d47a3dce2c15d39531344a9eaac3990dc1dfc2..19a440e12248b4f52c2ae2401d6ae4eb39ac4379 100644 index d7d47a3dce2c15d39531344a9eaac3990dc1dfc2..5843e7a364a2fc190adc522c6a99f27094ac1337 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
@@ -81,6 +81,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes; @@ -81,6 +81,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
@ -108,46 +108,57 @@ index d7d47a3dce2c15d39531344a9eaac3990dc1dfc2..19a440e12248b4f52c2ae2401d6ae4eb
if (other instanceof ServerPlayer) { if (other instanceof ServerPlayer) {
ServerPlayer otherPlayer = (ServerPlayer) other; ServerPlayer otherPlayer = (ServerPlayer) other;
@@ -1657,9 +1665,51 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1657,10 +1665,63 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) { if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) {
entry.updatePlayer(this.getHandle()); entry.updatePlayer(this.getHandle());
} }
+ } + }
+ // Paper start + // Paper start
+ private void reregisterPlayer(ServerPlayer player) { + @Override
+ if (!hiddenEntities.containsKey(player.getUUID())) {
+ unregisterEntity(player);
+ registerEntity(player);
+ }
+ }
+ public void setPlayerProfile(com.destroystokyo.paper.profile.PlayerProfile profile) { + public void setPlayerProfile(com.destroystokyo.paper.profile.PlayerProfile profile) {
+ ServerPlayer self = getHandle(); + ServerPlayer self = this.getHandle();
+ self.gameProfile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile); + GameProfile gameProfile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile);
+ if (!self.sentListPacket) { + if (!self.sentListPacket) {
+ self.gameProfile = gameProfile;
+ return; + return;
+ } + }
+ List<ServerPlayer> players = server.getServer().getPlayerList().players; + List<ServerPlayer> players = this.server.getServer().getPlayerList().players;
+ // First unregister the player for all players with the OLD game profile
+ for (ServerPlayer player : players) { + for (ServerPlayer player : players) {
+ player.getBukkitEntity().reregisterPlayer(self); + CraftPlayer bukkitPlayer = player.getBukkitEntity();
+ if (bukkitPlayer.canSee(this)) {
+ bukkitPlayer.unregisterEntity(self);
+ }
+ } + }
+ refreshPlayer();
+ } - server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
+ // Set the game profile here, we should have unregistered the entity via iterating all player entities above.
+ self.gameProfile = gameProfile;
+
+ // Re-register the game profile for all players
+ for (ServerPlayer player : players) {
+ CraftPlayer bukkitPlayer = player.getBukkitEntity();
+ if (bukkitPlayer.canSee(this)) {
+ bukkitPlayer.registerEntity(self);
+ }
+ }
+ // Refresh misc player things AFTER sending game profile
+ this.refreshPlayer();
}
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() { + public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
+ return new com.destroystokyo.paper.profile.CraftPlayerProfile(this).clone(); + return new com.destroystokyo.paper.profile.CraftPlayerProfile(this).clone();
+ } + }
- server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
+ private void refreshPlayer() {
+ ServerPlayer handle = getHandle();
+ +
+ Location loc = getLocation(); + private void refreshPlayer() {
+ ServerPlayer handle = this.getHandle();
+ Location loc = this.getLocation();
+ +
+ ServerGamePacketListenerImpl connection = handle.connection; + ServerGamePacketListenerImpl connection = handle.connection;
+ reregisterPlayer(handle);
+ +
+ //Respawn the player then update their position and selected slot + //Respawn the player then update their position and selected slot
+ ServerLevel worldserver = handle.getLevel(); + ServerLevel worldserver = handle.getLevel();
+ connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), net.minecraft.network.protocol.game.ClientboundRespawnPacket.KEEP_ALL_DATA, this.getHandle().getLastDeathLocation())); + connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), net.minecraft.world.level.biome.BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), net.minecraft.network.protocol.game.ClientboundRespawnPacket.KEEP_ALL_DATA, this.getHandle().getLastDeathLocation()));
+ handle.onUpdateAbilities(); + handle.onUpdateAbilities();
+ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), false); + connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), false);
+ net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle);
@ -156,11 +167,12 @@ index d7d47a3dce2c15d39531344a9eaac3990dc1dfc2..19a440e12248b4f52c2ae2401d6ae4eb
+ this.setOp(false); + this.setOp(false);
+ this.setOp(true); + this.setOp(true);
+ } + }
} + }
+ // Paper end + // Paper end
+
public void onEntityRemove(Entity entity) { public void onEntityRemove(Entity entity) {
this.hiddenEntities.remove(entity.getUUID()); this.hiddenEntities.remove(entity.getUUID());
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
index a679133a3de51e26eb19932ece9ade292879aefd..e342ea27a8a689ea080c7881711a5dcd6322c914 100644 index a679133a3de51e26eb19932ece9ade292879aefd..e342ea27a8a689ea080c7881711a5dcd6322c914 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java

Datei anzeigen

@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk. provide an optional flag to disable this check, at your own risk.
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 19a440e12248b4f52c2ae2401d6ae4eb39ac4379..38abee17ad6db9f593cca06efb1d14049b3307e6 100644 index 5843e7a364a2fc190adc522c6a99f27094ac1337..569ea39bfc3d3eb39e0a69655f91eda09b36b09d 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
@@ -175,6 +175,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -175,6 +175,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -20,7 +20,7 @@ index 19a440e12248b4f52c2ae2401d6ae4eb39ac4379..38abee17ad6db9f593cca06efb1d1404
// Paper end // Paper end
public CraftPlayer(CraftServer server, ServerPlayer entity) { public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -1915,7 +1916,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1926,7 +1927,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end // Paper end
public void addChannel(String channel) { public void addChannel(String channel) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
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 6bec3eb7180ef24c5c1480acd35ca43fdd4e6c3e..8ce3558e154f332040e260c7fc8b2353895237c2 100644 index 5fb1e25722bd08da00f9bd970e7c176329df6e05..0d955b34bb61beeddf08941e92081ac89e8f46c6 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
@@ -2672,6 +2672,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2683,6 +2683,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.adventure$pointers; return this.adventure$pointers;
} }

Datei anzeigen

@ -19,7 +19,7 @@ public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sou
public net.minecraft.world.entity.LivingEntity getSoundVolume()F public net.minecraft.world.entity.LivingEntity getSoundVolume()F
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 20c4ba5d00f5a40f5c7da282c9c069b365273041..4c8b1d30b82fd7a87f79983577695c680013d3f4 100644 index d815679423557606ae653073ce6f9740a766fa03..b847973ef8b1293a821cffd723cec0c9aff248ad 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
@@ -235,6 +235,10 @@ public class ServerPlayer extends Player { @@ -235,6 +235,10 @@ public class ServerPlayer extends Player {
@ -347,10 +347,10 @@ index f70f75867a8f03d42f240a0d007d2221269f2fdb..4edd48ce10caf31ac0136af35f19836b
this.gameEvent(GameEvent.ENTITY_DIE); this.gameEvent(GameEvent.ENTITY_DIE);
} }
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 8ce3558e154f332040e260c7fc8b2353895237c2..819f496d8c3599c16dfa8eaf95578cf53827f2bb 100644 index 0d955b34bb61beeddf08941e92081ac89e8f46c6..aec0434f1885ba465fd7874e693b16fdf60a7f59 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
@@ -2175,7 +2175,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2186,7 +2186,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void sendHealthUpdate() { public void sendHealthUpdate() {

Datei anzeigen

@ -16,7 +16,7 @@ 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 a84e4d7760efd36846ef8619bfabc12629bed940..4680b02295eb231ac90b84734c8d6989f29fa16c 100644 index 63e2e281b693b25159f9359190e5500a4be01e5f..e795d04d218219c701f058cd70f13076ed3e72ba 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
@@ -235,6 +235,7 @@ public class ServerPlayer extends Player { @@ -235,6 +235,7 @@ public class ServerPlayer extends Player {
@ -106,7 +106,7 @@ index 69a1852905dd4724c30ac8ab88c14251eee2c371..17b3d5de58a9ef3acc67624c46cd6bbd
public Location getLastDeathLocation() { public Location getLastDeathLocation() {
if (this.getData().contains("LastDeathLocation", 10)) { if (this.getData().contains("LastDeathLocation", 10)) {
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 819f496d8c3599c16dfa8eaf95578cf53827f2bb..0e7cbe117b758a1f9f67320e9d985f58078b49db 100644 index aec0434f1885ba465fd7874e693b16fdf60a7f59..93196c1e4ca9427c77ead10f7e0c98e4f571bf7f 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
@@ -176,6 +176,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -176,6 +176,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -117,7 +117,7 @@ index 819f496d8c3599c16dfa8eaf95578cf53827f2bb..0e7cbe117b758a1f9f67320e9d985f58
// Paper end // Paper end
public CraftPlayer(CraftServer server, ServerPlayer entity) { public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -1787,6 +1788,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1798,6 +1799,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = firstPlayed; this.firstPlayed = firstPlayed;
} }
@ -136,7 +136,7 @@ index 819f496d8c3599c16dfa8eaf95578cf53827f2bb..0e7cbe117b758a1f9f67320e9d985f58
public void readExtraData(CompoundTag nbttagcompound) { public void readExtraData(CompoundTag nbttagcompound) {
this.hasPlayedBefore = true; this.hasPlayedBefore = true;
if (nbttagcompound.contains("bukkit")) { if (nbttagcompound.contains("bukkit")) {
@@ -1809,6 +1822,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1820,6 +1833,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void setExtraData(CompoundTag nbttagcompound) { public void setExtraData(CompoundTag nbttagcompound) {
@ -145,7 +145,7 @@ index 819f496d8c3599c16dfa8eaf95578cf53827f2bb..0e7cbe117b758a1f9f67320e9d985f58
if (!nbttagcompound.contains("bukkit")) { if (!nbttagcompound.contains("bukkit")) {
nbttagcompound.put("bukkit", new CompoundTag()); nbttagcompound.put("bukkit", new CompoundTag());
} }
@@ -1823,6 +1838,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1834,6 +1849,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());

Datei anzeigen

@ -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 0e7cbe117b758a1f9f67320e9d985f58078b49db..727ed31aefa4e0893a03afd4b90b01ad6ed51ce4 100644 index 93196c1e4ca9427c77ead10f7e0c98e4f571bf7f..7a7de6ce7ac0a713f86ff49c98e74b7997918ef4 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
@@ -2719,6 +2719,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2730,6 +2730,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetCooldown() { public void resetCooldown() {
getHandle().resetAttackStrengthTicker(); getHandle().resetAttackStrengthTicker();
} }

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Brand support
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 d5f879303080dadf0fbd5d15840c2536942c6d0b..473944ad4f317dcb8d0a0ec9dcc736dfc04ae382 100644 index 662cad3da78c131e865dc4a09fe5ebd603d737eb..cb9d7bb244331830855b57b8cfb9a8b668985c69 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
@@ -298,6 +298,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -298,6 +298,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -56,10 +56,10 @@ index d5f879303080dadf0fbd5d15840c2536942c6d0b..473944ad4f317dcb8d0a0ec9dcc736df
return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper
} }
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 4592cac06c8e96d4677ba315f70d5336fcdd0558..b098fcdcadcbf3dac5942a451a16e24b137fa08d 100644 index f0d18b144da254847640cbbf215a74d5794f1550..51f8cbd4ae78c55720ef641237c69c739f17da80 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
@@ -2847,6 +2847,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2858,6 +2858,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end // Paper end
}; };

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
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 1360082426086a61a657c0cefc7bbc1a7df5f2ec..943cfb59907cb519b2f324a9e9185723ebead60d 100644 index c7bef9df5592eba20ac3b64e5b68070be1405698..da6a74c139ac75521a5cb9648642a4a835055e99 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
@@ -2368,7 +2368,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2379,7 +2379,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (data != null && !particle.getDataType().isInstance(data)) { if (data != null && !particle.getDataType().isInstance(data)) {
throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass()); throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass());
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add player health update API
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 485cbeeae012383ec959503c8b909441c25fa4d1..070eaaf9b92757ead4cba398025412f68fcb8bc9 100644 index 6ca632786ff21cdddd5333b574d8bd7211481bbc..eacb64671049def9daccc08ba63176bd1257db46 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
@@ -2247,9 +2247,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2258,9 +2258,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().maxHealthCache = getMaxHealth(); this.getHandle().maxHealthCache = getMaxHealth();
} }
@ -22,7 +22,7 @@ index 485cbeeae012383ec959503c8b909441c25fa4d1..070eaaf9b92757ead4cba398025412f6
if (this.getHandle().queueHealthUpdatePacket) { if (this.getHandle().queueHealthUpdatePacket) {
this.getHandle().queuedHealthUpdatePacket = packet; this.getHandle().queuedHealthUpdatePacket = packet;
} else { } else {
@@ -2257,7 +2259,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2268,7 +2270,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper end // Paper end
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
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 919a31cbce5973c2beea4be6112ec677f68d6990..4bc30ce25c300bf5d2ae2b6388bdc601e0f8441d 100644 index eee94df12d5915f5b6dcd0686dd204df82c301ad..fd8be33b4661e0d761b300b216d8bcb9cb04ff2e 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
@@ -3027,6 +3027,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3038,6 +3038,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper end // Paper end

Datei anzeigen

@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V
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 4bc30ce25c300bf5d2ae2b6388bdc601e0f8441d..8d68aff5cb1b029e9bf7e86d2a48b0642268dec3 100644 index fd8be33b4661e0d761b300b216d8bcb9cb04ff2e..d35cc0cab93ea3db0dddb0bdfb4c33bb516e8367 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
@@ -3032,6 +3032,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3043,6 +3043,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void showElderGuardian(boolean silent) { public void showElderGuardian(boolean silent) {
if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F));
} }

Datei anzeigen

@ -26,10 +26,10 @@ index 875a7d2b2ecd75a51af7d158b7acee358b5082fe..1116116e4ba6c5ecec400cd371b70b9e
} else { } else {
if (fallDistance >= 2.0F) { if (fallDistance >= 2.0F) {
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 ce51bdb40348f00b57c28b515f447ba25e2ef315..533d1776de24b49c47a1a89eb5f4e5ade5592115 100644 index d83df7194a60d713e725a38ccc2c5f293a678d06..e2b750697b59240253aefe71915882a7a7d15d9d 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
@@ -2194,6 +2194,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2205,6 +2205,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().onUpdateAbilities(); this.getHandle().onUpdateAbilities();
} }