From 57d7fd59cc4af5227253e2ca092e9d815fd58092 Mon Sep 17 00:00:00 2001 From: EnZaXD <60033407+FlorianMichael@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:00:04 +0200 Subject: [PATCH] Change IdAndData#setData parameter to int (#3788) --- .../com/viaversion/viaversion/util/IdAndData.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/util/IdAndData.java b/api/src/main/java/com/viaversion/viaversion/util/IdAndData.java index 93c7ae0b1..518491b25 100644 --- a/api/src/main/java/com/viaversion/viaversion/util/IdAndData.java +++ b/api/src/main/java/com/viaversion/viaversion/util/IdAndData.java @@ -31,11 +31,11 @@ public class IdAndData { private int id; private byte data; - public IdAndData(int id) { + public IdAndData(final int id) { 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 + ")"); this.id = id; this.data = (byte) data; @@ -69,7 +69,7 @@ public class IdAndData { return toRawData(id, data); } - public IdAndData withData(int data) { + public IdAndData withData(final int data) { return new IdAndData(this.id, data); } @@ -85,11 +85,10 @@ public class IdAndData { return data; } - public void setData(final byte data) { - this.data = data; + public void setData(final int data) { + this.data = (byte) data; } - @Override public boolean equals(final Object o) { if (this == o) return true;