Skip to content

Commit

Permalink
fix crash with alt dim portal after disabling alt dims
Browse files Browse the repository at this point in the history
  • Loading branch information
qouteall committed Feb 19, 2021
1 parent 43b533b commit ecda9f8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;

import java.util.List;
import java.util.function.Predicate;
Expand Down Expand Up @@ -193,12 +194,18 @@ public static Stream<ChunkLoader> getBaseChunkLoaders(
portal -> {
Vec3d transformedPlayerPos = portal.transformPoint(player.getPos());

World destinationWorld = portal.getDestinationWorld();

if (destinationWorld == null) {
return Stream.empty();
}

return Stream.concat(
Stream.of(getGeneralDirectPortalLoader(player, portal)),
isShrinkLoading() ?
Stream.empty() :
getNearbyPortals(
((ServerWorld) portal.getDestinationWorld()),
((ServerWorld) destinationWorld),
transformedPlayerPos,
p -> p.canBeSpectated(player),
false
Expand Down

0 comments on commit ecda9f8

Please sign in to comment.