Skip to content

Commit e4d5b51

Browse files
committed
1.21.70
1 parent 21d650f commit e4d5b51

File tree

10 files changed

+2813
-2931
lines changed

10 files changed

+2813
-2931
lines changed

src/MiNET/MiNET.Client/BedrockTraceHandler.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,11 @@ public override void HandleMcpeAddEntity(McpeAddEntity message)
406406
Client._mobWriter.Flush();
407407
}
408408

409+
if (message.entityType == "minecraft:pig")
410+
{
411+
Log.Warn(JsonConvert.SerializeObject(message, Formatting.Indented));
412+
}
413+
409414
if (message.entityType == "minecraft:horse")
410415
{
411416
var id = message.runtimeEntityId;

src/MiNET/MiNET.Client/McpeClientMessageHandlerBase.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,6 @@ public virtual void HandleMcpeAddPainting(McpeAddPainting message)
242242
{
243243
}
244244

245-
public virtual void HandleMcpeLevelSoundEventOld(McpeLevelSoundEventOld message)
246-
{
247-
}
248-
249245
public virtual void HandleMcpeLevelEvent(McpeLevelEvent message)
250246
{
251247
}
@@ -637,10 +633,6 @@ public virtual void HandleMcpeAvailableEntityIdentifiers(McpeAvailableEntityIden
637633
{
638634
}
639635

640-
public virtual void HandleMcpeLevelSoundEventV2(McpeLevelSoundEventV2 message)
641-
{
642-
}
643-
644636
public virtual void HandleMcpeNetworkChunkPublisherUpdate(McpeNetworkChunkPublisherUpdate message)
645637
{
646638
}

src/MiNET/MiNET/Entities/Entity.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,11 @@ public enum DataFlags
549549
Timer2 = 116,
550550
Timer3 = 117,
551551
BodyRotationBlocked = 118,
552-
RendersWhenInvisible = 119
552+
RendersWhenInvisible = 119,
553+
BodyRotationAxisAligned = 120,
554+
Collidable = 121,
555+
WasdAirControlled = 122,
556+
Count = 123
553557
}
554558

555559
protected virtual BitArray GetFlags()
@@ -659,6 +663,7 @@ public virtual void SpawnToPlayers(Player[] players)
659663
addEntity.speedX = Velocity.X;
660664
addEntity.speedY = Velocity.Y;
661665
addEntity.speedZ = Velocity.Z;
666+
addEntity.syncdata = new PropertySyncData() { intProperties = new Dictionary<uint, int>() { { 0, 0 } } }; //todo
662667
addEntity.attributes = GetEntityAttributes();
663668

664669
Level.RelayBroadcast(players, addEntity);

src/MiNET/MiNET/LoginMessageHandler.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -757,18 +757,10 @@ public void HandleMcpeSetLocalPlayerAsInitialized(McpeSetLocalPlayerAsInitialize
757757
{
758758
}
759759

760-
public void HandleMcpeLevelSoundEventOld(McpeLevelSoundEventOld message)
761-
{
762-
}
763-
764760
public void HandleMcpeNetworkStackLatency(McpeNetworkStackLatency message)
765761
{
766762
}
767763

768-
public void HandleMcpeLevelSoundEventV2(McpeLevelSoundEventV2 message)
769-
{
770-
}
771-
772764
public void HandleMcpeScriptCustomEvent(McpeScriptCustomEvent message)
773765
{
774766
}

src/MiNET/MiNET/Net/MCPE Protocol.cs

Lines changed: 8 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ namespace MiNET.Net
4545
{
4646
public class McpeProtocolInfo
4747
{
48-
public const int ProtocolVersion = 776;
49-
public const string GameVersion = "1.21.60";
48+
public const int ProtocolVersion = 786;
49+
public const string GameVersion = "1.21.70";
5050
}
5151

5252
public interface IMcpeMessageHandler
@@ -60,7 +60,6 @@ public interface IMcpeMessageHandler
6060
void HandleMcpeMoveEntity(McpeMoveEntity message);
6161
void HandleMcpeMovePlayer(McpeMovePlayer message);
6262
void HandleMcpeRiderJump(McpeRiderJump message);
63-
void HandleMcpeLevelSoundEventOld(McpeLevelSoundEventOld message);
6463
void HandleMcpeEntityEvent(McpeEntityEvent message);
6564
void HandleMcpeInventoryTransaction(McpeInventoryTransaction message);
6665
void HandleMcpeMobEquipment(McpeMobEquipment message);
@@ -97,7 +96,6 @@ public interface IMcpeMessageHandler
9796
void HandleMcpeSetLocalPlayerAsInitialized(McpeSetLocalPlayerAsInitialized message);
9897
void HandleMcpeNetworkStackLatency(McpeNetworkStackLatency message);
9998
void HandleMcpeScriptCustomEvent(McpeScriptCustomEvent message);
100-
void HandleMcpeLevelSoundEventV2(McpeLevelSoundEventV2 message);
10199
void HandleMcpeLevelSoundEvent(McpeLevelSoundEvent message);
102100
void HandleMcpeClientCacheStatus(McpeClientCacheStatus message);
103101
void HandleMcpeNetworkSettings(McpeNetworkSettings message);
@@ -138,7 +136,6 @@ public interface IMcpeClientMessageHandler
138136
void HandleMcpeRiderJump(McpeRiderJump message);
139137
void HandleMcpeUpdateBlock(McpeUpdateBlock message);
140138
void HandleMcpeAddPainting(McpeAddPainting message);
141-
void HandleMcpeLevelSoundEventOld(McpeLevelSoundEventOld message);
142139
void HandleMcpeLevelEvent(McpeLevelEvent message);
143140
void HandleMcpeBlockEvent(McpeBlockEvent message);
144141
void HandleMcpeEntityEvent(McpeEntityEvent message);
@@ -219,7 +216,6 @@ public interface IMcpeClientMessageHandler
219216
void HandleMcpeScriptCustomEvent(McpeScriptCustomEvent message);
220217
void HandleMcpeSpawnParticleEffect(McpeSpawnParticleEffect message);
221218
void HandleMcpeAvailableEntityIdentifiers(McpeAvailableEntityIdentifiers message);
222-
void HandleMcpeLevelSoundEventV2(McpeLevelSoundEventV2 message);
223219
void HandleMcpeNetworkChunkPublisherUpdate(McpeNetworkChunkPublisherUpdate message);
224220
void HandleMcpeBiomeDefinitionList(McpeBiomeDefinitionList message);
225221
void HandleMcpeLevelSoundEvent(McpeLevelSoundEvent message);
@@ -323,9 +319,6 @@ public bool HandlePacket(Packet message)
323319
case McpeAddPainting msg:
324320
_messageHandler.HandleMcpeAddPainting(msg);
325321
break;
326-
case McpeLevelSoundEventOld msg:
327-
_messageHandler.HandleMcpeLevelSoundEventOld(msg);
328-
break;
329322
case McpeLevelEvent msg:
330323
_messageHandler.HandleMcpeLevelEvent(msg);
331324
break;
@@ -566,9 +559,6 @@ public bool HandlePacket(Packet message)
566559
case McpeAvailableEntityIdentifiers msg:
567560
_messageHandler.HandleMcpeAvailableEntityIdentifiers(msg);
568561
break;
569-
case McpeLevelSoundEventV2 msg:
570-
_messageHandler.HandleMcpeLevelSoundEventV2(msg);
571-
break;
572562
case McpeNetworkChunkPublisherUpdate msg:
573563
_messageHandler.HandleMcpeNetworkChunkPublisherUpdate(msg);
574564
break;
@@ -780,7 +770,7 @@ public static Packet Create(short messageId, ReadOnlyMemory<byte> buffer, string
780770
case 0x17:
781771
//Deprecated McpeTickSync
782772
case 0x18:
783-
return McpeLevelSoundEventOld.CreateObject().Decode(buffer);
773+
//Deprecated McpeLevelSoundEventOld
784774
case 0x19:
785775
return McpeLevelEvent.CreateObject().Decode(buffer);
786776
case 0x1a:
@@ -965,8 +955,6 @@ public static Packet Create(short messageId, ReadOnlyMemory<byte> buffer, string
965955
return McpeSpawnParticleEffect.CreateObject().Decode(buffer);
966956
case 0x77:
967957
return McpeAvailableEntityIdentifiers.CreateObject().Decode(buffer);
968-
case 0x78:
969-
return McpeLevelSoundEventV2.CreateObject().Decode(buffer);
970958
case 0x79:
971959
return McpeNetworkChunkPublisherUpdate.CreateObject().Decode(buffer);
972960
case 0x7a:
@@ -3342,75 +3330,6 @@ protected override void ResetPacket()
33423330

33433331
}
33443332

3345-
3346-
public partial class McpeLevelSoundEventOld : Packet<McpeLevelSoundEventOld>
3347-
{
3348-
3349-
public byte soundId; // = null;
3350-
public Vector3 position; // = null;
3351-
public int blockId; // = null;
3352-
public int entityType; // = null;
3353-
public bool isBabyMob; // = null;
3354-
public bool isGlobal; // = null;
3355-
3356-
public McpeLevelSoundEventOld()
3357-
{
3358-
Id = 0x18;
3359-
IsMcpe = true;
3360-
}
3361-
3362-
protected override void EncodePacket()
3363-
{
3364-
base.EncodePacket();
3365-
3366-
BeforeEncode();
3367-
3368-
Write(soundId);
3369-
Write(position);
3370-
WriteSignedVarInt(blockId);
3371-
WriteSignedVarInt(entityType);
3372-
Write(isBabyMob);
3373-
Write(isGlobal);
3374-
3375-
AfterEncode();
3376-
}
3377-
3378-
partial void BeforeEncode();
3379-
partial void AfterEncode();
3380-
3381-
protected override void DecodePacket()
3382-
{
3383-
base.DecodePacket();
3384-
3385-
BeforeDecode();
3386-
3387-
soundId = ReadByte();
3388-
position = ReadVector3();
3389-
blockId = ReadSignedVarInt();
3390-
entityType = ReadSignedVarInt();
3391-
isBabyMob = ReadBool();
3392-
isGlobal = ReadBool();
3393-
3394-
AfterDecode();
3395-
}
3396-
3397-
partial void BeforeDecode();
3398-
partial void AfterDecode();
3399-
3400-
protected override void ResetPacket()
3401-
{
3402-
base.ResetPacket();
3403-
3404-
soundId=default(byte);
3405-
position=default(Vector3);
3406-
blockId=default(int);
3407-
entityType=default(int);
3408-
isBabyMob=default(bool);
3409-
isGlobal=default(bool);
3410-
}
3411-
3412-
}
3413-
34143333
public partial class McpeLevelEvent : Packet<McpeLevelEvent>
34153334
{
34163335

@@ -8610,74 +8529,6 @@ protected override void ResetPacket()
86108529

86118530
}
86128531

8613-
public partial class McpeLevelSoundEventV2 : Packet<McpeLevelSoundEventV2>
8614-
{
8615-
8616-
public byte soundId; // = null;
8617-
public Vector3 position; // = null;
8618-
public int blockId; // = null;
8619-
public string entityType; // = null;
8620-
public bool isBabyMob; // = null;
8621-
public bool isGlobal; // = null;
8622-
8623-
public McpeLevelSoundEventV2()
8624-
{
8625-
Id = 0x78;
8626-
IsMcpe = true;
8627-
}
8628-
8629-
protected override void EncodePacket()
8630-
{
8631-
base.EncodePacket();
8632-
8633-
BeforeEncode();
8634-
8635-
Write(soundId);
8636-
Write(position);
8637-
WriteSignedVarInt(blockId);
8638-
Write(entityType);
8639-
Write(isBabyMob);
8640-
Write(isGlobal);
8641-
8642-
AfterEncode();
8643-
}
8644-
8645-
partial void BeforeEncode();
8646-
partial void AfterEncode();
8647-
8648-
protected override void DecodePacket()
8649-
{
8650-
base.DecodePacket();
8651-
8652-
BeforeDecode();
8653-
8654-
soundId = ReadByte();
8655-
position = ReadVector3();
8656-
blockId = ReadSignedVarInt();
8657-
entityType = ReadString();
8658-
isBabyMob = ReadBool();
8659-
isGlobal = ReadBool();
8660-
8661-
AfterDecode();
8662-
}
8663-
8664-
partial void BeforeDecode();
8665-
partial void AfterDecode();
8666-
8667-
protected override void ResetPacket()
8668-
{
8669-
base.ResetPacket();
8670-
8671-
soundId=default(byte);
8672-
position=default(Vector3);
8673-
blockId=default(int);
8674-
entityType=default(string);
8675-
isBabyMob=default(bool);
8676-
isGlobal=default(bool);
8677-
}
8678-
8679-
}
8680-
86818532
public partial class McpeNetworkChunkPublisherUpdate : Packet<McpeNetworkChunkPublisherUpdate>
86828533
{
86838534

@@ -8801,6 +8652,7 @@ public partial class McpeLevelSoundEvent : Packet<McpeLevelSoundEvent>
88018652
public string entityType; // = null;
88028653
public bool isBabyMob; // = null;
88038654
public bool isGlobal; // = null;
8655+
public long entityId = -1;
88048656

88058657
public McpeLevelSoundEvent()
88068658
{
@@ -8820,6 +8672,7 @@ protected override void EncodePacket()
88208672
Write(entityType);
88218673
Write(isBabyMob);
88228674
Write(isGlobal);
8675+
Write(entityId);
88238676

88248677
AfterEncode();
88258678
}
@@ -8839,6 +8692,7 @@ protected override void DecodePacket()
88398692
entityType = ReadString();
88408693
isBabyMob = ReadBool();
88418694
isGlobal = ReadBool();
8695+
entityId = ReadLong();
88428696

88438697
AfterDecode();
88448698
}
@@ -8856,6 +8710,7 @@ protected override void ResetPacket()
88568710
entityType=default(string);
88578711
isBabyMob=default(bool);
88588712
isGlobal=default(bool);
8713+
entityId=default(long);
88598714
}
88608715

88618716
}
@@ -8895,7 +8750,7 @@ protected override void DecodePacket()
88958750

88968751
eventId = ReadSignedVarInt();
88978752
//eventData = ReadNbt(); todo wrong
8898-
for (byte i = 0; i < 62; i++) //shhhh
8753+
for (byte i = 0; i < 60; i++) //shhhh
88998754
{
89008755
ReadByte();
89018756
}

src/MiNET/MiNET/Net/Packet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,7 +2148,7 @@ public Itemstates ReadItemstates()
21482148

21492149
byte[] componentValue = new byte[0];
21502150

2151-
if (component && components.NbtFile.RootTag["components"] != null)
2151+
if (components.NbtFile.RootTag["components"] != null)
21522152
{
21532153
using (MemoryStream stream = new MemoryStream())
21542154
{
@@ -2198,7 +2198,7 @@ public void Write(Itemstates itemstates)
21982198
RootTag = new NbtCompound("")
21992199
}
22002200
};
2201-
if (itemstate.ComponentBased && itemstate.Components.Count() > 0)
2201+
if (itemstate.Components.Count() > 0)
22022202
{
22032203
using (MemoryStream stream = new MemoryStream(itemstate.Components))
22042204
{

src/MiNET/MiNET/Player.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,18 +2190,6 @@ public bool CheckOnGround(PlayerLocation message)
21902190
return false;
21912191
}
21922192

2193-
public virtual void HandleMcpeLevelSoundEventOld(McpeLevelSoundEventOld message)
2194-
{
2195-
var sound = McpeLevelSoundEventOld.CreateObject();
2196-
sound.soundId = message.soundId;
2197-
sound.position = message.position;
2198-
sound.blockId = message.blockId;
2199-
sound.entityType = message.entityType;
2200-
sound.isBabyMob = message.isBabyMob;
2201-
sound.isGlobal = message.isGlobal;
2202-
Level.RelayBroadcast(sound);
2203-
}
2204-
22052193
public virtual void HandleMcpeLevelSoundEvent(McpeLevelSoundEvent message)
22062194
{
22072195
//TODO: This will require that sounds are sent by the server.
@@ -4386,10 +4374,6 @@ public virtual void HandleMcpeNetworkStackLatency(McpeNetworkStackLatency messag
43864374
SendPacket(packet);
43874375
}
43884376

4389-
public virtual void HandleMcpeLevelSoundEventV2(McpeLevelSoundEventV2 message)
4390-
{
4391-
}
4392-
43934377
public virtual void HandleMcpeSetInventoryOptions(McpeSetInventoryOptions message)
43944378
{
43954379
Log.Debug($"InventoryOptions: leftTab={message.leftTab}, rightTab={message.rightTab}, filtering={message.filtering}, inventoryLayout={message.inventoryLayout}, craftingLayout={message.craftingLayout}");

0 commit comments

Comments
 (0)