Limit UUIDs to 36 chars + prevent null UUIDs

This commit is contained in:
Brokkonaut
2018-09-13 02:25:34 +02:00
parent 0bdeb7dc86
commit faaab7c4f6

View File

@ -37,13 +37,13 @@ public class Actor {
public Actor(String name, String UUID) {
this.name = name;
this.UUID = UUID;
this.UUID = UUID == null ? "unknown" : (UUID.length() > 36 ? UUID.substring(0, 36) : UUID);
this.blockLocation = null;
}
public Actor(String name, String UUID, Block block) {
this.name = name;
this.UUID = UUID;
this.UUID = UUID == null ? "unknown" : (UUID.length() > 36 ? UUID.substring(0, 36) : UUID);
this.blockLocation = block == null ? null : block.getLocation();
}