|
38 | 38 | using MiNET.Utils.Metadata; |
39 | 39 | using MiNET.Utils.Vectors; |
40 | 40 | using MiNET.Utils.Nbt; |
| 41 | +using System.Linq; |
41 | 42 |
|
42 | 43 | namespace MiNET.Net |
43 | 44 | { |
@@ -250,6 +251,7 @@ public interface IMcpeClientMessageHandler |
250 | 251 | void HandleMcpeEmoteList(McpeEmoteList message); |
251 | 252 | void HandleMcpePermissionRequest(McpePermissionRequest message); |
252 | 253 | void HandleMcpePlayerFog(McpePlayerFog message); |
| 254 | + void HandleMcpeAnimateEntity(McpeAnimateEntity message); |
253 | 255 | } |
254 | 256 |
|
255 | 257 | public class McpeClientMessageDispatcher |
@@ -661,6 +663,9 @@ public bool HandlePacket(Packet message) |
661 | 663 | case McpePlayerFog msg: |
662 | 664 | _messageHandler.HandleMcpePlayerFog(msg); |
663 | 665 | break; |
| 666 | + case McpeAnimateEntity msg: |
| 667 | + _messageHandler.HandleMcpeAnimateEntity(msg); |
| 668 | + break; |
664 | 669 | default: |
665 | 670 | return false; |
666 | 671 | } |
@@ -10927,5 +10932,81 @@ protected override void ResetPacket() |
10927 | 10932 |
|
10928 | 10933 | } |
10929 | 10934 | } |
| 10935 | + public partial class McpeAnimateEntity : Packet<McpeAnimateEntity> |
| 10936 | + { |
| 10937 | + |
| 10938 | + public string animationName; // = null; |
| 10939 | + public string nextState; // = null; |
| 10940 | + public string stopExpression; // = null; |
| 10941 | + public int molangVersion; // = null; |
| 10942 | + public string controllerName; // = null; |
| 10943 | + public float blendOutTime; // = null; |
| 10944 | + public long[] entities; // = null; |
| 10945 | + |
| 10946 | + public McpeAnimateEntity() |
| 10947 | + { |
| 10948 | + Id = 0x9e; |
| 10949 | + IsMcpe = true; |
| 10950 | + } |
| 10951 | + |
| 10952 | + protected override void EncodePacket() |
| 10953 | + { |
| 10954 | + base.EncodePacket(); |
| 10955 | + |
| 10956 | + BeforeEncode(); |
| 10957 | + |
| 10958 | + Write(animationName); |
| 10959 | + Write(nextState); |
| 10960 | + Write(stopExpression); |
| 10961 | + Write(molangVersion); |
| 10962 | + Write(controllerName); |
| 10963 | + Write(blendOutTime); |
| 10964 | + WriteUnsignedVarInt((uint)entities.Count()); |
| 10965 | + for (int i = 0; i < entities.Count(); i++) |
| 10966 | + { |
| 10967 | + WriteUnsignedVarLong(entities[i]); |
| 10968 | + } |
| 10969 | + |
| 10970 | + AfterEncode(); |
| 10971 | + } |
| 10972 | + |
| 10973 | + partial void BeforeEncode(); |
| 10974 | + partial void AfterEncode(); |
10930 | 10975 |
|
| 10976 | + protected override void DecodePacket() |
| 10977 | + { |
| 10978 | + base.DecodePacket(); |
| 10979 | + |
| 10980 | + BeforeDecode(); |
| 10981 | + |
| 10982 | + animationName = ReadString(); |
| 10983 | + nextState = ReadString(); |
| 10984 | + stopExpression = ReadString(); |
| 10985 | + molangVersion = ReadInt(); |
| 10986 | + controllerName = ReadString(); |
| 10987 | + blendOutTime = ReadFloat(); |
| 10988 | + for (int i = 0; i < ReadUnsignedVarInt(); i++) |
| 10989 | + { |
| 10990 | + entities[i] = ReadUnsignedVarLong(); |
| 10991 | + } |
| 10992 | + |
| 10993 | + AfterDecode(); |
| 10994 | + } |
| 10995 | + |
| 10996 | + partial void BeforeDecode(); |
| 10997 | + partial void AfterDecode(); |
| 10998 | + |
| 10999 | + protected override void ResetPacket() |
| 11000 | + { |
| 11001 | + base.ResetPacket(); |
| 11002 | + |
| 11003 | + animationName = default(string); |
| 11004 | + nextState = default(string); |
| 11005 | + stopExpression = default(string); |
| 11006 | + molangVersion = default(int); |
| 11007 | + controllerName = default(string); |
| 11008 | + blendOutTime = default(float); |
| 11009 | + entities = default(long[]); |
| 11010 | + } |
| 11011 | + } |
10931 | 11012 | } |
0 commit comments