3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 16:40:10 +01:00

Change IdAndData#setData parameter to int (#3788)

Dieser Commit ist enthalten in:
EnZaXD 2024-04-16 21:00:04 +02:00 committet von GitHub
Ursprung 8fe0681778
Commit 57d7fd59cc
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -31,11 +31,11 @@ public class IdAndData {
private int id; private int id;
private byte data; private byte data;
public IdAndData(int id) { public IdAndData(final int id) {
this(id, -1); this(id, -1);
} }
public IdAndData(int id, int data) { public IdAndData(final int id, final int data) {
Preconditions.checkArgument(data >= 0 && data <= 15, "Data has to be between 0 and 15: (id: " + id + " data: " + data + ")"); Preconditions.checkArgument(data >= 0 && data <= 15, "Data has to be between 0 and 15: (id: " + id + " data: " + data + ")");
this.id = id; this.id = id;
this.data = (byte) data; this.data = (byte) data;
@ -69,7 +69,7 @@ public class IdAndData {
return toRawData(id, data); return toRawData(id, data);
} }
public IdAndData withData(int data) { public IdAndData withData(final int data) {
return new IdAndData(this.id, data); return new IdAndData(this.id, data);
} }
@ -85,11 +85,10 @@ public class IdAndData {
return data; return data;
} }
public void setData(final byte data) { public void setData(final int data) {
this.data = data; this.data = (byte) data;
} }
@Override @Override
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (this == o) return true; if (this == o) return true;