Skip to content

Commit

Permalink
fix bed_spawn tag thread handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 13, 2019
1 parent 04dc24e commit ee79c6b
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -1066,11 +1066,17 @@ else if (attribute.startsWith("uuid") && !isOnline())
// @mechanism PlayerTag.bed_spawn_location
// -->
if (attribute.startsWith("bed_spawn")) {
if (getOfflinePlayer().getBedSpawnLocation() == null) {
return null;
try {
NMSHandler.getChunkHelper().changeChunkServerThread(getWorld());
if (getOfflinePlayer().getBedSpawnLocation() == null) {
return null;
}
return new LocationTag(getOfflinePlayer().getBedSpawnLocation())
.getAttribute(attribute.fulfill(1));
}
finally {
NMSHandler.getChunkHelper().restoreServerThread(getWorld());
}
return new LocationTag(getOfflinePlayer().getBedSpawnLocation())
.getAttribute(attribute.fulfill(1));
}

// If online, let EntityTag handle location tags since there are more options
Expand Down

0 comments on commit ee79c6b

Please sign in to comment.