diff --git a/src/main/java/systems/brn/televator/blocks/TelevatorBlock.java b/src/main/java/systems/brn/televator/blocks/TelevatorBlock.java index 2fbe51a..e040f74 100644 --- a/src/main/java/systems/brn/televator/blocks/TelevatorBlock.java +++ b/src/main/java/systems/brn/televator/blocks/TelevatorBlock.java @@ -57,6 +57,7 @@ public class TelevatorBlock extends Block implements PolymerTexturedBlock { if (world.getBlockState(tpPos).getBlock().equals(Blocks.AIR) && world.getBlockState(tpPos.up()).getBlock().equals(Blocks.AIR)) { teleportWithEffect(player, world, tpPos); + break; } } pos = isJumping ? pos.up() : pos.down(); @@ -66,6 +67,8 @@ public class TelevatorBlock extends Block implements PolymerTexturedBlock { private void teleportWithEffect(ServerPlayerEntity player, ServerWorld w, BlockPos tpPos) { player.teleport(tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f); + player.setVelocity(0, 0, 0); + player.setSneaking(false); w.playSound(null, tpPos, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 0.5f, 1.5f); w.spawnParticles(ParticleTypes.POOF, tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f, 5, 0, 0, 0, 0.25f); }