Account for possible world nullability for Entity#getOrigin Location

This commit is contained in:
dordsor21 2022-06-15 18:16:47 +01:00 committed by wizjany
parent 0d2ed8205f
commit e756d127c5
1 changed files with 2 additions and 1 deletions

View File

@ -135,7 +135,8 @@ class AbstractListener implements Listener {
Location loc;
if (PaperLib.isPaper() && config.usePaperEntityOrigin) {
loc = entity.getOrigin();
if (loc == null) {
// Origin world may be null, and thus a Location with a null world created, which cannot be adapted to a WorldEdit location
if (loc == null || loc.getWorld() == null) {
loc = entity.getLocation();
}
} else {