Fix custom teleporters NPE (#7296)

This commit is contained in:
mrp-v2 authored and GitHub committed 2020-09-08 13:29:07 -07:00
1 parent 178e3d244a
commit e421ea164c
3 files changed
+18 -6

No files matched your search

@@ -24,6 +24,7 @@ import java.util.function.Function;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.world.Teleporter;
import net.minecraft.world.server.ServerWorld;
/**
@@ -57,4 +58,10 @@ public interface ITeleporter {
default Entity placeEntity(Entity entity, ServerWorld currentWorld, ServerWorld destWorld, float yaw, Function<Boolean, Entity> repositionEntity) {
return repositionEntity.apply(true);
}
//used internally to handle vanilla hardcoding
default boolean isVanilla()
{
return getClass() == Teleporter.class;
}
}