Normalizes CraftEntity#toString/getHandle#12170
Conversation
e71dad7 to
af3f548
Compare
lynxplay
left a comment
There was a problem hiding this comment.
Generally looks good to me, however I am a bit split on what is then actually included in the toString().
The fact that 99% of entities now only expose their uuid is fine to me, I don't think toString() is a reliable
debugging source in the first place.
Noting that, I am confused why you chose to keep CraftHumanEntity's name in the toString impl?
It sticks out a bit given other entities lost their debug information (like horse variants or itemframe rotations).
|
|
||
| @Override | ||
| public String toString() { | ||
| return this.getClass().getSimpleName() + "{uuid=" + this.getUniqueId() + '}'; |
There was a problem hiding this comment.
Maybe can just use handle.getScoreboardName so we don't have to leave the toString implementation in CraftPlayer either.
|
How hard its make more "dynamic" the getHandle for avoid declare that for every class? or is not related to the point of this PR? |
|
Unrelated to this PR and effectively impossible unless we want to create CraftEntity |
|
There are probably some entity types that should have extra stuff, like itemstack (the itemstack itself). Do we want to just do that later, starting from this point? |
|
I don't think so, i think the minimal info we show here, the better otherwise it's very arbitrary like before. The only reason i put the player name is because player is a special entity. But i'm fine following lynx advice and just show the uuid for all entities. |
|
99% of the time I log some random object, it's because I want some level of information from the thing; I did ponder the idea of using kyori examinables type of setup here so that we can more cleanly control what ends up being dumped out, things like "is this entity valid still" is always nice to see; |
af3f548 to
8eeb419
Compare
Owen1212055
left a comment
There was a problem hiding this comment.
At which point however, that all seems like scope creep.
This looks good to me.
8eeb419 to
a372780
Compare
Instead of hardcoding the class name, fetch it dynamically and show more useful info to distinguish the instances