Update to Minecraft 1.19.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2022-08-06 07:40:00 +10:00
parent c6b9050486
commit 808a4dedfe
4 changed files with 26 additions and 26 deletions

View file

@ -1,6 +1,6 @@
--- a/net/minecraft/server/network/LoginListener.java --- a/net/minecraft/server/network/LoginListener.java
+++ b/net/minecraft/server/network/LoginListener.java +++ b/net/minecraft/server/network/LoginListener.java
@@ -42,6 +42,12 @@ @@ -41,6 +41,12 @@
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -13,7 +13,7 @@
public class LoginListener implements TickablePacketListener, PacketLoginInListener { public class LoginListener implements TickablePacketListener, PacketLoginInListener {
private static final AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0); private static final AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0);
@@ -63,6 +69,7 @@ @@ -59,6 +65,7 @@
private EntityPlayer delayedAcceptPlayer; private EntityPlayer delayedAcceptPlayer;
@Nullable @Nullable
private ProfilePublicKey.a profilePublicKeyData; private ProfilePublicKey.a profilePublicKeyData;
@ -21,7 +21,7 @@
public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) { public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
this.state = LoginListener.EnumProtocolState.HELLO; this.state = LoginListener.EnumProtocolState.HELLO;
@@ -92,6 +99,13 @@ @@ -88,6 +95,13 @@
} }
@ -35,7 +35,7 @@
@Override @Override
public NetworkManager getConnection() { public NetworkManager getConnection() {
return this.connection; return this.connection;
@@ -127,10 +141,12 @@ @@ -123,10 +137,12 @@
} }
} }
@ -51,7 +51,7 @@
} else { } else {
this.state = LoginListener.EnumProtocolState.ACCEPTED; this.state = LoginListener.EnumProtocolState.ACCEPTED;
if (this.server.getCompressionThreshold() >= 0 && !this.connection.isMemoryConnection()) { if (this.server.getCompressionThreshold() >= 0 && !this.connection.isMemoryConnection()) {
@@ -143,7 +159,7 @@ @@ -139,7 +155,7 @@
EntityPlayer entityplayer = this.server.getPlayerList().getPlayer(this.gameProfile.getId()); EntityPlayer entityplayer = this.server.getPlayerList().getPlayer(this.gameProfile.getId());
try { try {
@ -60,7 +60,7 @@
if (entityplayer != null) { if (entityplayer != null) {
this.state = LoginListener.EnumProtocolState.DELAY_ACCEPT; this.state = LoginListener.EnumProtocolState.DELAY_ACCEPT;
@@ -204,7 +220,7 @@ @@ -188,7 +204,7 @@
public void handleHello(PacketLoginInStart packetlogininstart) { public void handleHello(PacketLoginInStart packetlogininstart) {
Validate.validState(this.state == LoginListener.EnumProtocolState.HELLO, "Unexpected hello packet", new Object[0]); Validate.validState(this.state == LoginListener.EnumProtocolState.HELLO, "Unexpected hello packet", new Object[0]);
Validate.validState(isValidUsername(packetlogininstart.name()), "Invalid characters in username", new Object[0]); Validate.validState(isValidUsername(packetlogininstart.name()), "Invalid characters in username", new Object[0]);
@ -69,7 +69,7 @@
GameProfile gameprofile = this.server.getSingleplayerProfile(); GameProfile gameprofile = this.server.getSingleplayerProfile();
if (gameprofile != null && packetlogininstart.name().equalsIgnoreCase(gameprofile.getName())) { if (gameprofile != null && packetlogininstart.name().equalsIgnoreCase(gameprofile.getName())) {
@@ -265,6 +281,43 @@ @@ -249,6 +265,43 @@
try { try {
LoginListener.this.gameProfile = LoginListener.this.server.getSessionService().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.getAddress()); LoginListener.this.gameProfile = LoginListener.this.server.getSessionService().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.getAddress());
if (LoginListener.this.gameProfile != null) { if (LoginListener.this.gameProfile != null) {
@ -113,7 +113,7 @@
LoginListener.LOGGER.info("UUID of player {} is {}", LoginListener.this.gameProfile.getName(), LoginListener.this.gameProfile.getId()); LoginListener.LOGGER.info("UUID of player {} is {}", LoginListener.this.gameProfile.getName(), LoginListener.this.gameProfile.getId());
LoginListener.this.state = LoginListener.EnumProtocolState.READY_TO_ACCEPT; LoginListener.this.state = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
} else if (LoginListener.this.server.isSingleplayer()) { } else if (LoginListener.this.server.isSingleplayer()) {
@@ -284,6 +337,11 @@ @@ -268,6 +321,11 @@
LoginListener.this.disconnect(IChatBaseComponent.translatable("multiplayer.disconnect.authservers_down")); LoginListener.this.disconnect(IChatBaseComponent.translatable("multiplayer.disconnect.authservers_down"));
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable"); LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
} }

View file

@ -1129,7 +1129,7 @@
this.detectRateSpam(); this.detectRateSpam();
} }
@@ -1495,8 +2177,10 @@ @@ -1503,8 +2185,10 @@
} }
private void detectRateSpam() { private void detectRateSpam() {
@ -1142,7 +1142,7 @@
this.disconnect(IChatBaseComponent.translatable("disconnect.spam")); this.disconnect(IChatBaseComponent.translatable("disconnect.spam"));
} }
@@ -1560,7 +2244,7 @@ @@ -1568,7 +2252,7 @@
List<PreviewableCommand.a<CommandListenerWrapper>> list = previewablecommand.arguments(); List<PreviewableCommand.a<CommandListenerWrapper>> list = previewablecommand.arguments();
if (list.isEmpty()) { if (list.isEmpty()) {
@ -1151,7 +1151,7 @@
} else { } else {
for (int i = list.size() - 1; i >= 0; --i) { for (int i = list.size() - 1; i >= 0; --i) {
PreviewableCommand.a previewablecommand_a = (PreviewableCommand.a) list.get(i); PreviewableCommand.a previewablecommand_a = (PreviewableCommand.a) list.get(i);
@@ -1572,11 +2256,11 @@ @@ -1580,11 +2264,11 @@
return completablefuture; return completablefuture;
} }
} catch (CommandSyntaxException commandsyntaxexception) { } catch (CommandSyntaxException commandsyntaxexception) {
@ -1165,7 +1165,7 @@
} }
} }
@@ -1603,13 +2287,65 @@ @@ -1611,13 +2295,65 @@
@Override @Override
public void handleAnimate(PacketPlayInArmAnimation packetplayinarmanimation) { public void handleAnimate(PacketPlayInArmAnimation packetplayinarmanimation) {
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinarmanimation, this, this.player.getLevel()); PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinarmanimation, this, this.player.getLevel());
@ -1231,7 +1231,7 @@
this.player.resetLastActionTime(); this.player.resetLastActionTime();
IJumpable ijumpable; IJumpable ijumpable;
@@ -1694,6 +2430,7 @@ @@ -1702,6 +2438,7 @@
@Override @Override
public void handleInteract(PacketPlayInUseEntity packetplayinuseentity) { public void handleInteract(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseentity, this, this.player.getLevel()); PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseentity, this, this.player.getLevel());
@ -1239,7 +1239,7 @@
WorldServer worldserver = this.player.getLevel(); WorldServer worldserver = this.player.getLevel();
final Entity entity = packetplayinuseentity.getTarget(worldserver); final Entity entity = packetplayinuseentity.getTarget(worldserver);
@@ -1706,10 +2443,44 @@ @@ -1714,10 +2451,44 @@
if (entity.distanceToSqr(this.player.getEyePosition()) < PlayerConnection.MAX_INTERACTION_DISTANCE) { if (entity.distanceToSqr(this.player.getEyePosition()) < PlayerConnection.MAX_INTERACTION_DISTANCE) {
packetplayinuseentity.dispatch(new PacketPlayInUseEntity.c() { packetplayinuseentity.dispatch(new PacketPlayInUseEntity.c() {
@ -1285,7 +1285,7 @@
if (enuminteractionresult.consumesAction()) { if (enuminteractionresult.consumesAction()) {
CriterionTriggers.PLAYER_INTERACTED_WITH_ENTITY.trigger(PlayerConnection.this.player, itemstack, entity); CriterionTriggers.PLAYER_INTERACTED_WITH_ENTITY.trigger(PlayerConnection.this.player, itemstack, entity);
if (enuminteractionresult.shouldSwing()) { if (enuminteractionresult.shouldSwing()) {
@@ -1721,20 +2492,27 @@ @@ -1729,20 +2500,27 @@
@Override @Override
public void onInteraction(EnumHand enumhand) { public void onInteraction(EnumHand enumhand) {
@ -1316,7 +1316,7 @@
} else { } else {
PlayerConnection.this.disconnect(IChatBaseComponent.translatable("multiplayer.disconnect.invalid_entity_attacked")); PlayerConnection.this.disconnect(IChatBaseComponent.translatable("multiplayer.disconnect.invalid_entity_attacked"));
PlayerConnection.LOGGER.warn("Player {} tried to attack an invalid entity", PlayerConnection.this.player.getName().getString()); PlayerConnection.LOGGER.warn("Player {} tried to attack an invalid entity", PlayerConnection.this.player.getName().getString());
@@ -1779,15 +2557,21 @@ @@ -1787,15 +2565,21 @@
@Override @Override
public void handleContainerClose(PacketPlayInCloseWindow packetplayinclosewindow) { public void handleContainerClose(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinclosewindow, this, this.player.getLevel()); PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinclosewindow, this, this.player.getLevel());
@ -1340,7 +1340,7 @@
this.player.containerMenu.sendAllDataToRemote(); this.player.containerMenu.sendAllDataToRemote();
} else if (!this.player.containerMenu.stillValid(this.player)) { } else if (!this.player.containerMenu.stillValid(this.player)) {
PlayerConnection.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu); PlayerConnection.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
@@ -1800,7 +2584,284 @@ @@ -1808,7 +2592,284 @@
boolean flag = packetplayinwindowclick.getStateId() != this.player.containerMenu.getStateId(); boolean flag = packetplayinwindowclick.getStateId() != this.player.containerMenu.getStateId();
this.player.containerMenu.suppressRemoteUpdates(); this.player.containerMenu.suppressRemoteUpdates();
@ -1626,7 +1626,7 @@
ObjectIterator objectiterator = Int2ObjectMaps.fastIterable(packetplayinwindowclick.getChangedSlots()).iterator(); ObjectIterator objectiterator = Int2ObjectMaps.fastIterable(packetplayinwindowclick.getChangedSlots()).iterator();
while (objectiterator.hasNext()) { while (objectiterator.hasNext()) {
@@ -1840,6 +2901,7 @@ @@ -1848,6 +2909,7 @@
@Override @Override
public void handleContainerButtonClick(PacketPlayInEnchantItem packetplayinenchantitem) { public void handleContainerButtonClick(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinenchantitem, this, this.player.getLevel()); PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinenchantitem, this, this.player.getLevel());
@ -1634,7 +1634,7 @@
this.player.resetLastActionTime(); this.player.resetLastActionTime();
if (this.player.containerMenu.containerId == packetplayinenchantitem.getContainerId() && !this.player.isSpectator()) { if (this.player.containerMenu.containerId == packetplayinenchantitem.getContainerId() && !this.player.isSpectator()) {
if (!this.player.containerMenu.stillValid(this.player)) { if (!this.player.containerMenu.stillValid(this.player)) {
@@ -1877,6 +2939,43 @@ @@ -1885,6 +2947,43 @@
boolean flag1 = packetplayinsetcreativeslot.getSlotNum() >= 1 && packetplayinsetcreativeslot.getSlotNum() <= 45; boolean flag1 = packetplayinsetcreativeslot.getSlotNum() >= 1 && packetplayinsetcreativeslot.getSlotNum() <= 45;
boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty(); boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
@ -1678,7 +1678,7 @@
if (flag1 && flag2) { if (flag1 && flag2) {
this.player.inventoryMenu.getSlot(packetplayinsetcreativeslot.getSlotNum()).set(itemstack); this.player.inventoryMenu.getSlot(packetplayinsetcreativeslot.getSlotNum()).set(itemstack);
@@ -1899,6 +2998,7 @@ @@ -1907,6 +3006,7 @@
} }
private void updateSignText(PacketPlayInUpdateSign packetplayinupdatesign, List<FilteredText> list) { private void updateSignText(PacketPlayInUpdateSign packetplayinupdatesign, List<FilteredText> list) {
@ -1686,7 +1686,7 @@
this.player.resetLastActionTime(); this.player.resetLastActionTime();
WorldServer worldserver = this.player.getLevel(); WorldServer worldserver = this.player.getLevel();
BlockPosition blockposition = packetplayinupdatesign.getPos(); BlockPosition blockposition = packetplayinupdatesign.getPos();
@@ -1915,18 +3015,37 @@ @@ -1923,18 +3023,37 @@
if (!tileentitysign.isEditable() || !this.player.getUUID().equals(tileentitysign.getPlayerWhoMayEdit())) { if (!tileentitysign.isEditable() || !this.player.getUUID().equals(tileentitysign.getPlayerWhoMayEdit())) {
PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString()); PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString());
@ -1726,7 +1726,7 @@
tileentitysign.setChanged(); tileentitysign.setChanged();
worldserver.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3); worldserver.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
@@ -1936,6 +3055,7 @@ @@ -1944,6 +3063,7 @@
@Override @Override
public void handleKeepAlive(PacketPlayInKeepAlive packetplayinkeepalive) { public void handleKeepAlive(PacketPlayInKeepAlive packetplayinkeepalive) {
@ -1734,7 +1734,7 @@
if (this.keepAlivePending && packetplayinkeepalive.getId() == this.keepAliveChallenge) { if (this.keepAlivePending && packetplayinkeepalive.getId() == this.keepAliveChallenge) {
int i = (int) (SystemUtils.getMillis() - this.keepAliveTime); int i = (int) (SystemUtils.getMillis() - this.keepAliveTime);
@@ -1950,7 +3070,17 @@ @@ -1958,7 +3078,17 @@
@Override @Override
public void handlePlayerAbilities(PacketPlayInAbilities packetplayinabilities) { public void handlePlayerAbilities(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinabilities, this, this.player.getLevel()); PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinabilities, this, this.player.getLevel());
@ -1753,7 +1753,7 @@
} }
@Override @Override
@@ -1959,8 +3089,50 @@ @@ -1967,8 +3097,50 @@
this.player.updateOptions(packetplayinsettings); this.player.updateOptions(packetplayinsettings);
} }

View file

@ -4,7 +4,7 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.19.1-R0.1-SNAPSHOT</version> <version>1.19.2-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name> <name>CraftBukkit</name>
<url>https://www.spigotmc.org/</url> <url>https://www.spigotmc.org/</url>

View file

@ -237,7 +237,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
* @return string * @return string
*/ */
public String getMappingsVersion() { public String getMappingsVersion() {
return "4cc0cc97cac491651bff3af8b124a214"; return "69c84c88aeb92ce9fa9525438b93f4fe";
} }
@Override @Override