Skip to content

Commit

Permalink
更新到.NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
chawolbaka committed Feb 24, 2024
1 parent 6dc5dd1 commit a9bcb7f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.405'
dotnet-version: '8.0.201'
- name: Build
run: dotnet build --configuration Release
2 changes: 1 addition & 1 deletion Protocol.Core/MinecraftProtocol.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="$(DefineConstants.Contains('UNSAFE'))">
Expand Down
3 changes: 1 addition & 2 deletions Protocol.Core/Packets/CompatiblePacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ public CompatiblePacket(int packetId, int capacity, int protocolVersion, int com

public virtual CompatibleByteReader AsCompatibleByteReader()
{
ReadOnlySpan<byte> span = AsSpan();
return new CompatibleByteReader(ref span, ProtocolVersion);
return new CompatibleByteReader(AsSpan(), ProtocolVersion);
}

public static new Packet Depack(ReadOnlySpan<byte> data) => throw new NotSupportedException();
Expand Down
3 changes: 1 addition & 2 deletions Protocol.Core/Packets/Packet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ public static async Task<Packet> DepackAsync(ReadOnlyMemory<byte> data, int comp

public virtual ByteReader AsByteReader()
{
ReadOnlySpan<byte> span = AsSpan();
return new ByteReader(ref span);
return new ByteReader(AsSpan());
}

public virtual Packet Clone() => ThrowIfDisposed(new Packet(Id, AsSpan()));
Expand Down

0 comments on commit a9bcb7f

Please sign in to comment.