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 99b2dca79..55af601f2 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 @@ -9,6 +9,7 @@ import net.minecraft.client.renderer.LevelRenderer import net.minecraft.core.BlockPos import net.minecraft.core.Direction import net.minecraft.core.Vec3i +import net.minecraft.network.protocol.game.ClientboundSoundEntityPacket import net.minecraft.resources.ResourceLocation import net.minecraft.server.level.ServerPlayer import net.minecraft.sounds.SoundEvents @@ -298,8 +299,13 @@ class EnderTeleporterFeature(capability: MatteryPlayerCapability) : AndroidActiv blockPos ?: return false val event = ForgeEventFactory.onEnderTeleport(ply, blockPos.x + 0.5, blockPos.y.toDouble(), blockPos.z + 0.5) - if (event.isCanceled) return false + if (event.isCanceled) { + (ply as ServerPlayer).connection.send(ClientboundSoundEntityPacket(SoundEvents.ITEM_BREAK, SoundSource.PLAYERS, ply, 0.3f, 0.5f, ply.level.random.nextLong())) + return false + } + + putOnCooldown() lastTeleport = ply.server!!.tickCount android.androidEnergy.extractEnergyInner(ServerConfig.EnderTeleporter.ENERGY_COST, false)