From 6e903786567b4b775cea479c48735ded78df0fff Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 12 Oct 2022 23:00:57 +0700 Subject: [PATCH] Player teleport sound --- .../mc/otm/android/feature/EnderTeleporterFeature.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/EnderTeleporterFeature.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/EnderTeleporterFeature.kt index 30cd8d73c..7ea9607be 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/EnderTeleporterFeature.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/EnderTeleporterFeature.kt @@ -10,6 +10,8 @@ import net.minecraft.core.Direction import net.minecraft.nbt.CompoundTag import net.minecraft.resources.ResourceLocation import net.minecraft.server.level.ServerPlayer +import net.minecraft.sounds.SoundEvents +import net.minecraft.sounds.SoundSource import net.minecraft.world.level.ClipContext import net.minecraft.world.level.block.Block import net.minecraft.world.level.material.Material @@ -134,7 +136,11 @@ class EnderTeleporterFeature(capability: MatteryPlayerCapability) : AndroidActiv lastTeleport = server.tickCount if (!isClient) android.androidEnergy.extractEnergyInner(ServerConfig.EnderTeleporter.ENERGY_COST, false) + + ply.level.playSound(ply, ply, SoundEvents.ENDERMAN_TELEPORT, SoundSource.PLAYERS, 0.3f, 0.8f + ply.level.random.nextFloat() * 0.4f) ply.setPos(Vector(blockPos.x + 0.5, blockPos.y.toDouble(), blockPos.z + 0.5)) + ply.level.playSound(ply, ply, SoundEvents.ENDERMAN_TELEPORT, SoundSource.PLAYERS, 1f, 0.8f + ply.level.random.nextFloat() * 0.4f) + ply.deltaMovement = Vector(0.0, 0.0, 0.0) ply.resetFallDistance() return true