dev.mayuna.timestop.networking.exceptions.FailedToDeserializeTimeStopPacket Maven / Gradle / Ivy
package dev.mayuna.timestop.networking.exceptions;
import dev.mayuna.timestop.networking.timestop.TimeStopPacket;
public class FailedToDeserializeTimeStopPacket extends RuntimeException {
public FailedToDeserializeTimeStopPacket(TimeStopPacket packet, Throwable cause) {
super(String.format("Failed to deserialize TimeStopPacket of %s data length and serialized class %s (UUID: %s)", getDataLength(packet), packet.getSerializedClass(), packet.getUuid()), cause);
}
private static int getDataLength(TimeStopPacket packet) {
return packet.getData().length;
}
}