From e33be889a4d7d6c759c3e3e83f712f6d2f3f82aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Tue, 7 May 2024 20:03:17 +0200 Subject: [PATCH] Merge fix from Archie Lamb --- src/main/java/systems/brn/televator/blocks/TelevatorBlock.java | 3 +++ 1 file changed, 3 insertions(+) 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); }