Fixed it so you can't spawn inside of a block when u first enter limbo!

This commit is contained in:
MalekiRe 2021-06-13 18:33:03 -07:00
parent ce39499af3
commit 938b206797
2 changed files with 3 additions and 2 deletions

View file

@ -9,6 +9,7 @@ import org.dimdev.dimdoors.api.util.TeleportUtil;
import org.dimdev.dimdoors.world.ModDimensions;
import net.minecraft.entity.Entity;
import org.dimdev.dimdoors.world.pocket.VirtualLocation;
public class LimboTarget extends VirtualTarget implements EntityTarget {
public static final LimboTarget INSTANCE = new LimboTarget();
@ -19,7 +20,7 @@ public class LimboTarget extends VirtualTarget implements EntityTarget {
@Override
public boolean receiveEntity(Entity entity, Vec3d relativePos, EulerAngle relativeAngle, Vec3d relativeVelocity) {
TeleportUtil.teleport(entity, ModDimensions.LIMBO_DIMENSION, entity.getPos(), relativeAngle, relativeVelocity);
TeleportUtil.teleport(entity, ModDimensions.LIMBO_DIMENSION, entity.getBlockPos().add(0, 255-entity.getBlockY(), 0), relativeAngle, relativeVelocity);
return true;
}

View file

@ -93,7 +93,7 @@ public class VirtualLocation {
BlockPos pos = getTopPos(world, new BlockPos(newX, 255, newZ));
return new Location(world, pos);
}
private static BlockPos getTopPos(World world, BlockPos pos) {
public static BlockPos getTopPos(World world, BlockPos pos) {
while(world.getBlockState(pos).isAir()) {
pos = pos.down();
}