From c0d21c8b5d8dce055bc3b20322e31ebf7643be43 Mon Sep 17 00:00:00 2001 From: Moritz Ruth Date: Sat, 26 Dec 2020 23:21:35 +0100 Subject: [PATCH] Remove instantlyBreakBlocks parameter from PlayerAbilities packet because it changes nothing --- .../space/blokk/net/packet/play/PlayerAbilitiesPacketCodec.kt | 2 +- .../space/blokk/net/packet/play/PlayerAbilitiesPacket.kt | 2 -- .../src/main/kotlin/space/blokk/net/LoginAndJoinProcedure.kt | 2 -- .../src/main/kotlin/space/blokk/testplugin/TestPlugin.kt | 3 +-- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/blokk-packet-codecs/src/main/kotlin/space/blokk/net/packet/play/PlayerAbilitiesPacketCodec.kt b/blokk-packet-codecs/src/main/kotlin/space/blokk/net/packet/play/PlayerAbilitiesPacketCodec.kt index 15d4d31..68c8fd5 100644 --- a/blokk-packet-codecs/src/main/kotlin/space/blokk/net/packet/play/PlayerAbilitiesPacketCodec.kt +++ b/blokk-packet-codecs/src/main/kotlin/space/blokk/net/packet/play/PlayerAbilitiesPacketCodec.kt @@ -7,7 +7,7 @@ import space.blokk.util.setBit object PlayerAbilitiesPacketCodec : OutgoingPacketCodec(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) } diff --git a/blokk-packets/src/main/kotlin/space/blokk/net/packet/play/PlayerAbilitiesPacket.kt b/blokk-packets/src/main/kotlin/space/blokk/net/packet/play/PlayerAbilitiesPacket.kt index a12346e..c28726f 100644 --- a/blokk-packets/src/main/kotlin/space/blokk/net/packet/play/PlayerAbilitiesPacket.kt +++ b/blokk-packets/src/main/kotlin/space/blokk/net/packet/play/PlayerAbilitiesPacket.kt @@ -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() diff --git a/blokk-server/src/main/kotlin/space/blokk/net/LoginAndJoinProcedure.kt b/blokk-server/src/main/kotlin/space/blokk/net/LoginAndJoinProcedure.kt index 98b0e52..ef1904c 100644 --- a/blokk-server/src/main/kotlin/space/blokk/net/LoginAndJoinProcedure.kt +++ b/blokk-server/src/main/kotlin/space/blokk/net/LoginAndJoinProcedure.kt @@ -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 diff --git a/test-plugin/src/main/kotlin/space/blokk/testplugin/TestPlugin.kt b/test-plugin/src/main/kotlin/space/blokk/testplugin/TestPlugin.kt index 3f144f6..dabe668 100644 --- a/test-plugin/src/main/kotlin/space/blokk/testplugin/TestPlugin.kt +++ b/test-plugin/src/main/kotlin/space/blokk/testplugin/TestPlugin.kt @@ -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 { event -> - event.canFly = true - event.flyingSpeed = 2.0f event.initialWorldAndLocation = WorldAndLocationWithRotation( world, VoxelLocation(0, 2, 0).atTopCenter().withRotation(0f, 0f)