Multiverse-Core icon indicating copy to clipboard operation
Multiverse-Core copied to clipboard

Use the World Attribute from the Location Class

Open nicegamer7 opened this issue 5 years ago • 3 comments

While trying to figure out the problem behind #2332 (it ended up being a Spigot bug), I realized that MV's SpawnLocation Class uses it's own World attribute and ignores the one present in the Location Class.

I couldn't understand why this was done, especially since MVWorld.getSpawnLocation() would return with a location with a null World. This PR removes SpawnLocation's World attribute in favour of World's.

nicegamer7 avatar Jul 21 '20 00:07 nicegamer7

I'm marking this as a draft until further notice... maybe indefinitely.

nicegamer7 avatar Oct 07 '20 21:10 nicegamer7

Is this.. still needed?

benwoo1110 avatar Jan 08 '21 11:01 benwoo1110

It was never needed, it's just something I realized that confused me. The reason I set this PR as a draft is because dump and I didn't know why this was done in the first place, so we weren't sure if this change would break anything. I think this change might reduce memory usage by a tiny bit.

nicegamer7 avatar Jan 11 '21 02:01 nicegamer7

I believe weak reference is used bcu world properties are kept in memory even if the world is unloaded.

I just updated to toString method so debug output doesnt keep showing null world https://github.com/Multiverse/Multiverse-Core/commit/3fc3663d5d2839f2b48df478176244e204165556

benwoo1110 avatar Feb 15 '23 12:02 benwoo1110