Player teleport sound
This commit is contained in:
parent
9570511d8a
commit
6e90378656
@ -10,6 +10,8 @@ import net.minecraft.core.Direction
|
|||||||
import net.minecraft.nbt.CompoundTag
|
import net.minecraft.nbt.CompoundTag
|
||||||
import net.minecraft.resources.ResourceLocation
|
import net.minecraft.resources.ResourceLocation
|
||||||
import net.minecraft.server.level.ServerPlayer
|
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.ClipContext
|
||||||
import net.minecraft.world.level.block.Block
|
import net.minecraft.world.level.block.Block
|
||||||
import net.minecraft.world.level.material.Material
|
import net.minecraft.world.level.material.Material
|
||||||
@ -134,7 +136,11 @@ class EnderTeleporterFeature(capability: MatteryPlayerCapability) : AndroidActiv
|
|||||||
lastTeleport = server.tickCount
|
lastTeleport = server.tickCount
|
||||||
|
|
||||||
if (!isClient) android.androidEnergy.extractEnergyInner(ServerConfig.EnderTeleporter.ENERGY_COST, false)
|
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.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.deltaMovement = Vector(0.0, 0.0, 0.0)
|
||||||
ply.resetFallDistance()
|
ply.resetFallDistance()
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user