Update WrapperLoginServerLoginSuccess to 1.21.2

This commit is contained in:
booky10 committed 2024-10-20 01:51:30 +02:00
1 parent bb3630840d
commit ff2b73e9b1
1 file changed
+13 -2
@@ -25,6 +25,7 @@ import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.player.TextureProperty;
import com.github.retrooper.packetevents.protocol.player.UserProfile;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import java.util.UUID;
@@ -76,7 +77,8 @@ public class WrapperLoginServerLoginSuccess extends PacketWrapper<WrapperLoginSe
}
}
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_20_5)) {
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_20_5)
&& this.serverVersion.isOlderThan(ServerVersion.V_1_21_2)) {
this.strictErrorHandling = this.readBoolean();
}
}
@@ -99,7 +101,8 @@ public class WrapperLoginServerLoginSuccess extends PacketWrapper<WrapperLoginSe
}
}
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_20_5)) {
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_20_5)
&& this.serverVersion.isOlderThan(ServerVersion.V_1_21_2)) {
this.writeBoolean(this.strictErrorHandling);
}
}
@@ -117,10 +120,18 @@ public class WrapperLoginServerLoginSuccess extends PacketWrapper<WrapperLoginSe
this.userProfile = userProfile;
}
/**
* This is always enabled with 1.21.2
*/
@ApiStatus.Obsolete
public boolean isStrictErrorHandling() {
return this.strictErrorHandling;
}
/**
* This is always enabled with 1.21.2
*/
@ApiStatus.Obsolete
public void setStrictErrorHandling(boolean strictErrorHandling) {
this.strictErrorHandling = strictErrorHandling;
}