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) {
|
object PlayerAbilitiesPacketCodec : OutgoingPacketCodec<PlayerAbilitiesPacket>(0x30, PlayerAbilitiesPacket::class) {
|
||||||
override fun PlayerAbilitiesPacket.encode(dst: ByteBuf) {
|
override fun PlayerAbilitiesPacket.encode(dst: ByteBuf) {
|
||||||
dst.writeByte(bitmask(invulnerable, flying, canFly, instantlyBreakBlocks))
|
dst.writeByte(bitmask(invulnerable, flying, canFly))
|
||||||
dst.writeFloat(flyingSpeed)
|
dst.writeFloat(flyingSpeed)
|
||||||
dst.writeFloat(fieldOfView)
|
dst.writeFloat(fieldOfView)
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import space.blokk.net.packet.OutgoingPacket
|
||||||
* @param invulnerable Whether the player is invulnerable.
|
* @param invulnerable Whether the player is invulnerable.
|
||||||
* @param flying Whether the player is currently flying.
|
* @param flying Whether the player is currently flying.
|
||||||
* @param canFly Whether the player is allowed to fly.
|
* @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 flyingSpeed The player's flying speed.
|
||||||
* @param fieldOfView The player's field of view modifier.
|
* @param fieldOfView The player's field of view modifier.
|
||||||
*/
|
*/
|
||||||
|
@ -16,7 +15,6 @@ data class PlayerAbilitiesPacket(
|
||||||
val invulnerable: Boolean,
|
val invulnerable: Boolean,
|
||||||
val flying: Boolean,
|
val flying: Boolean,
|
||||||
val canFly: Boolean,
|
val canFly: Boolean,
|
||||||
val instantlyBreakBlocks: Boolean,
|
|
||||||
val flyingSpeed: Float,
|
val flyingSpeed: Float,
|
||||||
val fieldOfView: Float
|
val fieldOfView: Float
|
||||||
) : OutgoingPacket()
|
) : OutgoingPacket()
|
||||||
|
|
|
@ -116,8 +116,6 @@ class LoginAndJoinProcedure(val session: BlokkSession) {
|
||||||
event.invulnerable,
|
event.invulnerable,
|
||||||
event.flying,
|
event.flying,
|
||||||
event.canFly,
|
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`
|
// TODO: Find out how this relates to the entity property named `generic.flying_speed`
|
||||||
event.flyingSpeed,
|
event.flyingSpeed,
|
||||||
event.fieldOfView
|
event.fieldOfView
|
||||||
|
|
|
@ -2,6 +2,7 @@ package space.blokk.testplugin
|
||||||
|
|
||||||
import space.blokk.Blokk
|
import space.blokk.Blokk
|
||||||
import space.blokk.net.event.SessionAfterLoginEvent
|
import space.blokk.net.event.SessionAfterLoginEvent
|
||||||
|
import space.blokk.player.GameMode
|
||||||
import space.blokk.plugin.Plugin
|
import space.blokk.plugin.Plugin
|
||||||
import space.blokk.testplugin.anvil.AnvilWorld
|
import space.blokk.testplugin.anvil.AnvilWorld
|
||||||
import space.blokk.world.Dimension
|
import space.blokk.world.Dimension
|
||||||
|
@ -30,8 +31,6 @@ class TestPlugin: Plugin("Test", "1.0.0") {
|
||||||
world.getVoxel(VoxelLocation(-1, 2, -1)).block = CraftingTable()
|
world.getVoxel(VoxelLocation(-1, 2, -1)).block = CraftingTable()
|
||||||
|
|
||||||
Blokk.eventBus.on<SessionAfterLoginEvent> { event ->
|
Blokk.eventBus.on<SessionAfterLoginEvent> { event ->
|
||||||
event.canFly = true
|
|
||||||
event.flyingSpeed = 2.0f
|
|
||||||
event.initialWorldAndLocation = WorldAndLocationWithRotation(
|
event.initialWorldAndLocation = WorldAndLocationWithRotation(
|
||||||
world,
|
world,
|
||||||
VoxelLocation(0, 2, 0).atTopCenter().withRotation(0f, 0f)
|
VoxelLocation(0, 2, 0).atTopCenter().withRotation(0f, 0f)
|
||||||
|
|
Reference in a new issue