parent
56d1501d61
commit
3d77f5c02f
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user