Skip to content

Commit be2a276

Browse files
committed
chore: update in-build protocol
1 parent 06b8b6d commit be2a276

File tree

5 files changed

+86
-9
lines changed

5 files changed

+86
-9
lines changed

src/OTAPI.UnifiedServerProcess/Mods/RootContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public void Dispose() {
7373
public virtual int Read() => Console.Read();
7474
public virtual ConsoleKeyInfo ReadKey() => Console.ReadKey();
7575
public virtual ConsoleKeyInfo ReadKey(bool intercept) => Console.ReadKey(intercept);
76+
public virtual void ResetColor() => Console.ResetColor();
7677

7778
#endregion
7879

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace Terraria.ID;
2+
3+
public enum TileChangeType : byte
4+
{
5+
None,
6+
LavaWater,
7+
HoneyWater,
8+
HoneyLava,
9+
ShimmerWater,
10+
ShimmerLava,
11+
ShimmerHoney
12+
}

src/TrProtocol/Models/SimpleTileData.cs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,76 @@ public struct SimpleTileData
2424
public byte Liquid;
2525
[Condition(nameof(Flags1), 3)]
2626
public byte LiquidType;
27+
28+
29+
[IgnoreSerialize] public bool Wire {
30+
get => Flags1[4];
31+
set => Flags1[4] = value;
32+
}
33+
[IgnoreSerialize] public bool HalfBrick {
34+
get => Flags1[5];
35+
set => Flags1[5] = value;
36+
}
37+
[IgnoreSerialize] public bool Actuator {
38+
get => Flags1[6];
39+
set => Flags1[6] = value;
40+
}
41+
[IgnoreSerialize] public bool InActive {
42+
get => Flags1[7];
43+
set => Flags1[7] = value;
44+
}
45+
[IgnoreSerialize] public bool Wire2 {
46+
get => Flags2[0];
47+
set => Flags2[0] = value;
48+
}
49+
[IgnoreSerialize] public bool Wire3 {
50+
get => Flags2[1];
51+
set => Flags2[1] = value;
52+
}
53+
54+
[IgnoreSerialize] public byte Slope {
55+
get {
56+
byte slope = 0;
57+
if (Flags2[4]) {
58+
slope++;
59+
}
60+
if (Flags2[5]) {
61+
slope += 2;
62+
}
63+
if (Flags2[6]) {
64+
slope += 4;
65+
}
66+
return slope;
67+
}
68+
set {
69+
Flags2[4] = (value & 1) == 1;
70+
Flags2[5] = (value & 2) == 2;
71+
Flags2[6] = (value & 4) == 4;
72+
}
73+
}
74+
[IgnoreSerialize]
75+
public bool Wire4 {
76+
get => Flags2[7];
77+
set => Flags2[7] = value;
78+
}
79+
[IgnoreSerialize]
80+
public bool FullbrightBlock {
81+
get => Flags3[0];
82+
set => Flags3[0] = value;
83+
}
84+
[IgnoreSerialize]
85+
public bool FullbrightWall {
86+
get => Flags3[1];
87+
set => Flags3[1] = value;
88+
}
89+
[IgnoreSerialize]
90+
public bool InvisibleBlock {
91+
get => Flags3[2];
92+
set => Flags3[2] = value;
93+
}
94+
[IgnoreSerialize]
95+
public bool InvisibleWall {
96+
get => Flags3[3];
97+
set => Flags3[3] = value;
98+
}
2799
}

src/TrProtocol/Models/SquareData.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using TrProtocol.Attributes;
2+
using Terraria.ID;
23
using TrProtocol.Interfaces;
34

45
namespace TrProtocol.Models;

src/TrProtocol/Models/TileChangeType.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)