3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 16:12:46 +01:00

Allow BedrockData and LinkedPlayer cloning

Dieser Commit ist enthalten in:
Tim203 2021-01-12 20:55:11 +01:00
Ursprung 5ad495ce97
Commit ce2734d3b9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 064EE9F5BF7C3EE8
2 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -36,7 +36,7 @@ import lombok.Getter;
*/ */
@Getter @Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE) @AllArgsConstructor(access = AccessLevel.PRIVATE)
public final class BedrockData { public final class BedrockData implements Cloneable {
public static final int EXPECTED_LENGTH = 10; public static final int EXPECTED_LENGTH = 10;
private final String version; private final String version;
@ -96,4 +96,9 @@ public final class BedrockData {
(fromProxy ? 1 : 0) + '\0' + (fromProxy ? 1 : 0) + '\0' +
(linkedPlayer != null ? linkedPlayer.toString() : "null"); (linkedPlayer != null ? linkedPlayer.toString() : "null");
} }
@Override
public BedrockData clone() throws CloneNotSupportedException {
return (BedrockData) super.clone();
}
} }

Datei anzeigen

@ -34,7 +34,7 @@ import java.util.UUID;
@Getter @Getter
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) @RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public final class LinkedPlayer { public final class LinkedPlayer implements Cloneable {
/** /**
* The Java username of the linked player * The Java username of the linked player
*/ */
@ -74,4 +74,9 @@ public final class LinkedPlayer {
public String toString() { public String toString() {
return javaUsername + ';' + javaUniqueId.toString() + ';' + bedrockId.toString(); return javaUsername + ';' + javaUniqueId.toString() + ';' + bedrockId.toString();
} }
@Override
public LinkedPlayer clone() throws CloneNotSupportedException {
return (LinkedPlayer) super.clone();
}
} }