Remove instantlyBreakBlocks parameter from PlayerAbilities packet because it changes nothing
This commit is contained in:
parent
99bc827261
commit
c0d21c8b5d
4 changed files with 2 additions and 7 deletions
|
@ -7,7 +7,7 @@ import space.blokk.util.setBit
|
|||
|
||||
object PlayerAbilitiesPacketCodec : OutgoingPacketCodec<PlayerAbilitiesPacket>(0x30, PlayerAbilitiesPacket::class) {
|
||||
override fun PlayerAbilitiesPacket.encode(dst: ByteBuf) {
|
||||
dst.writeByte(bitmask(invulnerable, flying, canFly, instantlyBreakBlocks))
|
||||
dst.writeByte(bitmask(invulnerable, flying, canFly))
|
||||
dst.writeFloat(flyingSpeed)
|
||||
dst.writeFloat(fieldOfView)
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import space.blokk.net.packet.OutgoingPacket
|
|||
* @param invulnerable Whether the player is invulnerable.
|
||||
* @param flying Whether the player is currently flying.
|
||||
* @param canFly Whether the player is allowed to fly.
|
||||
* @param instantlyBreakBlocks Whether can break blocks instantly like in creative mode.
|
||||
* @param flyingSpeed The player's flying speed.
|
||||
* @param fieldOfView The player's field of view modifier.
|
||||
*/
|
||||
|
@ -16,7 +15,6 @@ data class PlayerAbilitiesPacket(
|
|||
val invulnerable: Boolean,
|
||||
val flying: Boolean,
|
||||
val canFly: Boolean,
|
||||
val instantlyBreakBlocks: Boolean,
|
||||
val flyingSpeed: Float,
|
||||
val fieldOfView: Float
|
||||
) : OutgoingPacket()
|
||||
|
|
|
@ -116,8 +116,6 @@ class LoginAndJoinProcedure(val session: BlokkSession) {
|
|||
event.invulnerable,
|
||||
event.flying,
|
||||
event.canFly,
|
||||
// TODO: Consider allowing to modify this value
|
||||
event.gameMode == GameMode.CREATIVE,
|
||||
// TODO: Find out how this relates to the entity property named `generic.flying_speed`
|
||||
event.flyingSpeed,
|
||||
event.fieldOfView
|
||||
|
|
|
@ -2,6 +2,7 @@ package space.blokk.testplugin
|
|||
|
||||
import space.blokk.Blokk
|
||||
import space.blokk.net.event.SessionAfterLoginEvent
|
||||
import space.blokk.player.GameMode
|
||||
import space.blokk.plugin.Plugin
|
||||
import space.blokk.testplugin.anvil.AnvilWorld
|
||||
import space.blokk.world.Dimension
|
||||
|
@ -30,8 +31,6 @@ class TestPlugin: Plugin("Test", "1.0.0") {
|
|||
world.getVoxel(VoxelLocation(-1, 2, -1)).block = CraftingTable()
|
||||
|
||||
Blokk.eventBus.on<SessionAfterLoginEvent> { event ->
|
||||
event.canFly = true
|
||||
event.flyingSpeed = 2.0f
|
||||
event.initialWorldAndLocation = WorldAndLocationWithRotation(
|
||||
world,
|
||||
VoxelLocation(0, 2, 0).atTopCenter().withRotation(0f, 0f)
|
||||
|
|
Reference in a new issue