Skip to content

Commit

Permalink
Fix some packet stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Tides committed Jun 7, 2024
1 parent dcb01db commit 8703377
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Obsidian/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ await QueuePacketAsync(new LoginPacket
EntityId = id,
Gamemode = Player.Gamemode,
DimensionNames = CodecRegistry.Dimensions.All.Keys.ToList(),
DimensionType = codec.Name,
DimensionType = codec.Id,
DimensionName = codec.Name,
HashedSeed = 0,
ReducedDebugInfo = false,
Expand Down Expand Up @@ -588,11 +588,11 @@ internal async Task SendInfoAsync()

await SendTimeUpdateAsync();
await SendWeatherUpdateAsync();
await QueuePacketAsync(new SetContainerContentPacket(0, Player.Inventory.ToList())
{
StateId = Player.Inventory.StateId++,
CarriedItem = Player.GetHeldItem(),
});
//await QueuePacketAsync(new SetContainerContentPacket(0, Player.Inventory.ToList())
//{
// StateId = Player.Inventory.StateId++,
// CarriedItem = Player.GetHeldItem(),
//});

await QueuePacketAsync(new SetEntityMetadataPacket
{
Expand Down
3 changes: 0 additions & 3 deletions Obsidian/Net/MixedCodec.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Obsidian/Net/Packets/Play/Clientbound/LoginPacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public partial class LoginPacket : IClientboundPacket
[Field(8)]
public bool DoLimitedCrafting { get; init; } = false;

[Field(9)]
public string DimensionType { get; init; }
[Field(9), VarLength]
public int DimensionType { get; init; }

[Field(10)]
public string DimensionName { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public partial class SetEntityMetadataPacket : IClientboundPacket
[Field(1)]
public Entity Entity { get; init; }

public int Id => 0x59;
public int Id => 0x58;
}

0 comments on commit 8703377

Please sign in to comment.