/
MCPE Protocol.cs
8969 lines (6727 loc) · 178 KB
/
MCPE Protocol.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#region LICENSE
// The contents of this file are subject to the Common Public Attribution// The contents of this file are subject to the Common Public Attribution
// License Version 1.0. (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// https://github.com/NiclasOlofsson/MiNET/blob/master/LICENSE.
// The License is based on the Mozilla Public License Version 1.1, but Sections 14
// and 15 have been added to cover use of software over a computer network and
// provide for limited attribution for the Original Developer. In addition, Exhibit A has
// been modified to be consistent with Exhibit B.
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
// the specific language governing rights and limitations under the License.
//
// The Original Code is MiNET.
//
// The Original Developer is the Initial Developer. The Initial Developer of
// the Original Code is Niclas Olofsson.
//
// All portions of the code written by Niclas Olofsson are Copyright (c) 2014-2018 Niclas Olofsson.
// All Rights Reserved.
#endregion
//
// WARNING: T4 GENERATED CODE - DO NOT EDIT
//
using System;
using System.Net;
using System.Numerics;
using System.Threading;
using MiNET.Utils;
using MiNET.Utils.Skins;
using MiNET.Items;
using MiNET.Crafting;
using little = MiNET.Utils.Int24; // friendly name
using LongString = System.String;
namespace MiNET.Net
{
public class McpeProtocolInfo
{
public const int ProtocolVersion = 354;
public const string GameVersion = "1.11.4";
}
public interface IMcpeMessageHandler
{
void Disconnect(string reason, bool sendDisconnect = true);
void HandleMcpeLogin(McpeLogin message);
void HandleMcpeClientToServerHandshake(McpeClientToServerHandshake message);
void HandleMcpeResourcePackClientResponse(McpeResourcePackClientResponse message);
void HandleMcpeText(McpeText message);
void HandleMcpeMoveEntity(McpeMoveEntity message);
void HandleMcpeMovePlayer(McpeMovePlayer message);
void HandleMcpeRiderJump(McpeRiderJump message);
void HandleMcpeLevelSoundEventOld(McpeLevelSoundEventOld message);
void HandleMcpeEntityEvent(McpeEntityEvent message);
void HandleMcpeInventoryTransaction(McpeInventoryTransaction message);
void HandleMcpeMobEquipment(McpeMobEquipment message);
void HandleMcpeMobArmorEquipment(McpeMobArmorEquipment message);
void HandleMcpeInteract(McpeInteract message);
void HandleMcpeBlockPickRequest(McpeBlockPickRequest message);
void HandleMcpeEntityPickRequest(McpeEntityPickRequest message);
void HandleMcpePlayerAction(McpePlayerAction message);
void HandleMcpeEntityFall(McpeEntityFall message);
void HandleMcpeSetEntityData(McpeSetEntityData message);
void HandleMcpeSetEntityMotion(McpeSetEntityMotion message);
void HandleMcpeAnimate(McpeAnimate message);
void HandleMcpeRespawn(McpeRespawn message);
void HandleMcpeContainerClose(McpeContainerClose message);
void HandleMcpePlayerHotbar(McpePlayerHotbar message);
void HandleMcpeInventoryContent(McpeInventoryContent message);
void HandleMcpeInventorySlot(McpeInventorySlot message);
void HandleMcpeCraftingEvent(McpeCraftingEvent message);
void HandleMcpeAdventureSettings(McpeAdventureSettings message);
void HandleMcpeBlockEntityData(McpeBlockEntityData message);
void HandleMcpePlayerInput(McpePlayerInput message);
void HandleMcpeSetPlayerGameType(McpeSetPlayerGameType message);
void HandleMcpeMapInfoRequest(McpeMapInfoRequest message);
void HandleMcpeRequestChunkRadius(McpeRequestChunkRadius message);
void HandleMcpeItemFrameDropItem(McpeItemFrameDropItem message);
void HandleMcpeCommandRequest(McpeCommandRequest message);
void HandleMcpeCommandBlockUpdate(McpeCommandBlockUpdate message);
void HandleMcpeResourcePackChunkRequest(McpeResourcePackChunkRequest message);
void HandleMcpePurchaseReceipt(McpePurchaseReceipt message);
void HandleMcpePlayerSkin(McpePlayerSkin message);
void HandleMcpeNpcRequest(McpeNpcRequest message);
void HandleMcpePhotoTransfer(McpePhotoTransfer message);
void HandleMcpeModalFormResponse(McpeModalFormResponse message);
void HandleMcpeServerSettingsRequest(McpeServerSettingsRequest message);
void HandleMcpeLabTable(McpeLabTable message);
void HandleMcpeSetLocalPlayerAsInitializedPacket(McpeSetLocalPlayerAsInitializedPacket message);
void HandleMcpeNetworkStackLatencyPacket(McpeNetworkStackLatencyPacket message);
void HandleMcpeScriptCustomEventPacket(McpeScriptCustomEventPacket message);
void HandleMcpeLevelSoundEventV2(McpeLevelSoundEventV2 message);
void HandleMcpeLevelSoundEvent(McpeLevelSoundEvent message);
}
public interface IMcpeClientMessageHandler
{
void HandleMcpePlayStatus(McpePlayStatus message);
void HandleMcpeServerToClientHandshake(McpeServerToClientHandshake message);
void HandleMcpeDisconnect(McpeDisconnect message);
void HandleMcpeResourcePacksInfo(McpeResourcePacksInfo message);
void HandleMcpeResourcePackStack(McpeResourcePackStack message);
void HandleMcpeText(McpeText message);
void HandleMcpeSetTime(McpeSetTime message);
void HandleMcpeStartGame(McpeStartGame message);
void HandleMcpeAddPlayer(McpeAddPlayer message);
void HandleMcpeAddEntity(McpeAddEntity message);
void HandleMcpeRemoveEntity(McpeRemoveEntity message);
void HandleMcpeAddItemEntity(McpeAddItemEntity message);
void HandleMcpeTakeItemEntity(McpeTakeItemEntity message);
void HandleMcpeMoveEntity(McpeMoveEntity message);
void HandleMcpeMovePlayer(McpeMovePlayer message);
void HandleMcpeRiderJump(McpeRiderJump message);
void HandleMcpeUpdateBlock(McpeUpdateBlock message);
void HandleMcpeAddPainting(McpeAddPainting message);
void HandleMcpeExplode(McpeExplode message);
void HandleMcpeLevelSoundEventOld(McpeLevelSoundEventOld message);
void HandleMcpeLevelEvent(McpeLevelEvent message);
void HandleMcpeBlockEvent(McpeBlockEvent message);
void HandleMcpeEntityEvent(McpeEntityEvent message);
void HandleMcpeMobEffect(McpeMobEffect message);
void HandleMcpeUpdateAttributes(McpeUpdateAttributes message);
void HandleMcpeInventoryTransaction(McpeInventoryTransaction message);
void HandleMcpeMobEquipment(McpeMobEquipment message);
void HandleMcpeMobArmorEquipment(McpeMobArmorEquipment message);
void HandleMcpeInteract(McpeInteract message);
void HandleMcpeHurtArmor(McpeHurtArmor message);
void HandleMcpeSetEntityData(McpeSetEntityData message);
void HandleMcpeSetEntityMotion(McpeSetEntityMotion message);
void HandleMcpeSetEntityLink(McpeSetEntityLink message);
void HandleMcpeSetHealth(McpeSetHealth message);
void HandleMcpeSetSpawnPosition(McpeSetSpawnPosition message);
void HandleMcpeAnimate(McpeAnimate message);
void HandleMcpeRespawn(McpeRespawn message);
void HandleMcpeContainerOpen(McpeContainerOpen message);
void HandleMcpeContainerClose(McpeContainerClose message);
void HandleMcpePlayerHotbar(McpePlayerHotbar message);
void HandleMcpeInventoryContent(McpeInventoryContent message);
void HandleMcpeInventorySlot(McpeInventorySlot message);
void HandleMcpeContainerSetData(McpeContainerSetData message);
void HandleMcpeCraftingData(McpeCraftingData message);
void HandleMcpeCraftingEvent(McpeCraftingEvent message);
void HandleMcpeGuiDataPickItem(McpeGuiDataPickItem message);
void HandleMcpeAdventureSettings(McpeAdventureSettings message);
void HandleMcpeBlockEntityData(McpeBlockEntityData message);
void HandleMcpeFullChunkData(McpeFullChunkData message);
void HandleMcpeSetCommandsEnabled(McpeSetCommandsEnabled message);
void HandleMcpeSetDifficulty(McpeSetDifficulty message);
void HandleMcpeChangeDimension(McpeChangeDimension message);
void HandleMcpeSetPlayerGameType(McpeSetPlayerGameType message);
void HandleMcpePlayerList(McpePlayerList message);
void HandleMcpeSimpleEvent(McpeSimpleEvent message);
void HandleMcpeTelemetryEvent(McpeTelemetryEvent message);
void HandleMcpeSpawnExperienceOrb(McpeSpawnExperienceOrb message);
void HandleMcpeClientboundMapItemData(McpeClientboundMapItemData message);
void HandleMcpeMapInfoRequest(McpeMapInfoRequest message);
void HandleMcpeRequestChunkRadius(McpeRequestChunkRadius message);
void HandleMcpeChunkRadiusUpdate(McpeChunkRadiusUpdate message);
void HandleMcpeItemFrameDropItem(McpeItemFrameDropItem message);
void HandleMcpeGameRulesChanged(McpeGameRulesChanged message);
void HandleMcpeCamera(McpeCamera message);
void HandleMcpeBossEvent(McpeBossEvent message);
void HandleMcpeShowCredits(McpeShowCredits message);
void HandleMcpeAvailableCommands(McpeAvailableCommands message);
void HandleMcpeCommandOutput(McpeCommandOutput message);
void HandleMcpeUpdateTrade(McpeUpdateTrade message);
void HandleMcpeUpdateEquipment(McpeUpdateEquipment message);
void HandleMcpeResourcePackDataInfo(McpeResourcePackDataInfo message);
void HandleMcpeResourcePackChunkData(McpeResourcePackChunkData message);
void HandleMcpeTransfer(McpeTransfer message);
void HandleMcpePlaySound(McpePlaySound message);
void HandleMcpeStopSound(McpeStopSound message);
void HandleMcpeSetTitle(McpeSetTitle message);
void HandleMcpeAddBehaviorTree(McpeAddBehaviorTree message);
void HandleMcpeStructureBlockUpdate(McpeStructureBlockUpdate message);
void HandleMcpeShowStoreOffer(McpeShowStoreOffer message);
void HandleMcpePlayerSkin(McpePlayerSkin message);
void HandleMcpeSubClientLogin(McpeSubClientLogin message);
void HandleMcpeInitiateWebSocketConnection(McpeInitiateWebSocketConnection message);
void HandleMcpeSetLastHurtBy(McpeSetLastHurtBy message);
void HandleMcpeBookEdit(McpeBookEdit message);
void HandleMcpeNpcRequest(McpeNpcRequest message);
void HandleMcpeModalFormRequest(McpeModalFormRequest message);
void HandleMcpeServerSettingsResponse(McpeServerSettingsResponse message);
void HandleMcpeShowProfile(McpeShowProfile message);
void HandleMcpeSetDefaultGameType(McpeSetDefaultGameType message);
void HandleMcpeRemoveObjective(McpeRemoveObjective message);
void HandleMcpeSetDisplayObjective(McpeSetDisplayObjective message);
void HandleMcpeSetScore(McpeSetScore message);
void HandleMcpeLabTable(McpeLabTable message);
void HandleMcpeUpdateBlockSynced(McpeUpdateBlockSynced message);
void HandleMcpeMoveEntityDelta(McpeMoveEntityDelta message);
void HandleMcpeSetScoreboardIdentityPacket(McpeSetScoreboardIdentityPacket message);
void HandleMcpeUpdateSoftEnumPacket(McpeUpdateSoftEnumPacket message);
void HandleMcpeNetworkStackLatencyPacket(McpeNetworkStackLatencyPacket message);
void HandleMcpeScriptCustomEventPacket(McpeScriptCustomEventPacket message);
void HandleMcpeSpawnParticleEffect(McpeSpawnParticleEffect message);
void HandleMcpeAvailableEntityIdentifiers(McpeAvailableEntityIdentifiers message);
void HandleMcpeLevelSoundEventV2(McpeLevelSoundEventV2 message);
void HandleMcpeNetworkChunkPublisherUpdate(McpeNetworkChunkPublisherUpdate message);
void HandleMcpeBiomeDefinitionList(McpeBiomeDefinitionList message);
void HandleMcpeLevelSoundEvent(McpeLevelSoundEvent message);
void HandleFtlCreatePlayer(FtlCreatePlayer message);
}
public class McpeClientMessageDispatcher
{
private IMcpeClientMessageHandler _messageHandler = null;
public McpeClientMessageDispatcher(IMcpeClientMessageHandler messageHandler)
{
_messageHandler = messageHandler;
}
public bool HandlePacket(Packet message)
{
if (false) {}
else if (typeof(McpePlayStatus) == message.GetType()) _messageHandler.HandleMcpePlayStatus((McpePlayStatus) message);
else if (typeof(McpeServerToClientHandshake) == message.GetType()) _messageHandler.HandleMcpeServerToClientHandshake((McpeServerToClientHandshake) message);
else if (typeof(McpeDisconnect) == message.GetType()) _messageHandler.HandleMcpeDisconnect((McpeDisconnect) message);
else if (typeof(McpeResourcePacksInfo) == message.GetType()) _messageHandler.HandleMcpeResourcePacksInfo((McpeResourcePacksInfo) message);
else if (typeof(McpeResourcePackStack) == message.GetType()) _messageHandler.HandleMcpeResourcePackStack((McpeResourcePackStack) message);
else if (typeof(McpeText) == message.GetType()) _messageHandler.HandleMcpeText((McpeText) message);
else if (typeof(McpeSetTime) == message.GetType()) _messageHandler.HandleMcpeSetTime((McpeSetTime) message);
else if (typeof(McpeStartGame) == message.GetType()) _messageHandler.HandleMcpeStartGame((McpeStartGame) message);
else if (typeof(McpeAddPlayer) == message.GetType()) _messageHandler.HandleMcpeAddPlayer((McpeAddPlayer) message);
else if (typeof(McpeAddEntity) == message.GetType()) _messageHandler.HandleMcpeAddEntity((McpeAddEntity) message);
else if (typeof(McpeRemoveEntity) == message.GetType()) _messageHandler.HandleMcpeRemoveEntity((McpeRemoveEntity) message);
else if (typeof(McpeAddItemEntity) == message.GetType()) _messageHandler.HandleMcpeAddItemEntity((McpeAddItemEntity) message);
else if (typeof(McpeTakeItemEntity) == message.GetType()) _messageHandler.HandleMcpeTakeItemEntity((McpeTakeItemEntity) message);
else if (typeof(McpeMoveEntity) == message.GetType()) _messageHandler.HandleMcpeMoveEntity((McpeMoveEntity) message);
else if (typeof(McpeMovePlayer) == message.GetType()) _messageHandler.HandleMcpeMovePlayer((McpeMovePlayer) message);
else if (typeof(McpeRiderJump) == message.GetType()) _messageHandler.HandleMcpeRiderJump((McpeRiderJump) message);
else if (typeof(McpeUpdateBlock) == message.GetType()) _messageHandler.HandleMcpeUpdateBlock((McpeUpdateBlock) message);
else if (typeof(McpeAddPainting) == message.GetType()) _messageHandler.HandleMcpeAddPainting((McpeAddPainting) message);
else if (typeof(McpeExplode) == message.GetType()) _messageHandler.HandleMcpeExplode((McpeExplode) message);
else if (typeof(McpeLevelSoundEventOld) == message.GetType()) _messageHandler.HandleMcpeLevelSoundEventOld((McpeLevelSoundEventOld) message);
else if (typeof(McpeLevelEvent) == message.GetType()) _messageHandler.HandleMcpeLevelEvent((McpeLevelEvent) message);
else if (typeof(McpeBlockEvent) == message.GetType()) _messageHandler.HandleMcpeBlockEvent((McpeBlockEvent) message);
else if (typeof(McpeEntityEvent) == message.GetType()) _messageHandler.HandleMcpeEntityEvent((McpeEntityEvent) message);
else if (typeof(McpeMobEffect) == message.GetType()) _messageHandler.HandleMcpeMobEffect((McpeMobEffect) message);
else if (typeof(McpeUpdateAttributes) == message.GetType()) _messageHandler.HandleMcpeUpdateAttributes((McpeUpdateAttributes) message);
else if (typeof(McpeInventoryTransaction) == message.GetType()) _messageHandler.HandleMcpeInventoryTransaction((McpeInventoryTransaction) message);
else if (typeof(McpeMobEquipment) == message.GetType()) _messageHandler.HandleMcpeMobEquipment((McpeMobEquipment) message);
else if (typeof(McpeMobArmorEquipment) == message.GetType()) _messageHandler.HandleMcpeMobArmorEquipment((McpeMobArmorEquipment) message);
else if (typeof(McpeInteract) == message.GetType()) _messageHandler.HandleMcpeInteract((McpeInteract) message);
else if (typeof(McpeHurtArmor) == message.GetType()) _messageHandler.HandleMcpeHurtArmor((McpeHurtArmor) message);
else if (typeof(McpeSetEntityData) == message.GetType()) _messageHandler.HandleMcpeSetEntityData((McpeSetEntityData) message);
else if (typeof(McpeSetEntityMotion) == message.GetType()) _messageHandler.HandleMcpeSetEntityMotion((McpeSetEntityMotion) message);
else if (typeof(McpeSetEntityLink) == message.GetType()) _messageHandler.HandleMcpeSetEntityLink((McpeSetEntityLink) message);
else if (typeof(McpeSetHealth) == message.GetType()) _messageHandler.HandleMcpeSetHealth((McpeSetHealth) message);
else if (typeof(McpeSetSpawnPosition) == message.GetType()) _messageHandler.HandleMcpeSetSpawnPosition((McpeSetSpawnPosition) message);
else if (typeof(McpeAnimate) == message.GetType()) _messageHandler.HandleMcpeAnimate((McpeAnimate) message);
else if (typeof(McpeRespawn) == message.GetType()) _messageHandler.HandleMcpeRespawn((McpeRespawn) message);
else if (typeof(McpeContainerOpen) == message.GetType()) _messageHandler.HandleMcpeContainerOpen((McpeContainerOpen) message);
else if (typeof(McpeContainerClose) == message.GetType()) _messageHandler.HandleMcpeContainerClose((McpeContainerClose) message);
else if (typeof(McpePlayerHotbar) == message.GetType()) _messageHandler.HandleMcpePlayerHotbar((McpePlayerHotbar) message);
else if (typeof(McpeInventoryContent) == message.GetType()) _messageHandler.HandleMcpeInventoryContent((McpeInventoryContent) message);
else if (typeof(McpeInventorySlot) == message.GetType()) _messageHandler.HandleMcpeInventorySlot((McpeInventorySlot) message);
else if (typeof(McpeContainerSetData) == message.GetType()) _messageHandler.HandleMcpeContainerSetData((McpeContainerSetData) message);
else if (typeof(McpeCraftingData) == message.GetType()) _messageHandler.HandleMcpeCraftingData((McpeCraftingData) message);
else if (typeof(McpeCraftingEvent) == message.GetType()) _messageHandler.HandleMcpeCraftingEvent((McpeCraftingEvent) message);
else if (typeof(McpeGuiDataPickItem) == message.GetType()) _messageHandler.HandleMcpeGuiDataPickItem((McpeGuiDataPickItem) message);
else if (typeof(McpeAdventureSettings) == message.GetType()) _messageHandler.HandleMcpeAdventureSettings((McpeAdventureSettings) message);
else if (typeof(McpeBlockEntityData) == message.GetType()) _messageHandler.HandleMcpeBlockEntityData((McpeBlockEntityData) message);
else if (typeof(McpeFullChunkData) == message.GetType()) _messageHandler.HandleMcpeFullChunkData((McpeFullChunkData) message);
else if (typeof(McpeSetCommandsEnabled) == message.GetType()) _messageHandler.HandleMcpeSetCommandsEnabled((McpeSetCommandsEnabled) message);
else if (typeof(McpeSetDifficulty) == message.GetType()) _messageHandler.HandleMcpeSetDifficulty((McpeSetDifficulty) message);
else if (typeof(McpeChangeDimension) == message.GetType()) _messageHandler.HandleMcpeChangeDimension((McpeChangeDimension) message);
else if (typeof(McpeSetPlayerGameType) == message.GetType()) _messageHandler.HandleMcpeSetPlayerGameType((McpeSetPlayerGameType) message);
else if (typeof(McpePlayerList) == message.GetType()) _messageHandler.HandleMcpePlayerList((McpePlayerList) message);
else if (typeof(McpeSimpleEvent) == message.GetType()) _messageHandler.HandleMcpeSimpleEvent((McpeSimpleEvent) message);
else if (typeof(McpeTelemetryEvent) == message.GetType()) _messageHandler.HandleMcpeTelemetryEvent((McpeTelemetryEvent) message);
else if (typeof(McpeSpawnExperienceOrb) == message.GetType()) _messageHandler.HandleMcpeSpawnExperienceOrb((McpeSpawnExperienceOrb) message);
else if (typeof(McpeClientboundMapItemData) == message.GetType()) _messageHandler.HandleMcpeClientboundMapItemData((McpeClientboundMapItemData) message);
else if (typeof(McpeMapInfoRequest) == message.GetType()) _messageHandler.HandleMcpeMapInfoRequest((McpeMapInfoRequest) message);
else if (typeof(McpeRequestChunkRadius) == message.GetType()) _messageHandler.HandleMcpeRequestChunkRadius((McpeRequestChunkRadius) message);
else if (typeof(McpeChunkRadiusUpdate) == message.GetType()) _messageHandler.HandleMcpeChunkRadiusUpdate((McpeChunkRadiusUpdate) message);
else if (typeof(McpeItemFrameDropItem) == message.GetType()) _messageHandler.HandleMcpeItemFrameDropItem((McpeItemFrameDropItem) message);
else if (typeof(McpeGameRulesChanged) == message.GetType()) _messageHandler.HandleMcpeGameRulesChanged((McpeGameRulesChanged) message);
else if (typeof(McpeCamera) == message.GetType()) _messageHandler.HandleMcpeCamera((McpeCamera) message);
else if (typeof(McpeBossEvent) == message.GetType()) _messageHandler.HandleMcpeBossEvent((McpeBossEvent) message);
else if (typeof(McpeShowCredits) == message.GetType()) _messageHandler.HandleMcpeShowCredits((McpeShowCredits) message);
else if (typeof(McpeAvailableCommands) == message.GetType()) _messageHandler.HandleMcpeAvailableCommands((McpeAvailableCommands) message);
else if (typeof(McpeCommandOutput) == message.GetType()) _messageHandler.HandleMcpeCommandOutput((McpeCommandOutput) message);
else if (typeof(McpeUpdateTrade) == message.GetType()) _messageHandler.HandleMcpeUpdateTrade((McpeUpdateTrade) message);
else if (typeof(McpeUpdateEquipment) == message.GetType()) _messageHandler.HandleMcpeUpdateEquipment((McpeUpdateEquipment) message);
else if (typeof(McpeResourcePackDataInfo) == message.GetType()) _messageHandler.HandleMcpeResourcePackDataInfo((McpeResourcePackDataInfo) message);
else if (typeof(McpeResourcePackChunkData) == message.GetType()) _messageHandler.HandleMcpeResourcePackChunkData((McpeResourcePackChunkData) message);
else if (typeof(McpeTransfer) == message.GetType()) _messageHandler.HandleMcpeTransfer((McpeTransfer) message);
else if (typeof(McpePlaySound) == message.GetType()) _messageHandler.HandleMcpePlaySound((McpePlaySound) message);
else if (typeof(McpeStopSound) == message.GetType()) _messageHandler.HandleMcpeStopSound((McpeStopSound) message);
else if (typeof(McpeSetTitle) == message.GetType()) _messageHandler.HandleMcpeSetTitle((McpeSetTitle) message);
else if (typeof(McpeAddBehaviorTree) == message.GetType()) _messageHandler.HandleMcpeAddBehaviorTree((McpeAddBehaviorTree) message);
else if (typeof(McpeStructureBlockUpdate) == message.GetType()) _messageHandler.HandleMcpeStructureBlockUpdate((McpeStructureBlockUpdate) message);
else if (typeof(McpeShowStoreOffer) == message.GetType()) _messageHandler.HandleMcpeShowStoreOffer((McpeShowStoreOffer) message);
else if (typeof(McpePlayerSkin) == message.GetType()) _messageHandler.HandleMcpePlayerSkin((McpePlayerSkin) message);
else if (typeof(McpeSubClientLogin) == message.GetType()) _messageHandler.HandleMcpeSubClientLogin((McpeSubClientLogin) message);
else if (typeof(McpeInitiateWebSocketConnection) == message.GetType()) _messageHandler.HandleMcpeInitiateWebSocketConnection((McpeInitiateWebSocketConnection) message);
else if (typeof(McpeSetLastHurtBy) == message.GetType()) _messageHandler.HandleMcpeSetLastHurtBy((McpeSetLastHurtBy) message);
else if (typeof(McpeBookEdit) == message.GetType()) _messageHandler.HandleMcpeBookEdit((McpeBookEdit) message);
else if (typeof(McpeNpcRequest) == message.GetType()) _messageHandler.HandleMcpeNpcRequest((McpeNpcRequest) message);
else if (typeof(McpeModalFormRequest) == message.GetType()) _messageHandler.HandleMcpeModalFormRequest((McpeModalFormRequest) message);
else if (typeof(McpeServerSettingsResponse) == message.GetType()) _messageHandler.HandleMcpeServerSettingsResponse((McpeServerSettingsResponse) message);
else if (typeof(McpeShowProfile) == message.GetType()) _messageHandler.HandleMcpeShowProfile((McpeShowProfile) message);
else if (typeof(McpeSetDefaultGameType) == message.GetType()) _messageHandler.HandleMcpeSetDefaultGameType((McpeSetDefaultGameType) message);
else if (typeof(McpeRemoveObjective) == message.GetType()) _messageHandler.HandleMcpeRemoveObjective((McpeRemoveObjective) message);
else if (typeof(McpeSetDisplayObjective) == message.GetType()) _messageHandler.HandleMcpeSetDisplayObjective((McpeSetDisplayObjective) message);
else if (typeof(McpeSetScore) == message.GetType()) _messageHandler.HandleMcpeSetScore((McpeSetScore) message);
else if (typeof(McpeLabTable) == message.GetType()) _messageHandler.HandleMcpeLabTable((McpeLabTable) message);
else if (typeof(McpeUpdateBlockSynced) == message.GetType()) _messageHandler.HandleMcpeUpdateBlockSynced((McpeUpdateBlockSynced) message);
else if (typeof(McpeMoveEntityDelta) == message.GetType()) _messageHandler.HandleMcpeMoveEntityDelta((McpeMoveEntityDelta) message);
else if (typeof(McpeSetScoreboardIdentityPacket) == message.GetType()) _messageHandler.HandleMcpeSetScoreboardIdentityPacket((McpeSetScoreboardIdentityPacket) message);
else if (typeof(McpeUpdateSoftEnumPacket) == message.GetType()) _messageHandler.HandleMcpeUpdateSoftEnumPacket((McpeUpdateSoftEnumPacket) message);
else if (typeof(McpeNetworkStackLatencyPacket) == message.GetType()) _messageHandler.HandleMcpeNetworkStackLatencyPacket((McpeNetworkStackLatencyPacket) message);
else if (typeof(McpeScriptCustomEventPacket) == message.GetType()) _messageHandler.HandleMcpeScriptCustomEventPacket((McpeScriptCustomEventPacket) message);
else if (typeof(McpeSpawnParticleEffect) == message.GetType()) _messageHandler.HandleMcpeSpawnParticleEffect((McpeSpawnParticleEffect) message);
else if (typeof(McpeAvailableEntityIdentifiers) == message.GetType()) _messageHandler.HandleMcpeAvailableEntityIdentifiers((McpeAvailableEntityIdentifiers) message);
else if (typeof(McpeLevelSoundEventV2) == message.GetType()) _messageHandler.HandleMcpeLevelSoundEventV2((McpeLevelSoundEventV2) message);
else if (typeof(McpeNetworkChunkPublisherUpdate) == message.GetType()) _messageHandler.HandleMcpeNetworkChunkPublisherUpdate((McpeNetworkChunkPublisherUpdate) message);
else if (typeof(McpeBiomeDefinitionList) == message.GetType()) _messageHandler.HandleMcpeBiomeDefinitionList((McpeBiomeDefinitionList) message);
else if (typeof(McpeLevelSoundEvent) == message.GetType()) _messageHandler.HandleMcpeLevelSoundEvent((McpeLevelSoundEvent) message);
else if (typeof(FtlCreatePlayer) == message.GetType()) _messageHandler.HandleFtlCreatePlayer((FtlCreatePlayer) message);
else return false;
return true;
}
}
public class PacketFactory
{
public static Packet Create(byte messageId, byte[] buffer, string ns)
{
Packet packet = null;
if(ns == "raknet")
{
switch (messageId)
{
case 0x00:
packet = ConnectedPing.CreateObject();
packet.Decode(buffer);
return packet;
case 0x01:
packet = UnconnectedPing.CreateObject();
packet.Decode(buffer);
return packet;
case 0x03:
packet = ConnectedPong.CreateObject();
packet.Decode(buffer);
return packet;
case 0x04:
packet = DetectLostConnections.CreateObject();
packet.Decode(buffer);
return packet;
case 0x1c:
packet = UnconnectedPong.CreateObject();
packet.Decode(buffer);
return packet;
case 0x05:
packet = OpenConnectionRequest1.CreateObject();
packet.Decode(buffer);
return packet;
case 0x06:
packet = OpenConnectionReply1.CreateObject();
packet.Decode(buffer);
return packet;
case 0x07:
packet = OpenConnectionRequest2.CreateObject();
packet.Decode(buffer);
return packet;
case 0x08:
packet = OpenConnectionReply2.CreateObject();
packet.Decode(buffer);
return packet;
case 0x09:
packet = ConnectionRequest.CreateObject();
packet.Decode(buffer);
return packet;
case 0x10:
packet = ConnectionRequestAccepted.CreateObject();
packet.Decode(buffer);
return packet;
case 0x13:
packet = NewIncomingConnection.CreateObject();
packet.Decode(buffer);
return packet;
case 0x14:
packet = NoFreeIncomingConnections.CreateObject();
packet.Decode(buffer);
return packet;
case 0x15:
packet = DisconnectionNotification.CreateObject();
packet.Decode(buffer);
return packet;
case 0x17:
packet = ConnectionBanned.CreateObject();
packet.Decode(buffer);
return packet;
case 0x1A:
packet = IpRecentlyConnected.CreateObject();
packet.Decode(buffer);
return packet;
case 0xfe:
packet = McpeWrapper.CreateObject();
packet.Decode(buffer);
return packet;
}
} else if(ns == "ftl")
{
switch (messageId)
{
case 0x01:
packet = FtlCreatePlayer.CreateObject();
packet.Decode(buffer);
return packet;
}
} else {
switch (messageId)
{
case 0x01:
packet = McpeLogin.CreateObject();
packet.Decode(buffer);
return packet;
case 0x02:
packet = McpePlayStatus.CreateObject();
packet.Decode(buffer);
return packet;
case 0x03:
packet = McpeServerToClientHandshake.CreateObject();
packet.Decode(buffer);
return packet;
case 0x04:
packet = McpeClientToServerHandshake.CreateObject();
packet.Decode(buffer);
return packet;
case 0x05:
packet = McpeDisconnect.CreateObject();
packet.Decode(buffer);
return packet;
case 0x06:
packet = McpeResourcePacksInfo.CreateObject();
packet.Decode(buffer);
return packet;
case 0x07:
packet = McpeResourcePackStack.CreateObject();
packet.Decode(buffer);
return packet;
case 0x08:
packet = McpeResourcePackClientResponse.CreateObject();
packet.Decode(buffer);
return packet;
case 0x09:
packet = McpeText.CreateObject();
packet.Decode(buffer);
return packet;
case 0x0a:
packet = McpeSetTime.CreateObject();
packet.Decode(buffer);
return packet;
case 0x0b:
packet = McpeStartGame.CreateObject();
packet.Decode(buffer);
return packet;
case 0x0c:
packet = McpeAddPlayer.CreateObject();
packet.Decode(buffer);
return packet;
case 0x0d:
packet = McpeAddEntity.CreateObject();
packet.Decode(buffer);
return packet;
case 0x0e:
packet = McpeRemoveEntity.CreateObject();
packet.Decode(buffer);
return packet;
case 0x0f:
packet = McpeAddItemEntity.CreateObject();
packet.Decode(buffer);
return packet;
case 0x11:
packet = McpeTakeItemEntity.CreateObject();
packet.Decode(buffer);
return packet;
case 0x12:
packet = McpeMoveEntity.CreateObject();
packet.Decode(buffer);
return packet;
case 0x13:
packet = McpeMovePlayer.CreateObject();
packet.Decode(buffer);
return packet;
case 0x14:
packet = McpeRiderJump.CreateObject();
packet.Decode(buffer);
return packet;
case 0x15:
packet = McpeUpdateBlock.CreateObject();
packet.Decode(buffer);
return packet;
case 0x16:
packet = McpeAddPainting.CreateObject();
packet.Decode(buffer);
return packet;
case 0x17:
packet = McpeExplode.CreateObject();
packet.Decode(buffer);
return packet;
case 0x18:
packet = McpeLevelSoundEventOld.CreateObject();
packet.Decode(buffer);
return packet;
case 0x19:
packet = McpeLevelEvent.CreateObject();
packet.Decode(buffer);
return packet;
case 0x1a:
packet = McpeBlockEvent.CreateObject();
packet.Decode(buffer);
return packet;
case 0x1b:
packet = McpeEntityEvent.CreateObject();
packet.Decode(buffer);
return packet;
case 0x1c:
packet = McpeMobEffect.CreateObject();
packet.Decode(buffer);
return packet;
case 0x1d:
packet = McpeUpdateAttributes.CreateObject();
packet.Decode(buffer);
return packet;
case 0x1e:
packet = McpeInventoryTransaction.CreateObject();
packet.Decode(buffer);
return packet;
case 0x1f:
packet = McpeMobEquipment.CreateObject();
packet.Decode(buffer);
return packet;
case 0x20:
packet = McpeMobArmorEquipment.CreateObject();
packet.Decode(buffer);
return packet;
case 0x21:
packet = McpeInteract.CreateObject();
packet.Decode(buffer);
return packet;
case 0x22:
packet = McpeBlockPickRequest.CreateObject();
packet.Decode(buffer);
return packet;
case 0x23:
packet = McpeEntityPickRequest.CreateObject();
packet.Decode(buffer);
return packet;
case 0x24:
packet = McpePlayerAction.CreateObject();
packet.Decode(buffer);
return packet;
case 0x25:
packet = McpeEntityFall.CreateObject();
packet.Decode(buffer);
return packet;
case 0x26:
packet = McpeHurtArmor.CreateObject();
packet.Decode(buffer);
return packet;
case 0x27:
packet = McpeSetEntityData.CreateObject();
packet.Decode(buffer);
return packet;
case 0x28:
packet = McpeSetEntityMotion.CreateObject();
packet.Decode(buffer);
return packet;
case 0x29:
packet = McpeSetEntityLink.CreateObject();
packet.Decode(buffer);
return packet;
case 0x2a:
packet = McpeSetHealth.CreateObject();
packet.Decode(buffer);
return packet;
case 0x2b:
packet = McpeSetSpawnPosition.CreateObject();
packet.Decode(buffer);
return packet;
case 0x2c:
packet = McpeAnimate.CreateObject();
packet.Decode(buffer);
return packet;
case 0x2d:
packet = McpeRespawn.CreateObject();
packet.Decode(buffer);
return packet;
case 0x2e:
packet = McpeContainerOpen.CreateObject();
packet.Decode(buffer);
return packet;
case 0x2f:
packet = McpeContainerClose.CreateObject();
packet.Decode(buffer);
return packet;
case 0x30:
packet = McpePlayerHotbar.CreateObject();
packet.Decode(buffer);
return packet;
case 0x31:
packet = McpeInventoryContent.CreateObject();
packet.Decode(buffer);
return packet;
case 0x32:
packet = McpeInventorySlot.CreateObject();
packet.Decode(buffer);
return packet;
case 0x33:
packet = McpeContainerSetData.CreateObject();
packet.Decode(buffer);
return packet;
case 0x34:
packet = McpeCraftingData.CreateObject();
packet.Decode(buffer);
return packet;
case 0x35:
packet = McpeCraftingEvent.CreateObject();
packet.Decode(buffer);
return packet;
case 0x36:
packet = McpeGuiDataPickItem.CreateObject();
packet.Decode(buffer);
return packet;
case 0x37:
packet = McpeAdventureSettings.CreateObject();
packet.Decode(buffer);
return packet;
case 0x38:
packet = McpeBlockEntityData.CreateObject();
packet.Decode(buffer);
return packet;
case 0x39:
packet = McpePlayerInput.CreateObject();
packet.Decode(buffer);
return packet;
case 0x3a:
packet = McpeFullChunkData.CreateObject();
packet.Decode(buffer);
return packet;
case 0x3b:
packet = McpeSetCommandsEnabled.CreateObject();
packet.Decode(buffer);
return packet;
case 0x3c:
packet = McpeSetDifficulty.CreateObject();
packet.Decode(buffer);
return packet;
case 0x3d:
packet = McpeChangeDimension.CreateObject();
packet.Decode(buffer);
return packet;
case 0x3e:
packet = McpeSetPlayerGameType.CreateObject();
packet.Decode(buffer);
return packet;
case 0x3f:
packet = McpePlayerList.CreateObject();
packet.Decode(buffer);
return packet;
case 0x40:
packet = McpeSimpleEvent.CreateObject();
packet.Decode(buffer);
return packet;
case 0x41:
packet = McpeTelemetryEvent.CreateObject();
packet.Decode(buffer);
return packet;
case 0x42:
packet = McpeSpawnExperienceOrb.CreateObject();
packet.Decode(buffer);
return packet;
case 0x43:
packet = McpeClientboundMapItemData.CreateObject();
packet.Decode(buffer);
return packet;
case 0x44:
packet = McpeMapInfoRequest.CreateObject();
packet.Decode(buffer);
return packet;
case 0x45:
packet = McpeRequestChunkRadius.CreateObject();
packet.Decode(buffer);
return packet;
case 0x46:
packet = McpeChunkRadiusUpdate.CreateObject();
packet.Decode(buffer);
return packet;
case 0x47:
packet = McpeItemFrameDropItem.CreateObject();
packet.Decode(buffer);
return packet;
case 0x48:
packet = McpeGameRulesChanged.CreateObject();
packet.Decode(buffer);
return packet;
case 0x49:
packet = McpeCamera.CreateObject();
packet.Decode(buffer);
return packet;
case 0x4a:
packet = McpeBossEvent.CreateObject();
packet.Decode(buffer);
return packet;
case 0x4b:
packet = McpeShowCredits.CreateObject();
packet.Decode(buffer);
return packet;
case 0x4c:
packet = McpeAvailableCommands.CreateObject();
packet.Decode(buffer);
return packet;
case 0x4d:
packet = McpeCommandRequest.CreateObject();
packet.Decode(buffer);
return packet;
case 0x4e:
packet = McpeCommandBlockUpdate.CreateObject();
packet.Decode(buffer);
return packet;
case 0x4f:
packet = McpeCommandOutput.CreateObject();
packet.Decode(buffer);
return packet;
case 0x50:
packet = McpeUpdateTrade.CreateObject();
packet.Decode(buffer);
return packet;
case 0x51:
packet = McpeUpdateEquipment.CreateObject();
packet.Decode(buffer);
return packet;
case 0x52:
packet = McpeResourcePackDataInfo.CreateObject();
packet.Decode(buffer);
return packet;
case 0x53:
packet = McpeResourcePackChunkData.CreateObject();
packet.Decode(buffer);
return packet;
case 0x54:
packet = McpeResourcePackChunkRequest.CreateObject();
packet.Decode(buffer);
return packet;
case 0x55:
packet = McpeTransfer.CreateObject();
packet.Decode(buffer);
return packet;
case 0x56:
packet = McpePlaySound.CreateObject();
packet.Decode(buffer);
return packet;
case 0x57:
packet = McpeStopSound.CreateObject();
packet.Decode(buffer);
return packet;
case 0x58:
packet = McpeSetTitle.CreateObject();
packet.Decode(buffer);
return packet;
case 0x59:
packet = McpeAddBehaviorTree.CreateObject();
packet.Decode(buffer);
return packet;
case 0x5a:
packet = McpeStructureBlockUpdate.CreateObject();
packet.Decode(buffer);
return packet;
case 0x5b:
packet = McpeShowStoreOffer.CreateObject();
packet.Decode(buffer);
return packet;
case 0x5c:
packet = McpePurchaseReceipt.CreateObject();
packet.Decode(buffer);
return packet;
case 0x5d:
packet = McpePlayerSkin.CreateObject();
packet.Decode(buffer);
return packet;
case 0x5e:
packet = McpeSubClientLogin.CreateObject();
packet.Decode(buffer);
return packet;
case 0x5f:
packet = McpeInitiateWebSocketConnection.CreateObject();
packet.Decode(buffer);
return packet;
case 0x60:
packet = McpeSetLastHurtBy.CreateObject();
packet.Decode(buffer);
return packet;
case 0x61:
packet = McpeBookEdit.CreateObject();
packet.Decode(buffer);
return packet;
case 0x62:
packet = McpeNpcRequest.CreateObject();
packet.Decode(buffer);
return packet;
case 0x63:
packet = McpePhotoTransfer.CreateObject();
packet.Decode(buffer);
return packet;
case 0x64:
packet = McpeModalFormRequest.CreateObject();
packet.Decode(buffer);
return packet;
case 0x65:
packet = McpeModalFormResponse.CreateObject();
packet.Decode(buffer);
return packet;
case 0x66:
packet = McpeServerSettingsRequest.CreateObject();
packet.Decode(buffer);
return packet;
case 0x67:
packet = McpeServerSettingsResponse.CreateObject();
packet.Decode(buffer);
return packet;
case 0x68:
packet = McpeShowProfile.CreateObject();
packet.Decode(buffer);
return packet;
case 0x69:
packet = McpeSetDefaultGameType.CreateObject();
packet.Decode(buffer);
return packet;
case 0x6a:
packet = McpeRemoveObjective.CreateObject();
packet.Decode(buffer);
return packet;
case 0x6b:
packet = McpeSetDisplayObjective.CreateObject();
packet.Decode(buffer);
return packet;
case 0x6c:
packet = McpeSetScore.CreateObject();
packet.Decode(buffer);
return packet;
case 0x6d:
packet = McpeLabTable.CreateObject();
packet.Decode(buffer);
return packet;
case 0x6e:
packet = McpeUpdateBlockSynced.CreateObject();
packet.Decode(buffer);
return packet;
case 0x6f:
packet = McpeMoveEntityDelta.CreateObject();
packet.Decode(buffer);
return packet;
case 0x70:
packet = McpeSetScoreboardIdentityPacket.CreateObject();
packet.Decode(buffer);
return packet;
case 0x71:
packet = McpeSetLocalPlayerAsInitializedPacket.CreateObject();
packet.Decode(buffer);
return packet;
case 0x72:
packet = McpeUpdateSoftEnumPacket.CreateObject();
packet.Decode(buffer);
return packet;
case 0x73:
packet = McpeNetworkStackLatencyPacket.CreateObject();
packet.Decode(buffer);
return packet;
case 0x75:
packet = McpeScriptCustomEventPacket.CreateObject();
packet.Decode(buffer);
return packet;
case 0x76:
packet = McpeSpawnParticleEffect.CreateObject();
packet.Decode(buffer);
return packet;
case 0x77:
packet = McpeAvailableEntityIdentifiers.CreateObject();
packet.Decode(buffer);
return packet;
case 0x78:
packet = McpeLevelSoundEventV2.CreateObject();
packet.Decode(buffer);
return packet;
case 0x79:
packet = McpeNetworkChunkPublisherUpdate.CreateObject();
packet.Decode(buffer);
return packet;
case 0x7a:
packet = McpeBiomeDefinitionList.CreateObject();
packet.Decode(buffer);
return packet;
case 0x7b:
packet = McpeLevelSoundEvent.CreateObject();
packet.Decode(buffer);
return packet;
}
}
return null;
}
}
public enum AdventureFlags
{
Mayfly = 0x40,
Noclip = 0x80,
Worldbuilder = 0x100,
Flying = 0x200,
Muted = 0x400,
}
public enum CommandPermission
{
Normal = 0,
Operator = 1,
Host = 2,
Automation = 3,
Admin = 4,
}
public enum PermissionLevel
{
Visitor = 0,
Member = 1,
Operator = 2,
Custom = 3,
}
public enum ActionPermissions
{
BuildAndMine = 0x1,
DoorsAndSwitches = 0x2,
OpenContainers = 0x4,
AttackPlayers = 0x8,
AttackMobs = 0x10,
Operator = 0x20,
Teleport = 0x80,
Default = (BuildAndMine | DoorsAndSwitches | OpenContainers | AttackPlayers | AttackMobs ),
All = (BuildAndMine | DoorsAndSwitches | OpenContainers | AttackPlayers | AttackMobs | Operator | Teleport),
}
public partial class ConnectedPing : Packet<ConnectedPing>
{
public long sendpingtime; // = null;
public ConnectedPing()
{
Id = 0x00;
IsMcpe = false;
}
protected override void EncodePacket()
{
base.EncodePacket();
BeforeEncode();
Write(sendpingtime);
AfterEncode();
}
partial void BeforeEncode();
partial void AfterEncode();
protected override void DecodePacket()
{
base.DecodePacket();
BeforeDecode();
sendpingtime = ReadLong();
AfterDecode();
}
partial void BeforeDecode();
partial void AfterDecode();
protected override void ResetPacket()
{
base.ResetPacket();
sendpingtime=default(long);
}