Merge fix from Archie Lamb

This commit is contained in:
Bruno Rybársky 2024-05-07 20:03:17 +02:00
parent d018c369ae
commit e33be889a4

@ -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)) { if (world.getBlockState(tpPos).getBlock().equals(Blocks.AIR) && world.getBlockState(tpPos.up()).getBlock().equals(Blocks.AIR)) {
teleportWithEffect(player, world, tpPos); teleportWithEffect(player, world, tpPos);
break;
} }
} }
pos = isJumping ? pos.up() : pos.down(); 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) { private void teleportWithEffect(ServerPlayerEntity player, ServerWorld w, BlockPos tpPos) {
player.teleport(tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f); 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.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); w.spawnParticles(ParticleTypes.POOF, tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f, 5, 0, 0, 0, 0.25f);
} }