diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d5d5d42..bd3c8bb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Allow Blood Butcherer and Shimmer buffs to be applied to NPCs by players. (@drunderscore) * In OTAPI 3.1.11-alpha, chest stacking was fixed. (@SignatureBeef) * In OTAPI 3.1.12-alpha, "server world deletions" were fixed. (@SignatureBeef) +* Fixed NetTile errors by implementing new packet read/write data. (@SignatureBeef) ## TShock 4.5.18 * Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@PotatoCider) diff --git a/TShockAPI/Handlers/SendTileRectHandler.cs b/TShockAPI/Handlers/SendTileRectHandler.cs index c165a267..c68895ae 100644 --- a/TShockAPI/Handlers/SendTileRectHandler.cs +++ b/TShockAPI/Handlers/SendTileRectHandler.cs @@ -463,11 +463,15 @@ namespace TShockAPI.Handlers if ((updateType & TileDataType.TilePaint) != 0) { tile.color(newTile.TileColor); + tile.fullbrightBlock(newTile.FullbrightBlock); + tile.invisibleBlock(newTile.InvisibleBlock); } if ((updateType & TileDataType.WallPaint) != 0) { tile.wallColor(newTile.WallColor); + tile.fullbrightWall(newTile.FullbrightWall); + tile.invisibleWall(newTile.InvisibleWall); } if ((updateType & TileDataType.Liquid) != 0) diff --git a/TShockAPI/Net/NetTile.cs b/TShockAPI/Net/NetTile.cs index 18033c2b..1ce16837 100644 --- a/TShockAPI/Net/NetTile.cs +++ b/TShockAPI/Net/NetTile.cs @@ -45,6 +45,10 @@ namespace TShockAPI.Net public bool Slope1 { get; set; } public bool Slope2 { get; set; } public bool Slope3 { get; set; } + public bool FullbrightBlock { get; set; } + public bool FullbrightWall { get; set; } + public bool InvisibleBlock { get; set; } + public bool InvisibleWall { get; set; } public byte Slope { @@ -172,6 +176,22 @@ namespace TShockAPI.Net stream.WriteByte(bits); + bits = new BitsByte(); + + if (FullbrightBlock) + bits[0] = true; + + if (FullbrightWall) + bits[1] = true; + + if (InvisibleBlock) + bits[2] = true; + + if (InvisibleWall) + bits[3] = true; + + stream.WriteByte(bits); + if (HasColor) { stream.WriteByte(TileColor); @@ -206,6 +226,7 @@ namespace TShockAPI.Net { var flags = (BitsByte) stream.ReadInt8(); var flags2 = (BitsByte)stream.ReadInt8(); + var flags3 = (BitsByte)stream.ReadInt8(); Wire2 = flags2[0]; Wire3 = flags2[1]; @@ -214,6 +235,11 @@ namespace TShockAPI.Net Slope3 = flags2[6]; Wire4 = flags2[7]; + FullbrightBlock = flags3[0]; + FullbrightWall = flags3[1]; + InvisibleBlock = flags3[2]; + InvisibleWall = flags3[3]; + if (flags2[2]) { TileColor = stream.ReadInt8();