feat: Improve SpawnLocation toString

This helps in debug logs not showing world=null for spawn location
This commit is contained in:
Ben Woo 2023-02-15 20:27:59 +08:00
parent 5d1d71baf2
commit 3fc3663d5d
2 changed files with 15 additions and 1 deletions

View File

@ -380,7 +380,7 @@ public class SimpleMVWorld implements MVWorld {
@Override
public String toString() {
return "NULL LOCATION";
return "Location{null}";
};
}

View File

@ -95,4 +95,18 @@ public class SpawnLocation extends Location implements ConfigurationSerializable
float yaw = ((Number) args.get("yaw")).floatValue();
return new SpawnLocation(x, y, z, yaw, pitch);
}
/**
* {@inheritDoc}
*/
@Override
public String toString() {
return "Location{world=" + getWorld()
+ ",x=" + this.getX()
+ ",y=" + this.getY()
+ ",z=" + this.getZ()
+ ",pitch=" + this.getPitch()
+ ",yaw=" + this.getYaw()
+ '}';
}
}