From e0a9b18e3a07ba7c4ece4a86b4b29292fdb20003 Mon Sep 17 00:00:00 2001 From: Alemiz Date: Tue, 10 Sep 2024 16:18:34 +0200 Subject: [PATCH] Allow packets to be cloned --- .../bedrock/packet/AddBehaviorTreePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/AddEntityPacket.java | 10 ++++++++++ .../bedrock/packet/AddHangingEntityPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/AddItemEntityPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/AddPaintingPacket.java | 5 +++++ .../protocol/bedrock/packet/AddPlayerPacket.java | 10 ++++++++++ .../bedrock/packet/AddVolumeEntityPacket.java | 10 ++++++++++ .../bedrock/packet/AdventureSettingsPacket.java | 10 ++++++++++ .../bedrock/packet/AgentActionEventPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/AgentAnimationPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/AnimateEntityPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/AnimatePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/AnvilDamagePacket.java | 10 ++++++++++ .../bedrock/packet/AutomationClientConnectPacket.java | 10 ++++++++++ .../bedrock/packet/AvailableCommandsPacket.java | 10 ++++++++++ .../packet/AvailableEntityIdentifiersPacket.java | 10 ++++++++++ .../bedrock/packet/AwardAchievementPacket.java | 11 ++++++++++- .../protocol/bedrock/packet/BedrockPacket.java | 9 ++++++++- .../bedrock/packet/BiomeDefinitionListPacket.java | 10 ++++++++++ .../bedrock/packet/BlockEntityDataPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/BlockEventPacket.java | 10 ++++++++++ .../bedrock/packet/BlockPickRequestPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/BookEditPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/BossEventPacket.java | 10 ++++++++++ .../bedrock/packet/CameraInstructionPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/CameraPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/CameraPresetsPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/CameraShakePacket.java | 10 ++++++++++ .../bedrock/packet/ChangeDimensionPacket.java | 10 ++++++++++ .../bedrock/packet/ChangeMobPropertyPacket.java | 10 ++++++++++ .../bedrock/packet/ChunkRadiusUpdatedPacket.java | 10 ++++++++++ .../bedrock/packet/ClientCacheBlobStatusPacket.java | 10 ++++++++++ .../bedrock/packet/ClientCacheMissResponsePacket.java | 6 ++++++ .../bedrock/packet/ClientCacheStatusPacket.java | 10 ++++++++++ .../bedrock/packet/ClientCheatAbilityPacket.java | 10 ++++++++++ .../bedrock/packet/ClientToServerHandshakePacket.java | 10 ++++++++++ .../bedrock/packet/ClientboundCloseFormPacket.java | 11 ++++++++++- .../packet/ClientboundDebugRendererPacket.java | 10 ++++++++++ .../bedrock/packet/ClientboundMapItemDataPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/CodeBuilderPacket.java | 10 ++++++++++ .../bedrock/packet/CodeBuilderSourcePacket.java | 10 ++++++++++ .../bedrock/packet/CommandBlockUpdatePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/CommandOutputPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/CommandRequestPacket.java | 10 ++++++++++ .../bedrock/packet/CompletedUsingItemPacket.java | 10 ++++++++++ .../packet/CompressedBiomeDefinitionListPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ContainerClosePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ContainerOpenPacket.java | 10 ++++++++++ .../bedrock/packet/ContainerSetDataPacket.java | 10 ++++++++++ .../packet/CorrectPlayerMovePredictionPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/CraftingDataPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/CraftingEventPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/CreatePhotoPacket.java | 10 ++++++++++ .../bedrock/packet/CreativeContentPacket.java | 10 ++++++++++ .../bedrock/packet/CurrentStructureFeaturePacket.java | 11 ++++++++++- .../protocol/bedrock/packet/DeathInfoPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/DebugInfoPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/DimensionDataPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/DisconnectPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/EditorNetworkPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/EduUriResourcePacket.java | 10 ++++++++++ .../bedrock/packet/EducationSettingsPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/EmoteListPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/EmotePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/EntityEventPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/EntityFallPacket.java | 10 ++++++++++ .../bedrock/packet/EntityPickRequestPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/EventPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ExplodePacket.java | 10 ++++++++++ .../bedrock/packet/FeatureRegistryPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/FilterTextPacket.java | 10 ++++++++++ .../bedrock/packet/GameRulesChangedPacket.java | 10 ++++++++++ .../bedrock/packet/GameTestRequestPacket.java | 11 ++++++++++- .../bedrock/packet/GameTestResultsPacket.java | 11 ++++++++++- .../bedrock/packet/GuiDataPickItemPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/HurtArmorPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/InteractPacket.java | 10 ++++++++++ .../bedrock/packet/InventoryContentPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/InventorySlotPacket.java | 10 ++++++++++ .../bedrock/packet/InventoryTransactionPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ItemComponentPacket.java | 10 ++++++++++ .../bedrock/packet/ItemFrameDropItemPacket.java | 10 ++++++++++ .../bedrock/packet/ItemStackRequestPacket.java | 10 ++++++++++ .../bedrock/packet/ItemStackResponsePacket.java | 10 ++++++++++ .../bedrock/packet/JigsawStructureDataPacket.java | 11 ++++++++++- .../protocol/bedrock/packet/LabTablePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/LecternUpdatePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/LessonProgressPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/LevelChunkPacket.java | 6 ++++++ .../bedrock/packet/LevelEventGenericPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/LevelEventPacket.java | 10 ++++++++++ .../bedrock/packet/LevelSoundEvent1Packet.java | 10 ++++++++++ .../bedrock/packet/LevelSoundEvent2Packet.java | 10 ++++++++++ .../bedrock/packet/LevelSoundEventPacket.java | 5 +++++ .../protocol/bedrock/packet/LoginPacket.java | 10 ++++++++++ .../bedrock/packet/MapCreateLockedCopyPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/MapInfoRequestPacket.java | 10 ++++++++++ .../bedrock/packet/MobArmorEquipmentPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/MobEffectPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/MobEquipmentPacket.java | 10 ++++++++++ .../bedrock/packet/ModalFormRequestPacket.java | 10 ++++++++++ .../bedrock/packet/ModalFormResponsePacket.java | 10 ++++++++++ .../bedrock/packet/MotionPredictionHintsPacket.java | 10 ++++++++++ .../bedrock/packet/MoveEntityAbsolutePacket.java | 10 ++++++++++ .../bedrock/packet/MoveEntityDeltaPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/MovePlayerPacket.java | 10 ++++++++++ .../bedrock/packet/MultiplayerSettingsPacket.java | 10 ++++++++++ .../packet/NetworkChunkPublisherUpdatePacket.java | 10 ++++++++++ .../bedrock/packet/NetworkSettingsPacket.java | 10 ++++++++++ .../bedrock/packet/NetworkStackLatencyPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/NpcDialoguePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/NpcRequestPacket.java | 10 ++++++++++ .../packet/OnScreenTextureAnimationPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/OpenSignPacket.java | 10 ++++++++++ .../bedrock/packet/PacketViolationWarningPacket.java | 10 ++++++++++ .../bedrock/packet/PhotoInfoRequestPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/PhotoTransferPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/PlaySoundPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/PlayStatusPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/PlayerActionPacket.java | 10 ++++++++++ .../bedrock/packet/PlayerArmorDamagePacket.java | 10 ++++++++++ .../bedrock/packet/PlayerAuthInputPacket.java | 10 ++++++++++ .../bedrock/packet/PlayerEnchantOptionsPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/PlayerFogPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/PlayerHotbarPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/PlayerInputPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/PlayerListPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/PlayerSkinPacket.java | 10 ++++++++++ .../bedrock/packet/PlayerStartItemCooldownPacket.java | 10 ++++++++++ .../packet/PositionTrackingDBClientRequestPacket.java | 10 ++++++++++ .../PositionTrackingDBServerBroadcastPacket.java | 10 ++++++++++ .../bedrock/packet/PurchaseReceiptPacket.java | 10 ++++++++++ .../bedrock/packet/RefreshEntitlementsPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/RemoveEntityPacket.java | 10 ++++++++++ .../bedrock/packet/RemoveObjectivePacket.java | 10 ++++++++++ .../bedrock/packet/RemoveVolumeEntityPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/RequestAbilityPacket.java | 10 ++++++++++ .../bedrock/packet/RequestChunkRadiusPacket.java | 10 ++++++++++ .../bedrock/packet/RequestNetworkSettingsPacket.java | 11 ++++++++++- .../bedrock/packet/RequestPermissionsPacket.java | 10 ++++++++++ .../bedrock/packet/ResourcePackChunkDataPacket.java | 6 ++++++ .../packet/ResourcePackChunkRequestPacket.java | 10 ++++++++++ .../packet/ResourcePackClientResponsePacket.java | 10 ++++++++++ .../bedrock/packet/ResourcePackDataInfoPacket.java | 10 ++++++++++ .../bedrock/packet/ResourcePackStackPacket.java | 10 ++++++++++ .../bedrock/packet/ResourcePacksInfoPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/RespawnPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/RiderJumpPacket.java | 10 ++++++++++ .../bedrock/packet/ScriptCustomEventPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ScriptMessagePacket.java | 10 ++++++++++ .../bedrock/packet/ServerSettingsRequestPacket.java | 10 ++++++++++ .../bedrock/packet/ServerSettingsResponsePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ServerStatsPacket.java | 11 ++++++++++- .../bedrock/packet/ServerToClientHandshakePacket.java | 10 ++++++++++ .../bedrock/packet/ServerboundDiagnosticsPacket.java | 11 ++++++++++- .../packet/ServerboundLoadingScreenPacket.java | 11 ++++++++++- .../bedrock/packet/SetCommandsEnabledPacket.java | 10 ++++++++++ .../bedrock/packet/SetDefaultGameTypePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SetDifficultyPacket.java | 10 ++++++++++ .../bedrock/packet/SetDisplayObjectivePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SetEntityDataPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SetEntityLinkPacket.java | 10 ++++++++++ .../bedrock/packet/SetEntityMotionPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SetHealthPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SetHudPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SetLastHurtByPacket.java | 10 ++++++++++ .../packet/SetLocalPlayerAsInitializedPacket.java | 10 ++++++++++ .../bedrock/packet/SetPlayerGameTypePacket.java | 10 ++++++++++ .../packet/SetPlayerInventoryOptionsPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SetScorePacket.java | 10 ++++++++++ .../bedrock/packet/SetScoreboardIdentityPacket.java | 10 ++++++++++ .../bedrock/packet/SetSpawnPositionPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SetTimePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SetTitlePacket.java | 10 ++++++++++ .../bedrock/packet/SettingsCommandPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ShowCreditsPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ShowProfilePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ShowStoreOfferPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SimpleEventPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SimulationTypePacket.java | 11 ++++++++++- .../bedrock/packet/SpawnExperienceOrbPacket.java | 10 ++++++++++ .../bedrock/packet/SpawnParticleEffectPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/StartGamePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/StopSoundPacket.java | 10 ++++++++++ .../bedrock/packet/StructureBlockUpdatePacket.java | 10 ++++++++++ .../packet/StructureTemplateDataRequestPacket.java | 10 ++++++++++ .../packet/StructureTemplateDataResponsePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SubChunkPacket.java | 6 ++++++ .../bedrock/packet/SubChunkRequestPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/SubClientLoginPacket.java | 10 ++++++++++ .../bedrock/packet/SyncEntityPropertyPacket.java | 11 ++++++++++- .../protocol/bedrock/packet/TakeItemEntityPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/TextPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/TickSyncPacket.java | 10 ++++++++++ .../bedrock/packet/TickingAreasLoadStatusPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/ToastRequestPacket.java | 10 ++++++++++ .../packet/ToggleCrafterSlotRequestPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/TransferPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/TrimDataPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/UnknownPacket.java | 6 ++++++ .../bedrock/packet/UnlockedRecipesPacket.java | 10 ++++++++++ .../bedrock/packet/UpdateAbilitiesPacket.java | 10 ++++++++++ .../bedrock/packet/UpdateAdventureSettingsPacket.java | 10 ++++++++++ .../bedrock/packet/UpdateAttributesPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/UpdateBlockPacket.java | 10 ++++++++++ .../bedrock/packet/UpdateBlockPropertiesPacket.java | 10 ++++++++++ .../bedrock/packet/UpdateBlockSyncedPacket.java | 5 +++++ .../bedrock/packet/UpdateClientInputLocksPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/UpdateEquipPacket.java | 10 ++++++++++ .../bedrock/packet/UpdatePlayerGameTypePacket.java | 10 ++++++++++ .../protocol/bedrock/packet/UpdateSoftEnumPacket.java | 10 ++++++++++ .../bedrock/packet/UpdateSubChunkBlocksPacket.java | 10 ++++++++++ .../protocol/bedrock/packet/UpdateTradePacket.java | 10 ++++++++++ .../bedrock/packet/VideoStreamConnectPacket.java | 10 ++++++++++ 214 files changed, 2103 insertions(+), 13 deletions(-) diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddBehaviorTreePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddBehaviorTreePacket.java index 034c154e8..2a11aee60 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddBehaviorTreePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddBehaviorTreePacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ADD_BEHAVIOR_TREE; } + + @Override + public AddBehaviorTreePacket clone() { + try { + return (AddBehaviorTreePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddEntityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddEntityPacket.java index f293dfef5..83d2a43b8 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddEntityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddEntityPacket.java @@ -49,4 +49,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ADD_ENTITY; } + + @Override + public AddEntityPacket clone() { + try { + return (AddEntityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddHangingEntityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddHangingEntityPacket.java index e2402afd0..be168ac15 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddHangingEntityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddHangingEntityPacket.java @@ -23,4 +23,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ADD_HANGING_ENTITY; } + + @Override + public AddHangingEntityPacket clone() { + try { + return (AddHangingEntityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddItemEntityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddItemEntityPacket.java index 21d3999dd..37b908144 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddItemEntityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddItemEntityPacket.java @@ -28,4 +28,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ADD_ITEM_ENTITY; } + + @Override + public AddItemEntityPacket clone() { + try { + return (AddItemEntityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddPaintingPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddPaintingPacket.java index 98a788709..22b4821cf 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddPaintingPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddPaintingPacket.java @@ -19,4 +19,9 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ADD_PAINTING; } + + @Override + public AddPaintingPacket clone() { + return (AddPaintingPacket) super.clone(); + } } diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddPlayerPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddPlayerPacket.java index 94be7c6a2..f2cde8c6e 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddPlayerPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddPlayerPacket.java @@ -81,4 +81,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ADD_PLAYER; } + + @Override + public AddPlayerPacket clone() { + try { + return (AddPlayerPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddVolumeEntityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddVolumeEntityPacket.java index 2195f3007..48796782e 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddVolumeEntityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AddVolumeEntityPacket.java @@ -46,4 +46,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ADD_VOLUME_ENTITY; } + + @Override + public AddVolumeEntityPacket clone() { + try { + return (AddVolumeEntityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AdventureSettingsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AdventureSettingsPacket.java index 1285767a9..2bf340f33 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AdventureSettingsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AdventureSettingsPacket.java @@ -32,4 +32,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ADVENTURE_SETTINGS; } + + @Override + public AdventureSettingsPacket clone() { + try { + return (AdventureSettingsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AgentActionEventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AgentActionEventPacket.java index 14b62d030..48fb0176c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AgentActionEventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AgentActionEventPacket.java @@ -29,4 +29,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.AGENT_ACTION_EVENT; } + + @Override + public AgentActionEventPacket clone() { + try { + return (AgentActionEventPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AgentAnimationPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AgentAnimationPacket.java index f43394837..b15a8f030 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AgentAnimationPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AgentAnimationPacket.java @@ -20,4 +20,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.AGENT_ANIMATION; } + + @Override + public AgentAnimationPacket clone() { + try { + return (AgentAnimationPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnimateEntityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnimateEntityPacket.java index 13c97cc74..0c19bd912 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnimateEntityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnimateEntityPacket.java @@ -83,4 +83,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ANIMATE_ENTITY; } + + @Override + public AnimateEntityPacket clone() { + try { + return (AnimateEntityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnimatePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnimatePacket.java index 70fc62ffa..d3b75eb08 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnimatePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnimatePacket.java @@ -31,4 +31,14 @@ public enum Action { ROW_RIGHT, ROW_LEFT, } + + @Override + public AnimatePacket clone() { + try { + return (AnimatePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnvilDamagePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnvilDamagePacket.java index 0e0b300df..93255464b 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnvilDamagePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AnvilDamagePacket.java @@ -21,4 +21,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ANVIL_DAMAGE; } + + @Override + public AnvilDamagePacket clone() { + try { + return (AnvilDamagePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AutomationClientConnectPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AutomationClientConnectPacket.java index 618c18034..d06a77031 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AutomationClientConnectPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AutomationClientConnectPacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.AUTOMATION_CLIENT_CONNECT; } + + @Override + public AutomationClientConnectPacket clone() { + try { + return (AutomationClientConnectPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AvailableCommandsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AvailableCommandsPacket.java index fd33bbf5e..1f1e00ecb 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AvailableCommandsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AvailableCommandsPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.AVAILABLE_COMMANDS; } + + @Override + public AvailableCommandsPacket clone() { + try { + return (AvailableCommandsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AvailableEntityIdentifiersPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AvailableEntityIdentifiersPacket.java index a404ebf31..49d50bf5d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AvailableEntityIdentifiersPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AvailableEntityIdentifiersPacket.java @@ -20,4 +20,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.AVAILABLE_ENTITY_IDENTIFIERS; } + + @Override + public AvailableEntityIdentifiersPacket clone() { + try { + return (AvailableEntityIdentifiersPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AwardAchievementPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AwardAchievementPacket.java index a542b9197..376f63d65 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AwardAchievementPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/AwardAchievementPacket.java @@ -20,4 +20,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.AWARD_ACHIEVEMENT; } -} \ No newline at end of file + + @Override + public AwardAchievementPacket clone() { + try { + return (AwardAchievementPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BedrockPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BedrockPacket.java index 917032426..712aa2947 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BedrockPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BedrockPacket.java @@ -3,9 +3,16 @@ import org.cloudburstmc.protocol.common.MinecraftPacket; import org.cloudburstmc.protocol.common.PacketSignal; -public interface BedrockPacket extends MinecraftPacket { +public interface BedrockPacket extends MinecraftPacket, Cloneable { PacketSignal handle(BedrockPacketHandler handler); BedrockPacketType getPacketType(); + + /** + * Creates a new instance of this packet using Object.clone() + * Will throw a {@link UnsupportedOperationException} if the packet implements {@link io.netty.util.ReferenceCounted} + * @return a new instance of this packet + */ + BedrockPacket clone(); } \ No newline at end of file diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BiomeDefinitionListPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BiomeDefinitionListPacket.java index dd195a706..5423f50d3 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BiomeDefinitionListPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BiomeDefinitionListPacket.java @@ -20,4 +20,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.BIOME_DEFINITIONS_LIST; } + + @Override + public BiomeDefinitionListPacket clone() { + try { + return (BiomeDefinitionListPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockEntityDataPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockEntityDataPacket.java index 214858055..b209402f8 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockEntityDataPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockEntityDataPacket.java @@ -22,4 +22,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.BLOCK_ENTITY_DATA; } + + @Override + public BlockEntityDataPacket clone() { + try { + return (BlockEntityDataPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockEventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockEventPacket.java index 8c344019c..27ea39d51 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockEventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockEventPacket.java @@ -74,4 +74,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.BLOCK_EVENT; } + + @Override + public BlockEventPacket clone() { + try { + return (BlockEventPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockPickRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockPickRequestPacket.java index 065fff2b6..3e9ef71e2 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockPickRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BlockPickRequestPacket.java @@ -22,4 +22,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.BLOCK_PICK_REQUEST; } + + @Override + public BlockPickRequestPacket clone() { + try { + return (BlockPickRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BookEditPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BookEditPacket.java index 5cc6f7895..05465f64c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BookEditPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BookEditPacket.java @@ -35,4 +35,14 @@ public enum Action { SWAP_PAGES, SIGN_BOOK } + + @Override + public BookEditPacket clone() { + try { + return (BookEditPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BossEventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BossEventPacket.java index ad27fd7ad..277e33a8d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BossEventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/BossEventPacket.java @@ -62,4 +62,14 @@ public enum Action { UPDATE_STYLE, QUERY } + + @Override + public BossEventPacket clone() { + try { + return (BossEventPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraInstructionPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraInstructionPacket.java index e139b761e..e7aa01385 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraInstructionPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraInstructionPacket.java @@ -43,4 +43,14 @@ public void setClear(boolean value) { public void setClear(OptionalBoolean clear) { this.clear = clear; } + + @Override + public CameraInstructionPacket clone() { + try { + return (CameraInstructionPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraPacket.java index 9359bc181..40c6aee2e 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraPacket.java @@ -20,4 +20,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CAMERA; } + + @Override + public CameraPacket clone() { + try { + return (CameraPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraPresetsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraPresetsPacket.java index f45d88a96..7565e85a2 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraPresetsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraPresetsPacket.java @@ -25,4 +25,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CAMERA_PRESETS; } + + @Override + public CameraPresetsPacket clone() { + try { + return (CameraPresetsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraShakePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraShakePacket.java index a66c14c6b..f1cbe9209 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraShakePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CameraShakePacket.java @@ -49,4 +49,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CAMERA_SHAKE; } + + @Override + public CameraShakePacket clone() { + try { + return (CameraShakePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChangeDimensionPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChangeDimensionPacket.java index f642587f1..efb86b30d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChangeDimensionPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChangeDimensionPacket.java @@ -27,4 +27,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CHANGE_DIMENSION; } + + @Override + public ChangeDimensionPacket clone() { + try { + return (ChangeDimensionPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChangeMobPropertyPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChangeMobPropertyPacket.java index 4de2af3c7..a039f61e9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChangeMobPropertyPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChangeMobPropertyPacket.java @@ -30,4 +30,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CHANGE_MOB_PROPERTY; } + + @Override + public ChangeMobPropertyPacket clone() { + try { + return (ChangeMobPropertyPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChunkRadiusUpdatedPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChunkRadiusUpdatedPacket.java index 20c2a0634..becf39048 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChunkRadiusUpdatedPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ChunkRadiusUpdatedPacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CHUNK_RADIUS_UPDATED; } + + @Override + public ChunkRadiusUpdatedPacket clone() { + try { + return (ChunkRadiusUpdatedPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheBlobStatusPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheBlobStatusPacket.java index ec069273b..0f666d66e 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheBlobStatusPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheBlobStatusPacket.java @@ -22,4 +22,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CLIENT_CACHE_BLOB_STATUS; } + + @Override + public ClientCacheBlobStatusPacket clone() { + try { + return (ClientCacheBlobStatusPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheMissResponsePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheMissResponsePacket.java index 11e1b5aa7..36af0e903 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheMissResponsePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheMissResponsePacket.java @@ -35,4 +35,10 @@ public ClientCacheMissResponsePacket touch(Object hint) { this.blobs.values().forEach(byteBuf -> byteBuf.touch(hint)); return this; } + + @Override + public ClientCacheMissResponsePacket clone() { + throw new UnsupportedOperationException("Can not clone reference counted packet"); + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheStatusPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheStatusPacket.java index 5649cb0a9..eb881382b 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheStatusPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCacheStatusPacket.java @@ -19,4 +19,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CLIENT_CACHE_STATUS; } + + @Override + public ClientCacheStatusPacket clone() { + try { + return (ClientCacheStatusPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCheatAbilityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCheatAbilityPacket.java index eccb79333..58dbe0923 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCheatAbilityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientCheatAbilityPacket.java @@ -39,4 +39,14 @@ public BedrockPacketType getPacketType() { public PacketSignal handle(BedrockPacketHandler handler) { return handler.handle(this); } + + @Override + public ClientCheatAbilityPacket clone() { + try { + return (ClientCheatAbilityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientToServerHandshakePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientToServerHandshakePacket.java index 862c56a39..2f066f674 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientToServerHandshakePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientToServerHandshakePacket.java @@ -18,4 +18,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CLIENT_TO_SERVER_HANDSHAKE; } + + @Override + public ClientToServerHandshakePacket clone() { + try { + return (ClientToServerHandshakePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundCloseFormPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundCloseFormPacket.java index 058dbcf6e..5223ad571 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundCloseFormPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundCloseFormPacket.java @@ -19,4 +19,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CLIENTBOUND_CLOSE_FORM; } -} \ No newline at end of file + + @Override + public ClientboundCloseFormPacket clone() { + try { + return (ClientboundCloseFormPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundDebugRendererPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundDebugRendererPacket.java index 2a3e8f98b..c508135a7 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundDebugRendererPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundDebugRendererPacket.java @@ -53,4 +53,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CLIENTBOUND_DEBUG_RENDERER; } + + @Override + public ClientboundDebugRendererPacket clone() { + try { + return (ClientboundDebugRendererPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundMapItemDataPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundMapItemDataPacket.java index ba4c1b31e..db0a33a1c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundMapItemDataPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ClientboundMapItemDataPacket.java @@ -44,4 +44,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CLIENTBOUND_MAP_ITEM_DATA; } + + @Override + public ClientboundMapItemDataPacket clone() { + try { + return (ClientboundMapItemDataPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CodeBuilderPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CodeBuilderPacket.java index b77a7af93..4a298eb19 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CodeBuilderPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CodeBuilderPacket.java @@ -21,4 +21,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CODE_BUILDER; } + + @Override + public CodeBuilderPacket clone() { + try { + return (CodeBuilderPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CodeBuilderSourcePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CodeBuilderSourcePacket.java index 26316183c..ff4218a3d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CodeBuilderSourcePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CodeBuilderSourcePacket.java @@ -33,4 +33,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CODE_BUILDER_SOURCE; } + + @Override + public CodeBuilderSourcePacket clone() { + try { + return (CodeBuilderSourcePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandBlockUpdatePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandBlockUpdatePacket.java index bdcb8b7f3..a78cbdbf4 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandBlockUpdatePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandBlockUpdatePacket.java @@ -32,4 +32,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.COMMAND_BLOCK_UPDATE; } + + @Override + public CommandBlockUpdatePacket clone() { + try { + return (CommandBlockUpdatePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandOutputPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandOutputPacket.java index 1bee22b55..69227cfdb 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandOutputPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandOutputPacket.java @@ -30,4 +30,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.COMMAND_OUTPUT; } + + @Override + public CommandOutputPacket clone() { + try { + return (CommandOutputPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandRequestPacket.java index aab45a673..ccea9dbc3 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CommandRequestPacket.java @@ -26,4 +26,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.COMMAND_REQUEST; } + + @Override + public CommandRequestPacket clone() { + try { + return (CommandRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CompletedUsingItemPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CompletedUsingItemPacket.java index 594f6c39c..cbbc33a30 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CompletedUsingItemPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CompletedUsingItemPacket.java @@ -21,4 +21,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.COMPLETED_USING_ITEM; } + + @Override + public CompletedUsingItemPacket clone() { + try { + return (CompletedUsingItemPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CompressedBiomeDefinitionListPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CompressedBiomeDefinitionListPacket.java index fc4bb0f7c..fe6a8d77c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CompressedBiomeDefinitionListPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CompressedBiomeDefinitionListPacket.java @@ -20,4 +20,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.COMPRESSED_BIOME_DEFINITIONS_LIST; } + + @Override + public CompressedBiomeDefinitionListPacket clone() { + try { + return (CompressedBiomeDefinitionListPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerClosePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerClosePacket.java index 0f7d236e4..4839f3be8 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerClosePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerClosePacket.java @@ -25,4 +25,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CONTAINER_CLOSE; } + + @Override + public ContainerClosePacket clone() { + try { + return (ContainerClosePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerOpenPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerOpenPacket.java index 5a15e59e0..557e7d586 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerOpenPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerOpenPacket.java @@ -24,4 +24,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CONTAINER_OPEN; } + + @Override + public ContainerOpenPacket clone() { + try { + return (ContainerOpenPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerSetDataPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerSetDataPacket.java index c93adff00..584e2df4a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerSetDataPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ContainerSetDataPacket.java @@ -32,4 +32,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CONTAINER_SET_DATA; } + + @Override + public ContainerSetDataPacket clone() { + try { + return (ContainerSetDataPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CorrectPlayerMovePredictionPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CorrectPlayerMovePredictionPacket.java index 9736e8dc8..3b27790aa 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CorrectPlayerMovePredictionPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CorrectPlayerMovePredictionPacket.java @@ -71,4 +71,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CORRECT_PLAYER_MOVE_PREDICTION; } + + @Override + public CorrectPlayerMovePredictionPacket clone() { + try { + return (CorrectPlayerMovePredictionPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CraftingDataPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CraftingDataPacket.java index 39e4141cc..42831ff53 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CraftingDataPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CraftingDataPacket.java @@ -33,4 +33,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CRAFTING_DATA; } + + @Override + public CraftingDataPacket clone() { + try { + return (CraftingDataPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CraftingEventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CraftingEventPacket.java index 353516e0f..635c98597 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CraftingEventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CraftingEventPacket.java @@ -33,4 +33,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CRAFTING_EVENT; } + + @Override + public CraftingEventPacket clone() { + try { + return (CraftingEventPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CreatePhotoPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CreatePhotoPacket.java index 644115df2..0d85d2ecf 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CreatePhotoPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CreatePhotoPacket.java @@ -22,4 +22,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CREATE_PHOTO; } + + @Override + public CreatePhotoPacket clone() { + try { + return (CreatePhotoPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CreativeContentPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CreativeContentPacket.java index daa43b5e9..ed7dc7592 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CreativeContentPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CreativeContentPacket.java @@ -32,4 +32,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CREATIVE_CONTENT; } + + @Override + public CreativeContentPacket clone() { + try { + return (CreativeContentPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CurrentStructureFeaturePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CurrentStructureFeaturePacket.java index 242aa6a4a..939447153 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CurrentStructureFeaturePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/CurrentStructureFeaturePacket.java @@ -20,4 +20,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.CURRENT_STRUCTURE_FEATURE; } -} \ No newline at end of file + + @Override + public CurrentStructureFeaturePacket clone() { + try { + return (CurrentStructureFeaturePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DeathInfoPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DeathInfoPacket.java index f02fad14e..f70ae081f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DeathInfoPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DeathInfoPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.DEATH_INFO; } + + @Override + public DeathInfoPacket clone() { + try { + return (DeathInfoPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DebugInfoPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DebugInfoPacket.java index 06572c932..b89649ad3 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DebugInfoPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DebugInfoPacket.java @@ -21,4 +21,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.DEBUG_INFO; } + + @Override + public DebugInfoPacket clone() { + try { + return (DebugInfoPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DimensionDataPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DimensionDataPacket.java index f813cad11..77ee9e51e 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DimensionDataPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DimensionDataPacket.java @@ -32,4 +32,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.DIMENSION_DATA; } + + @Override + public DimensionDataPacket clone() { + try { + return (DimensionDataPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DisconnectPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DisconnectPacket.java index 5bd623073..c9f56d1ef 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DisconnectPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/DisconnectPacket.java @@ -26,4 +26,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.DISCONNECT; } + + @Override + public DisconnectPacket clone() { + try { + return (DisconnectPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EditorNetworkPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EditorNetworkPacket.java index b6d513fc6..8f7071601 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EditorNetworkPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EditorNetworkPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.EDITOR_NETWORK; } + + @Override + public EditorNetworkPacket clone() { + try { + return (EditorNetworkPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EduUriResourcePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EduUriResourcePacket.java index 2557af8c5..8349612bc 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EduUriResourcePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EduUriResourcePacket.java @@ -21,4 +21,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.EDU_URI_RESOURCE; } + + @Override + public EduUriResourcePacket clone() { + try { + return (EduUriResourcePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EducationSettingsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EducationSettingsPacket.java index a12879c87..2728010c8 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EducationSettingsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EducationSettingsPacket.java @@ -41,4 +41,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.EDUCATION_SETTINGS; } + + @Override + public EducationSettingsPacket clone() { + try { + return (EducationSettingsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EmoteListPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EmoteListPacket.java index 1646966bf..f48933449 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EmoteListPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EmoteListPacket.java @@ -25,4 +25,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.EMOTE_LIST; } + + @Override + public EmoteListPacket clone() { + try { + return (EmoteListPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EmotePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EmotePacket.java index aa207ac68..74e8a5c3e 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EmotePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EmotePacket.java @@ -33,4 +33,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.EMOTE; } + + @Override + public EmotePacket clone() { + try { + return (EmotePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityEventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityEventPacket.java index 4a5c7abfc..9059ac4f1 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityEventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityEventPacket.java @@ -22,4 +22,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ENTITY_EVENT; } + + @Override + public EntityEventPacket clone() { + try { + return (EntityEventPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityFallPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityFallPacket.java index d8b9d6809..411820920 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityFallPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityFallPacket.java @@ -21,4 +21,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ENTITY_FALL; } + + @Override + public EntityFallPacket clone() { + try { + return (EntityFallPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityPickRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityPickRequestPacket.java index 29c64159f..0cc5c67fe 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityPickRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EntityPickRequestPacket.java @@ -24,4 +24,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ENTITY_PICK_REQUEST; } + + @Override + public EntityPickRequestPacket clone() { + try { + return (EntityPickRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EventPacket.java index d3a4825d9..c1dd6d4b9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/EventPacket.java @@ -47,4 +47,14 @@ public enum Event { COMPOSTER_BLOCK_USED, BELL_BLOCK_USED } + + @Override + public EventPacket clone() { + try { + return (EventPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ExplodePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ExplodePacket.java index 5774e15bc..74304b5d3 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ExplodePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ExplodePacket.java @@ -26,4 +26,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.EXPLODE; } + + @Override + public ExplodePacket clone() { + try { + return (ExplodePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/FeatureRegistryPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/FeatureRegistryPacket.java index 9890842f0..dad8fcd83 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/FeatureRegistryPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/FeatureRegistryPacket.java @@ -29,4 +29,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.FEATURE_REGISTRY; } + + @Override + public FeatureRegistryPacket clone() { + try { + return (FeatureRegistryPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/FilterTextPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/FilterTextPacket.java index be8660960..3a88af6fb 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/FilterTextPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/FilterTextPacket.java @@ -20,4 +20,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.FILTER_TEXT; } + + @Override + public FilterTextPacket clone() { + try { + return (FilterTextPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameRulesChangedPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameRulesChangedPacket.java index 67019f634..17867df88 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameRulesChangedPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameRulesChangedPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.GAME_RULES_CHANGED; } + + @Override + public GameRulesChangedPacket clone() { + try { + return (GameRulesChangedPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameTestRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameTestRequestPacket.java index 22621cc91..54b189808 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameTestRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameTestRequestPacket.java @@ -27,4 +27,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.GAME_TEST_REQUEST; } -} \ No newline at end of file + + @Override + public GameTestRequestPacket clone() { + try { + return (GameTestRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameTestResultsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameTestResultsPacket.java index e9ecd7e2a..56f2806b5 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameTestResultsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GameTestResultsPacket.java @@ -22,4 +22,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.GAME_TEST_RESULTS; } -} \ No newline at end of file + + @Override + public GameTestResultsPacket clone() { + try { + return (GameTestResultsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GuiDataPickItemPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GuiDataPickItemPacket.java index ab56225fd..3ef0150ec 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GuiDataPickItemPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/GuiDataPickItemPacket.java @@ -21,4 +21,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.GUI_DATA_PICK_ITEM; } + + @Override + public GuiDataPickItemPacket clone() { + try { + return (GuiDataPickItemPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/HurtArmorPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/HurtArmorPacket.java index 000aeb3df..f89bc3c2b 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/HurtArmorPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/HurtArmorPacket.java @@ -24,4 +24,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.HURT_ARMOR; } + + @Override + public HurtArmorPacket clone() { + try { + return (HurtArmorPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InteractPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InteractPacket.java index 674702a4a..99f3ceb8c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InteractPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InteractPacket.java @@ -32,4 +32,14 @@ public enum Action { NPC_OPEN, OPEN_INVENTORY } + + @Override + public InteractPacket clone() { + try { + return (InteractPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryContentPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryContentPacket.java index 64b41e478..2d24b4759 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryContentPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryContentPacket.java @@ -28,4 +28,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.INVENTORY_CONTENT; } + + @Override + public InventoryContentPacket clone() { + try { + return (InventoryContentPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventorySlotPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventorySlotPacket.java index 914904e70..d201e5cba 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventorySlotPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventorySlotPacket.java @@ -26,4 +26,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.INVENTORY_SLOT; } + + @Override + public InventorySlotPacket clone() { + try { + return (InventorySlotPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryTransactionPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryTransactionPacket.java index 7b35139a9..72470c733 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryTransactionPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryTransactionPacket.java @@ -65,4 +65,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.INVENTORY_TRANSACTION; } + + @Override + public InventoryTransactionPacket clone() { + try { + return (InventoryTransactionPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemComponentPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemComponentPacket.java index 2d1b06f26..5829ebf15 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemComponentPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemComponentPacket.java @@ -29,4 +29,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ITEM_COMPONENT; } + + @Override + public ItemComponentPacket clone() { + try { + return (ItemComponentPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemFrameDropItemPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemFrameDropItemPacket.java index a6548d24b..77cebdc6f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemFrameDropItemPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemFrameDropItemPacket.java @@ -24,4 +24,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ITEM_FRAME_DROP_ITEM; } + + @Override + public ItemFrameDropItemPacket clone() { + try { + return (ItemFrameDropItemPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemStackRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemStackRequestPacket.java index c9d161bfb..e29a71b75 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemStackRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemStackRequestPacket.java @@ -25,4 +25,14 @@ public BedrockPacketType getPacketType() { return BedrockPacketType.ITEM_STACK_REQUEST; } + + @Override + public ItemStackRequestPacket clone() { + try { + return (ItemStackRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemStackResponsePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemStackResponsePacket.java index 1bb392708..58f789364 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemStackResponsePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ItemStackResponsePacket.java @@ -30,4 +30,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ITEM_STACK_RESPONSE; } + + @Override + public ItemStackResponsePacket clone() { + try { + return (ItemStackResponsePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/JigsawStructureDataPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/JigsawStructureDataPacket.java index 348526e7a..1e3639148 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/JigsawStructureDataPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/JigsawStructureDataPacket.java @@ -21,4 +21,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.JIGSAW_STRUCTURE_DATA; } -} \ No newline at end of file + + @Override + public JigsawStructureDataPacket clone() { + try { + return (JigsawStructureDataPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LabTablePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LabTablePacket.java index 99262c0e0..b604b5cf1 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LabTablePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LabTablePacket.java @@ -24,4 +24,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.LAB_TABLE; } + + @Override + public LabTablePacket clone() { + try { + return (LabTablePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LecternUpdatePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LecternUpdatePacket.java index 717c79c34..9708f0d05 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LecternUpdatePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LecternUpdatePacket.java @@ -27,4 +27,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.LECTERN_UPDATE; } + + @Override + public LecternUpdatePacket clone() { + try { + return (LecternUpdatePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LessonProgressPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LessonProgressPacket.java index 54c7b5e5f..ff8d7dc5a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LessonProgressPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LessonProgressPacket.java @@ -23,4 +23,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.LESSON_PROGRESS; } + + @Override + public LessonProgressPacket clone() { + try { + return (LessonProgressPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelChunkPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelChunkPacket.java index dff47d684..369740e1c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelChunkPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelChunkPacket.java @@ -54,4 +54,10 @@ public LevelChunkPacket touch(Object hint) { protected void deallocate() { this.data.release(); } + + @Override + public LevelChunkPacket clone() { + throw new UnsupportedOperationException("Can not clone reference counted packet"); + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelEventGenericPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelEventGenericPacket.java index 2c3331e40..5a40b71c9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelEventGenericPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelEventGenericPacket.java @@ -22,4 +22,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.LEVEL_EVENT_GENERIC; } + + @Override + public LevelEventGenericPacket clone() { + try { + return (LevelEventGenericPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelEventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelEventPacket.java index 5939df321..05a67f3ee 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelEventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelEventPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.LEVEL_EVENT; } + + @Override + public LevelEventPacket clone() { + try { + return (LevelEventPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEvent1Packet.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEvent1Packet.java index 30280f5be..00f625b6a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEvent1Packet.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEvent1Packet.java @@ -26,4 +26,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.LEVEL_SOUND_EVENT_1; } + + @Override + public LevelSoundEvent1Packet clone() { + try { + return (LevelSoundEvent1Packet) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEvent2Packet.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEvent2Packet.java index 7a2fe2c1e..a3f3d84cb 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEvent2Packet.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEvent2Packet.java @@ -26,4 +26,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.LEVEL_SOUND_EVENT_2; } + + @Override + public LevelSoundEvent2Packet clone() { + try { + return (LevelSoundEvent2Packet) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEventPacket.java index b8a851adc..60e690e1d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LevelSoundEventPacket.java @@ -13,4 +13,9 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.LEVEL_SOUND_EVENT; } + + @Override + public LevelSoundEventPacket clone() { + return (LevelSoundEventPacket) super.clone(); + } } diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LoginPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LoginPacket.java index c695955a9..0f49a6a1e 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LoginPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/LoginPacket.java @@ -25,4 +25,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.LOGIN; } + + @Override + public LoginPacket clone() { + try { + return (LoginPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MapCreateLockedCopyPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MapCreateLockedCopyPacket.java index ad24931a3..1104cae35 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MapCreateLockedCopyPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MapCreateLockedCopyPacket.java @@ -20,4 +20,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.MAP_CREATE_LOCKED_COPY; } + + @Override + public MapCreateLockedCopyPacket clone() { + try { + return (MapCreateLockedCopyPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MapInfoRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MapInfoRequestPacket.java index 9479ff2ce..41057b5ef 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MapInfoRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MapInfoRequestPacket.java @@ -29,4 +29,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.MAP_INFO_REQUEST; } + + @Override + public MapInfoRequestPacket clone() { + try { + return (MapInfoRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobArmorEquipmentPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobArmorEquipmentPacket.java index 40cf5904f..c76dd9900 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobArmorEquipmentPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobArmorEquipmentPacket.java @@ -28,4 +28,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.MOB_ARMOR_EQUIPMENT; } + + @Override + public MobArmorEquipmentPacket clone() { + try { + return (MobArmorEquipmentPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobEffectPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobEffectPacket.java index 2b21e471c..9adb1ff36 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobEffectPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobEffectPacket.java @@ -35,4 +35,14 @@ public enum Event { MODIFY, REMOVE, } + + @Override + public MobEffectPacket clone() { + try { + return (MobEffectPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobEquipmentPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobEquipmentPacket.java index 710df8b67..757e07073 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobEquipmentPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MobEquipmentPacket.java @@ -24,4 +24,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.MOB_EQUIPMENT; } + + @Override + public MobEquipmentPacket clone() { + try { + return (MobEquipmentPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ModalFormRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ModalFormRequestPacket.java index 5e4717ee3..e72acbcc9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ModalFormRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ModalFormRequestPacket.java @@ -20,4 +20,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.MODAL_FORM_REQUEST; } + + @Override + public ModalFormRequestPacket clone() { + try { + return (ModalFormRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ModalFormResponsePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ModalFormResponsePacket.java index 3e6422751..54ae1e653 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ModalFormResponsePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ModalFormResponsePacket.java @@ -30,4 +30,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.MODAL_FORM_RESPONSE; } + + @Override + public ModalFormResponsePacket clone() { + try { + return (ModalFormResponsePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MotionPredictionHintsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MotionPredictionHintsPacket.java index 9ea84f90c..ad9c8d319 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MotionPredictionHintsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MotionPredictionHintsPacket.java @@ -48,4 +48,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_ENTITY_MOTION_PLUS; } + + @Override + public MotionPredictionHintsPacket clone() { + try { + return (MotionPredictionHintsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MoveEntityAbsolutePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MoveEntityAbsolutePacket.java index 07931582b..dc69b918f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MoveEntityAbsolutePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MoveEntityAbsolutePacket.java @@ -25,4 +25,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.MOVE_ENTITY_ABSOLUTE; } + + @Override + public MoveEntityAbsolutePacket clone() { + try { + return (MoveEntityAbsolutePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MoveEntityDeltaPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MoveEntityDeltaPacket.java index a8a11eed9..d9be345fc 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MoveEntityDeltaPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MoveEntityDeltaPacket.java @@ -53,4 +53,14 @@ public enum Flag { TELEPORTING, FORCE_MOVE_LOCAL_ENTITY } + + @Override + public MoveEntityDeltaPacket clone() { + try { + return (MoveEntityDeltaPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MovePlayerPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MovePlayerPacket.java index 4161e1eed..b3d2439fb 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MovePlayerPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MovePlayerPacket.java @@ -57,4 +57,14 @@ public static TeleportationCause byId(int id) { return UNKNOWN; } } + + @Override + public MovePlayerPacket clone() { + try { + return (MovePlayerPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MultiplayerSettingsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MultiplayerSettingsPacket.java index fd67790d1..bae36f82c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MultiplayerSettingsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/MultiplayerSettingsPacket.java @@ -20,4 +20,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.MULTIPLAYER_SETTINGS; } + + @Override + public MultiplayerSettingsPacket clone() { + try { + return (MultiplayerSettingsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkChunkPublisherUpdatePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkChunkPublisherUpdatePacket.java index 801091808..ecab104da 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkChunkPublisherUpdatePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkChunkPublisherUpdatePacket.java @@ -32,4 +32,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.NETWORK_CHUNK_PUBLISHER_UPDATE; } + + @Override + public NetworkChunkPublisherUpdatePacket clone() { + try { + return (NetworkChunkPublisherUpdatePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkSettingsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkSettingsPacket.java index d244640b2..75ea8a30a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkSettingsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkSettingsPacket.java @@ -46,4 +46,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.NETWORK_SETTINGS; } + + @Override + public NetworkSettingsPacket clone() { + try { + return (NetworkSettingsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkStackLatencyPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkStackLatencyPacket.java index 6f783d94a..84ab6bdf8 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkStackLatencyPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NetworkStackLatencyPacket.java @@ -20,4 +20,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.NETWORK_STACK_LATENCY; } + + @Override + public NetworkStackLatencyPacket clone() { + try { + return (NetworkStackLatencyPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NpcDialoguePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NpcDialoguePacket.java index a4e9978cf..b21ef26b5 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NpcDialoguePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NpcDialoguePacket.java @@ -29,4 +29,14 @@ public enum Action { OPEN, CLOSE } + + @Override + public NpcDialoguePacket clone() { + try { + return (NpcDialoguePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NpcRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NpcRequestPacket.java index 7ca9321a7..4e57d28d9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NpcRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/NpcRequestPacket.java @@ -27,4 +27,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.NPC_REQUEST; } + + @Override + public NpcRequestPacket clone() { + try { + return (NpcRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/OnScreenTextureAnimationPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/OnScreenTextureAnimationPacket.java index 031038d46..d706f247d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/OnScreenTextureAnimationPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/OnScreenTextureAnimationPacket.java @@ -19,4 +19,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.ON_SCREEN_TEXTURE_ANIMATION; } + + @Override + public OnScreenTextureAnimationPacket clone() { + try { + return (OnScreenTextureAnimationPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/OpenSignPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/OpenSignPacket.java index 5d57a1697..33f2a594c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/OpenSignPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/OpenSignPacket.java @@ -26,4 +26,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.OPEN_SIGN; } + + @Override + public OpenSignPacket clone() { + try { + return (OpenSignPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PacketViolationWarningPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PacketViolationWarningPacket.java index f2b9f12a1..dc4d8b8af 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PacketViolationWarningPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PacketViolationWarningPacket.java @@ -25,4 +25,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PACKET_VIOLATION_WARNING; } + + @Override + public PacketViolationWarningPacket clone() { + try { + return (PacketViolationWarningPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PhotoInfoRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PhotoInfoRequestPacket.java index 9a8702fd4..2bd578a13 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PhotoInfoRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PhotoInfoRequestPacket.java @@ -20,4 +20,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PHOTO_INFO_REQUEST; } + + @Override + public PhotoInfoRequestPacket clone() { + try { + return (PhotoInfoRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PhotoTransferPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PhotoTransferPacket.java index aaecc146c..4f7d0f483 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PhotoTransferPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PhotoTransferPacket.java @@ -38,4 +38,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PHOTO_TRANSFER; } + + @Override + public PhotoTransferPacket clone() { + try { + return (PhotoTransferPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlaySoundPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlaySoundPacket.java index 3569f1c75..3ba1ce6b5 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlaySoundPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlaySoundPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAY_SOUND; } + + @Override + public PlaySoundPacket clone() { + try { + return (PlaySoundPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayStatusPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayStatusPacket.java index 8b1e823a3..b14f6baf9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayStatusPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayStatusPacket.java @@ -63,4 +63,14 @@ public enum Status { VANILLA_TO_EDITOR_MISMATCH } + + @Override + public PlayStatusPacket clone() { + try { + return (PlayStatusPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerActionPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerActionPacket.java index 2d969581d..ec8072d62 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerActionPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerActionPacket.java @@ -28,4 +28,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAYER_ACTION; } + + @Override + public PlayerActionPacket clone() { + try { + return (PlayerActionPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerArmorDamagePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerArmorDamagePacket.java index 3cdb3f46d..b11e31ff5 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerArmorDamagePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerArmorDamagePacket.java @@ -25,4 +25,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAYER_ARMOR_DAMAGE; } + + @Override + public PlayerArmorDamagePacket clone() { + try { + return (PlayerArmorDamagePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerAuthInputPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerAuthInputPacket.java index 6258b958e..aa01acd71 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerAuthInputPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerAuthInputPacket.java @@ -71,4 +71,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAYER_AUTH_INPUT; } + + @Override + public PlayerAuthInputPacket clone() { + try { + return (PlayerAuthInputPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerEnchantOptionsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerEnchantOptionsPacket.java index 1a6421342..474abef49 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerEnchantOptionsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerEnchantOptionsPacket.java @@ -24,4 +24,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAYER_ENCHANT_OPTIONS; } + + @Override + public PlayerEnchantOptionsPacket clone() { + try { + return (PlayerEnchantOptionsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerFogPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerFogPacket.java index 3ef0b404f..9e18e023a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerFogPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerFogPacket.java @@ -33,4 +33,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAYER_FOG; } + + @Override + public PlayerFogPacket clone() { + try { + return (PlayerFogPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerHotbarPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerHotbarPacket.java index ed88dc6ae..ce38167c9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerHotbarPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerHotbarPacket.java @@ -21,4 +21,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAYER_HOTBAR; } + + @Override + public PlayerHotbarPacket clone() { + try { + return (PlayerHotbarPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerInputPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerInputPacket.java index f43940f7d..07489c9be 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerInputPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerInputPacket.java @@ -22,4 +22,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAYER_INPUT; } + + @Override + public PlayerInputPacket clone() { + try { + return (PlayerInputPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerListPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerListPacket.java index 619f3f9ee..0cd315a99 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerListPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerListPacket.java @@ -48,4 +48,14 @@ public final static class Entry { private boolean trustedSkin; private boolean subClient; } + + @Override + public PlayerListPacket clone() { + try { + return (PlayerListPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerSkinPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerSkinPacket.java index b393e2308..08a2107ba 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerSkinPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerSkinPacket.java @@ -26,4 +26,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAYER_SKIN; } + + @Override + public PlayerSkinPacket clone() { + try { + return (PlayerSkinPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerStartItemCooldownPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerStartItemCooldownPacket.java index 4070082ae..4c71a202d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerStartItemCooldownPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PlayerStartItemCooldownPacket.java @@ -22,4 +22,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PLAYER_START_ITEM_COOLDOWN; } + + @Override + public PlayerStartItemCooldownPacket clone() { + try { + return (PlayerStartItemCooldownPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PositionTrackingDBClientRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PositionTrackingDBClientRequestPacket.java index 684efb7fd..85554dd9f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PositionTrackingDBClientRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PositionTrackingDBClientRequestPacket.java @@ -25,4 +25,14 @@ public BedrockPacketType getPacketType() { public enum Action { QUERY } + + @Override + public PositionTrackingDBClientRequestPacket clone() { + try { + return (PositionTrackingDBClientRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PositionTrackingDBServerBroadcastPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PositionTrackingDBServerBroadcastPacket.java index 45bc1cc94..d21e3e71a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PositionTrackingDBServerBroadcastPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PositionTrackingDBServerBroadcastPacket.java @@ -29,4 +29,14 @@ public enum Action { DESTROY, NOT_FOUND } + + @Override + public PositionTrackingDBServerBroadcastPacket clone() { + try { + return (PositionTrackingDBServerBroadcastPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PurchaseReceiptPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PurchaseReceiptPacket.java index ce3db78d4..669549a3a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PurchaseReceiptPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/PurchaseReceiptPacket.java @@ -22,4 +22,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.PURCHASE_RECEIPT; } + + @Override + public PurchaseReceiptPacket clone() { + try { + return (PurchaseReceiptPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RefreshEntitlementsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RefreshEntitlementsPacket.java index c78b0590f..30556b020 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RefreshEntitlementsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RefreshEntitlementsPacket.java @@ -14,4 +14,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.REFRESH_ENTITLEMENTS; } + + @Override + public RefreshEntitlementsPacket clone() { + try { + return (RefreshEntitlementsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveEntityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveEntityPacket.java index 88be26baf..7d7960984 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveEntityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveEntityPacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.REMOVE_ENTITY; } + + @Override + public RemoveEntityPacket clone() { + try { + return (RemoveEntityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveObjectivePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveObjectivePacket.java index 533c67cb3..79b9426aa 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveObjectivePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveObjectivePacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.REMOVE_OBJECTIVE; } + + @Override + public RemoveObjectivePacket clone() { + try { + return (RemoveObjectivePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveVolumeEntityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveVolumeEntityPacket.java index 6605b4fd7..96c485e7f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveVolumeEntityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RemoveVolumeEntityPacket.java @@ -22,4 +22,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.REMOVE_VOLUME_ENTITY; } + + @Override + public RemoveVolumeEntityPacket clone() { + try { + return (RemoveVolumeEntityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestAbilityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestAbilityPacket.java index 7dae5a5d6..f42f8374d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestAbilityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestAbilityPacket.java @@ -24,4 +24,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.REQUEST_ABILITY; } + + @Override + public RequestAbilityPacket clone() { + try { + return (RequestAbilityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestChunkRadiusPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestChunkRadiusPacket.java index 797f30a93..f26d535b1 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestChunkRadiusPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestChunkRadiusPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.REQUEST_CHUNK_RADIUS; } + + @Override + public RequestChunkRadiusPacket clone() { + try { + return (RequestChunkRadiusPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestNetworkSettingsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestNetworkSettingsPacket.java index 2500d12cf..1b4f34ac8 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestNetworkSettingsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestNetworkSettingsPacket.java @@ -25,4 +25,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.REQUEST_NETWORK_SETTINGS; } -} \ No newline at end of file + + @Override + public RequestNetworkSettingsPacket clone() { + try { + return (RequestNetworkSettingsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestPermissionsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestPermissionsPacket.java index 1041d1c3a..bb99f4265 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestPermissionsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RequestPermissionsPacket.java @@ -23,4 +23,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.REQUEST_PERMISSIONS; } + + @Override + public RequestPermissionsPacket clone() { + try { + return (RequestPermissionsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackChunkDataPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackChunkDataPacket.java index f08394762..9c6993f75 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackChunkDataPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackChunkDataPacket.java @@ -38,4 +38,10 @@ public ResourcePackChunkDataPacket touch(Object hint) { data.touch(hint); return this; } + + @Override + public ResourcePackChunkDataPacket clone() { + throw new UnsupportedOperationException("Can not clone reference counted packet"); + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackChunkRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackChunkRequestPacket.java index df5c5d141..58b8c9314 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackChunkRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackChunkRequestPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.RESOURCE_PACK_CHUNK_REQUEST; } + + @Override + public ResourcePackChunkRequestPacket clone() { + try { + return (ResourcePackChunkRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackClientResponsePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackClientResponsePacket.java index eb01c80ec..8c8a15d0a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackClientResponsePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackClientResponsePacket.java @@ -31,4 +31,14 @@ public enum Status { HAVE_ALL_PACKS, COMPLETED } + + @Override + public ResourcePackClientResponsePacket clone() { + try { + return (ResourcePackClientResponsePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackDataInfoPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackDataInfoPacket.java index 05aa906ea..fbea2a7ba 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackDataInfoPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackDataInfoPacket.java @@ -29,4 +29,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.RESOURCE_PACK_DATA_INFO; } + + @Override + public ResourcePackDataInfoPacket clone() { + try { + return (ResourcePackDataInfoPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackStackPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackStackPacket.java index 5b88c48e7..26a05e19c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackStackPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePackStackPacket.java @@ -41,4 +41,14 @@ public static class Entry { private final String packVersion; private final String subPackName; } + + @Override + public ResourcePackStackPacket clone() { + try { + return (ResourcePackStackPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePacksInfoPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePacksInfoPacket.java index c96ff6021..f969efdd2 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePacksInfoPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ResourcePacksInfoPacket.java @@ -60,4 +60,14 @@ public static class CDNEntry { private final String packId; private final String remoteUrl; } + + @Override + public ResourcePacksInfoPacket clone() { + try { + return (ResourcePacksInfoPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RespawnPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RespawnPacket.java index 9d9c47977..5694dc0d6 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RespawnPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RespawnPacket.java @@ -28,4 +28,14 @@ public enum State { SERVER_READY, CLIENT_READY } + + @Override + public RespawnPacket clone() { + try { + return (RespawnPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RiderJumpPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RiderJumpPacket.java index 641feedb3..2552d4560 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RiderJumpPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/RiderJumpPacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.RIDER_JUMP; } + + @Override + public RiderJumpPacket clone() { + try { + return (RiderJumpPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ScriptCustomEventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ScriptCustomEventPacket.java index 94ca78292..4193a66b3 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ScriptCustomEventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ScriptCustomEventPacket.java @@ -24,5 +24,15 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SCRIPT_CUSTOM_EVENT; } + + @Override + public ScriptCustomEventPacket clone() { + try { + return (ScriptCustomEventPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ScriptMessagePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ScriptMessagePacket.java index d83f9c479..1812a9aae 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ScriptMessagePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ScriptMessagePacket.java @@ -22,4 +22,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SCRIPT_MESSAGE; } + + @Override + public ScriptMessagePacket clone() { + try { + return (ScriptMessagePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerSettingsRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerSettingsRequestPacket.java index 1e26a46e5..c9c43a993 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerSettingsRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerSettingsRequestPacket.java @@ -18,4 +18,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SERVER_SETTINGS_REQUEST; } + + @Override + public ServerSettingsRequestPacket clone() { + try { + return (ServerSettingsRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerSettingsResponsePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerSettingsResponsePacket.java index 2c057942e..072c77786 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerSettingsResponsePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerSettingsResponsePacket.java @@ -20,4 +20,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SERVER_SETTINGS_RESPONSE; } + + @Override + public ServerSettingsResponsePacket clone() { + try { + return (ServerSettingsResponsePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerStatsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerStatsPacket.java index faa9bc694..a6258dc44 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerStatsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerStatsPacket.java @@ -25,4 +25,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SERVER_STATS; } -} \ No newline at end of file + + @Override + public ServerStatsPacket clone() { + try { + return (ServerStatsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerToClientHandshakePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerToClientHandshakePacket.java index 40b9a4bb2..6ef7c8ad6 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerToClientHandshakePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerToClientHandshakePacket.java @@ -22,4 +22,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SERVER_TO_CLIENT_HANDSHAKE; } + + @Override + public ServerToClientHandshakePacket clone() { + try { + return (ServerToClientHandshakePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerboundDiagnosticsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerboundDiagnosticsPacket.java index 1e10eb26d..1feef8848 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerboundDiagnosticsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerboundDiagnosticsPacket.java @@ -28,4 +28,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SERVERBOUND_DIAGNOSTICS; } -} \ No newline at end of file + + @Override + public ServerboundDiagnosticsPacket clone() { + try { + return (ServerboundDiagnosticsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerboundLoadingScreenPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerboundLoadingScreenPacket.java index 21d16e308..811a2486e 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerboundLoadingScreenPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ServerboundLoadingScreenPacket.java @@ -25,4 +25,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SERVERBOUND_LOADING_SCREEN; } -} \ No newline at end of file + + @Override + public ServerboundLoadingScreenPacket clone() { + try { + return (ServerboundLoadingScreenPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetCommandsEnabledPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetCommandsEnabledPacket.java index d0a17ea76..ed2a5d8d5 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetCommandsEnabledPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetCommandsEnabledPacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_COMMANDS_ENABLED; } + + @Override + public SetCommandsEnabledPacket clone() { + try { + return (SetCommandsEnabledPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDefaultGameTypePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDefaultGameTypePacket.java index 5f71e2f19..f0d8dd662 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDefaultGameTypePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDefaultGameTypePacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_DEFAULT_GAME_TYPE; } + + @Override + public SetDefaultGameTypePacket clone() { + try { + return (SetDefaultGameTypePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDifficultyPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDifficultyPacket.java index e98ff3610..707ef79f3 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDifficultyPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDifficultyPacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_DIFFICULTY; } + + @Override + public SetDifficultyPacket clone() { + try { + return (SetDifficultyPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDisplayObjectivePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDisplayObjectivePacket.java index 9c2dc6cc4..f40e6dfe4 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDisplayObjectivePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetDisplayObjectivePacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_DISPLAY_OBJECTIVE; } + + @Override + public SetDisplayObjectivePacket clone() { + try { + return (SetDisplayObjectivePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityDataPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityDataPacket.java index 4e1ab7894..4eba09c97 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityDataPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityDataPacket.java @@ -27,4 +27,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_ENTITY_DATA; } + + @Override + public SetEntityDataPacket clone() { + try { + return (SetEntityDataPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityLinkPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityLinkPacket.java index 0039a4447..663ee09f9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityLinkPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityLinkPacket.java @@ -20,4 +20,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_ENTITY_LINK; } + + @Override + public SetEntityLinkPacket clone() { + try { + return (SetEntityLinkPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityMotionPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityMotionPacket.java index 192067e35..076a405b0 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityMotionPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetEntityMotionPacket.java @@ -25,4 +25,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_ENTITY_MOTION; } + + @Override + public SetEntityMotionPacket clone() { + try { + return (SetEntityMotionPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetHealthPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetHealthPacket.java index d6d493c7c..cdac2cbbd 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetHealthPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetHealthPacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_HEALTH; } + + @Override + public SetHealthPacket clone() { + try { + return (SetHealthPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetHudPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetHudPacket.java index ce27dd5ff..52da40d58 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetHudPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetHudPacket.java @@ -29,4 +29,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_HUD; } + + @Override + public SetHudPacket clone() { + try { + return (SetHudPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetLastHurtByPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetLastHurtByPacket.java index d4f549958..826d6d800 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetLastHurtByPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetLastHurtByPacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_LAST_HURT_BY; } + + @Override + public SetLastHurtByPacket clone() { + try { + return (SetLastHurtByPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetLocalPlayerAsInitializedPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetLocalPlayerAsInitializedPacket.java index 630433ffc..5a7cc48d4 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetLocalPlayerAsInitializedPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetLocalPlayerAsInitializedPacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_LOCAL_PLAYER_AS_INITIALIZED; } + + @Override + public SetLocalPlayerAsInitializedPacket clone() { + try { + return (SetLocalPlayerAsInitializedPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetPlayerGameTypePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetPlayerGameTypePacket.java index 90e267b30..0149de57f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetPlayerGameTypePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetPlayerGameTypePacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_PLAYER_GAME_TYPE; } + + @Override + public SetPlayerGameTypePacket clone() { + try { + return (SetPlayerGameTypePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetPlayerInventoryOptionsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetPlayerInventoryOptionsPacket.java index 470b3eb66..6561f4940 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetPlayerInventoryOptionsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetPlayerInventoryOptionsPacket.java @@ -27,4 +27,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_PLAYER_INVENTORY_OPTIONS; } + + @Override + public SetPlayerInventoryOptionsPacket clone() { + try { + return (SetPlayerInventoryOptionsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetScorePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetScorePacket.java index 11a94dc54..c7f85eacf 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetScorePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetScorePacket.java @@ -29,4 +29,14 @@ public enum Action { SET, REMOVE } + + @Override + public SetScorePacket clone() { + try { + return (SetScorePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetScoreboardIdentityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetScoreboardIdentityPacket.java index 11d2352f8..d633700d9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetScoreboardIdentityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetScoreboardIdentityPacket.java @@ -36,4 +36,14 @@ public static class Entry { private final long scoreboardId; private final UUID uuid; } + + @Override + public SetScoreboardIdentityPacket clone() { + try { + return (SetScoreboardIdentityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetSpawnPositionPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetSpawnPositionPacket.java index d0585a08e..e68afce3a 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetSpawnPositionPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetSpawnPositionPacket.java @@ -44,4 +44,14 @@ public enum Type { PLAYER_SPAWN, WORLD_SPAWN } + + @Override + public SetSpawnPositionPacket clone() { + try { + return (SetSpawnPositionPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetTimePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetTimePacket.java index 453290384..5a3e531a5 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetTimePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetTimePacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SET_TIME; } + + @Override + public SetTimePacket clone() { + try { + return (SetTimePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetTitlePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetTitlePacket.java index 812b16845..6a07ce690 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetTitlePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SetTitlePacket.java @@ -47,4 +47,14 @@ public enum Type { SUBTITLE_JSON, ACTIONBAR_JSON } + + @Override + public SetTitlePacket clone() { + try { + return (SetTitlePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SettingsCommandPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SettingsCommandPacket.java index 608c60086..fb1dd1f87 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SettingsCommandPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SettingsCommandPacket.java @@ -20,4 +20,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SETTINGS_COMMAND; } + + @Override + public SettingsCommandPacket clone() { + try { + return (SettingsCommandPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowCreditsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowCreditsPacket.java index f0a61da97..ddbff0cd3 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowCreditsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowCreditsPacket.java @@ -25,4 +25,14 @@ public enum Status { START_CREDITS, END_CREDITS } + + @Override + public ShowCreditsPacket clone() { + try { + return (ShowCreditsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowProfilePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowProfilePacket.java index 5692e26bb..a3d65470d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowProfilePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowProfilePacket.java @@ -19,4 +19,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SHOW_PROFILE; } + + @Override + public ShowProfilePacket clone() { + try { + return (ShowProfilePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowStoreOfferPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowStoreOfferPacket.java index f26c87e87..ca61cfa94 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowStoreOfferPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ShowStoreOfferPacket.java @@ -30,4 +30,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SHOW_STORE_OFFER; } + + @Override + public ShowStoreOfferPacket clone() { + try { + return (ShowStoreOfferPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SimpleEventPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SimpleEventPacket.java index a5b24f246..334f6d54b 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SimpleEventPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SimpleEventPacket.java @@ -20,4 +20,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SIMPLE_EVENT; } + + @Override + public SimpleEventPacket clone() { + try { + return (SimpleEventPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SimulationTypePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SimulationTypePacket.java index 868cd1d57..9232b241c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SimulationTypePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SimulationTypePacket.java @@ -20,4 +20,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SIMULATION_TYPE; } -} \ No newline at end of file + + @Override + public SimulationTypePacket clone() { + try { + return (SimulationTypePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SpawnExperienceOrbPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SpawnExperienceOrbPacket.java index bf3b20ed3..979c77dd1 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SpawnExperienceOrbPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SpawnExperienceOrbPacket.java @@ -21,4 +21,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SPAWN_EXPERIENCE_ORB; } + + @Override + public SpawnExperienceOrbPacket clone() { + try { + return (SpawnExperienceOrbPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SpawnParticleEffectPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SpawnParticleEffectPacket.java index edea9ac06..a02729c3c 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SpawnParticleEffectPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SpawnParticleEffectPacket.java @@ -27,4 +27,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SPAWN_PARTICLE_EFFECT; } + + @Override + public SpawnParticleEffectPacket clone() { + try { + return (SpawnParticleEffectPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StartGamePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StartGamePacket.java index 8a5300cc9..db268baa3 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StartGamePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StartGamePacket.java @@ -191,4 +191,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.START_GAME; } + + @Override + public StartGamePacket clone() { + try { + return (StartGamePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StopSoundPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StopSoundPacket.java index 783566d77..e87c6c2b0 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StopSoundPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StopSoundPacket.java @@ -24,4 +24,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.STOP_SOUND; } + + @Override + public StopSoundPacket clone() { + try { + return (StopSoundPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureBlockUpdatePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureBlockUpdatePacket.java index 9723aecdb..41eb7a2a1 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureBlockUpdatePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureBlockUpdatePacket.java @@ -33,4 +33,14 @@ public enum Type { SAVE, LOAD, } + + @Override + public StructureBlockUpdatePacket clone() { + try { + return (StructureBlockUpdatePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureTemplateDataRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureTemplateDataRequestPacket.java index b46d247d1..302ee4105 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureTemplateDataRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureTemplateDataRequestPacket.java @@ -25,4 +25,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.STRUCTURE_TEMPLATE_DATA_EXPORT_REQUEST; } + + @Override + public StructureTemplateDataRequestPacket clone() { + try { + return (StructureTemplateDataRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureTemplateDataResponsePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureTemplateDataResponsePacket.java index 04970d967..d505d61d0 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureTemplateDataResponsePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/StructureTemplateDataResponsePacket.java @@ -24,4 +24,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.STRUCTURE_TEMPLATE_DATA_EXPORT_RESPONSE; } + + @Override + public StructureTemplateDataResponsePacket clone() { + try { + return (StructureTemplateDataResponsePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubChunkPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubChunkPacket.java index 308de8135..71794a821 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubChunkPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubChunkPacket.java @@ -42,4 +42,10 @@ public SubChunkPacket touch(Object o) { protected void deallocate() { this.subChunks.forEach(SubChunkData::release); } + + @Override + public SubChunkPacket clone() { + throw new UnsupportedOperationException("Can not clone reference counted packet"); + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubChunkRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubChunkRequestPacket.java index 5e6f3794f..409062180 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubChunkRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubChunkRequestPacket.java @@ -28,4 +28,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SUB_CHUNK_REQUEST; } + + @Override + public SubChunkRequestPacket clone() { + try { + return (SubChunkRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubClientLoginPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubClientLoginPacket.java index ecbbc2bad..acf9a0b06 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubClientLoginPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SubClientLoginPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SUB_CLIENT_LOGIN; } + + @Override + public SubClientLoginPacket clone() { + try { + return (SubClientLoginPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SyncEntityPropertyPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SyncEntityPropertyPacket.java index 548206196..9f589529f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SyncEntityPropertyPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/SyncEntityPropertyPacket.java @@ -19,4 +19,13 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.SYNC_ENTITY_PROPERTY; } -} \ No newline at end of file + + @Override + public SyncEntityPropertyPacket clone() { + try { + return (SyncEntityPropertyPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } +} diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TakeItemEntityPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TakeItemEntityPacket.java index a4680b219..0d328c853 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TakeItemEntityPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TakeItemEntityPacket.java @@ -20,4 +20,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.TAKE_ITEM_ENTITY; } + + @Override + public TakeItemEntityPacket clone() { + try { + return (TakeItemEntityPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TextPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TextPacket.java index 896df2ad4..a0e28e6b9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TextPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TextPacket.java @@ -50,4 +50,14 @@ public enum Type { */ ANNOUNCEMENT_JSON } + + @Override + public TextPacket clone() { + try { + return (TextPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TickSyncPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TickSyncPacket.java index cfe91f029..866005d57 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TickSyncPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TickSyncPacket.java @@ -23,4 +23,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.TICK_SYNC; } + + @Override + public TickSyncPacket clone() { + try { + return (TickSyncPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TickingAreasLoadStatusPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TickingAreasLoadStatusPacket.java index 780fa7071..4d4b8189d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TickingAreasLoadStatusPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TickingAreasLoadStatusPacket.java @@ -25,4 +25,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.TICKING_AREAS_LOAD_STATUS; } + + @Override + public TickingAreasLoadStatusPacket clone() { + try { + return (TickingAreasLoadStatusPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ToastRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ToastRequestPacket.java index 1a908eef5..50714da77 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ToastRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ToastRequestPacket.java @@ -22,4 +22,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.TOAST_REQUEST; } + + @Override + public ToastRequestPacket clone() { + try { + return (ToastRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ToggleCrafterSlotRequestPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ToggleCrafterSlotRequestPacket.java index 660770d33..da6551c4f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ToggleCrafterSlotRequestPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/ToggleCrafterSlotRequestPacket.java @@ -23,4 +23,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.TOGGLE_CRAFTER_SLOT_REQUEST; } + + @Override + public ToggleCrafterSlotRequestPacket clone() { + try { + return (ToggleCrafterSlotRequestPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TransferPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TransferPacket.java index 2f3204b4b..993604a97 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TransferPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TransferPacket.java @@ -20,4 +20,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.TRANSFER; } + + @Override + public TransferPacket clone() { + try { + return (TransferPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TrimDataPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TrimDataPacket.java index a19743d77..f23c51dd1 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TrimDataPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/TrimDataPacket.java @@ -26,4 +26,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.TRIM_DATA; } + + @Override + public TrimDataPacket clone() { + try { + return (TrimDataPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UnknownPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UnknownPacket.java index 4c3ed4871..51d8148e9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UnknownPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UnknownPacket.java @@ -85,4 +85,10 @@ public boolean release() { public boolean release(int decrement) { return this.payload == null || this.payload.release(decrement); } + + @Override + public UnknownPacket clone() { + throw new UnsupportedOperationException("Can not clone reference counted packet"); + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UnlockedRecipesPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UnlockedRecipesPacket.java index 9494c1482..095cec39e 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UnlockedRecipesPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UnlockedRecipesPacket.java @@ -33,4 +33,14 @@ public enum ActionType { REMOVE_UNLOCKED, REMOVE_ALL } + + @Override + public UnlockedRecipesPacket clone() { + try { + return (UnlockedRecipesPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAbilitiesPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAbilitiesPacket.java index e0b08d2fb..a6afc7c7d 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAbilitiesPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAbilitiesPacket.java @@ -29,4 +29,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.UPDATE_ABILITIES; } + + @Override + public UpdateAbilitiesPacket clone() { + try { + return (UpdateAbilitiesPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAdventureSettingsPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAdventureSettingsPacket.java index 7398233fb..1ce0d33f0 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAdventureSettingsPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAdventureSettingsPacket.java @@ -23,4 +23,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.UPDATE_ADVENTURE_SETTINGS; } + + @Override + public UpdateAdventureSettingsPacket clone() { + try { + return (UpdateAdventureSettingsPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAttributesPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAttributesPacket.java index 8e00d6fa4..26e898c4f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAttributesPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateAttributesPacket.java @@ -25,4 +25,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.UPDATE_ATTRIBUTES; } + + @Override + public UpdateAttributesPacket clone() { + try { + return (UpdateAttributesPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockPacket.java index 39c39b1e1..171864778 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockPacket.java @@ -40,4 +40,14 @@ public enum Flag { UNUSED, PRIORITY } + + @Override + public UpdateBlockPacket clone() { + try { + return (UpdateBlockPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockPropertiesPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockPropertiesPacket.java index a7caa5dd7..0f7aaa607 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockPropertiesPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockPropertiesPacket.java @@ -20,4 +20,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.UPDATE_BLOCK_PROPERTIES; } + + @Override + public UpdateBlockPropertiesPacket clone() { + try { + return (UpdateBlockPropertiesPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockSyncedPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockSyncedPacket.java index 54dfbadf9..68e00392f 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockSyncedPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateBlockSyncedPacket.java @@ -29,4 +29,9 @@ public String toString() { ", dataLayer=" + this.dataLayer + ")"; } + + @Override + public UpdateBlockSyncedPacket clone() { + return (UpdateBlockSyncedPacket) super.clone(); + } } diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateClientInputLocksPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateClientInputLocksPacket.java index 4b048ac54..6ccff2bc2 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateClientInputLocksPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateClientInputLocksPacket.java @@ -24,4 +24,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return UPDATE_CLIENT_INPUT_LOCKS; } + + @Override + public UpdateClientInputLocksPacket clone() { + try { + return (UpdateClientInputLocksPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateEquipPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateEquipPacket.java index edbdf9bfa..787e3a625 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateEquipPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateEquipPacket.java @@ -24,4 +24,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.UPDATE_EQUIP; } + + @Override + public UpdateEquipPacket clone() { + try { + return (UpdateEquipPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdatePlayerGameTypePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdatePlayerGameTypePacket.java index 28fc6f503..2689ee80b 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdatePlayerGameTypePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdatePlayerGameTypePacket.java @@ -26,4 +26,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.UPDATE_PLAYER_GAME_TYPE; } + + @Override + public UpdatePlayerGameTypePacket clone() { + try { + return (UpdatePlayerGameTypePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateSoftEnumPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateSoftEnumPacket.java index cde572eec..f5d8cdffa 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateSoftEnumPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateSoftEnumPacket.java @@ -22,4 +22,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.UPDATE_SOFT_ENUM; } + + @Override + public UpdateSoftEnumPacket clone() { + try { + return (UpdateSoftEnumPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateSubChunkBlocksPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateSubChunkBlocksPacket.java index d44d34f24..a20584476 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateSubChunkBlocksPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateSubChunkBlocksPacket.java @@ -29,4 +29,14 @@ public PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.UPDATE_SUB_CHUNK_BLOCKS; } + + @Override + public UpdateSubChunkBlocksPacket clone() { + try { + return (UpdateSubChunkBlocksPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateTradePacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateTradePacket.java index bb9638121..c1022ff92 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateTradePacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/UpdateTradePacket.java @@ -31,4 +31,14 @@ public final PacketSignal handle(BedrockPacketHandler handler) { public BedrockPacketType getPacketType() { return BedrockPacketType.UPDATE_TRADE; } + + @Override + public UpdateTradePacket clone() { + try { + return (UpdateTradePacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } + diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/VideoStreamConnectPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/VideoStreamConnectPacket.java index f060941f4..273c7fc36 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/VideoStreamConnectPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/VideoStreamConnectPacket.java @@ -28,4 +28,14 @@ public enum Action { OPEN, CLOSE } + + @Override + public VideoStreamConnectPacket clone() { + try { + return (VideoStreamConnectPacket) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } +