mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-26 06:43:25 -04:00
Make Update a struct instead of a class.
This commit is contained in:
parent
a4d10ff256
commit
cf8e492851
@ -180,9 +180,10 @@ namespace MCGalaxy {
|
||||
for (int i = 0; i < ListUpdate.Count; i++) {
|
||||
Update C = ListUpdate.Items[i];
|
||||
try {
|
||||
PhysicsArgs info = C.data;
|
||||
if (DoPhysicsBlockchange(C.b, C.type, false, info, 0, true))
|
||||
bulkSender.Add(C.b, C.type, 0);
|
||||
byte type = C.data.Data;
|
||||
C.data.Data = 0;
|
||||
if (DoPhysicsBlockchange(C.b, type, false, C.data, 0, true))
|
||||
bulkSender.Add(C.b, type, 0);
|
||||
} catch {
|
||||
Server.s.Log("Phys update issue");
|
||||
}
|
||||
@ -382,15 +383,14 @@ namespace MCGalaxy {
|
||||
}
|
||||
}
|
||||
|
||||
public class Update {
|
||||
public struct Update {
|
||||
public int b;
|
||||
public PhysicsArgs data;
|
||||
public byte type;
|
||||
|
||||
public Update(int b, byte type, PhysicsArgs data = default(PhysicsArgs)) {
|
||||
this.b = b;
|
||||
this.type = type;
|
||||
this.data = data;
|
||||
this.data.Data = type;
|
||||
}
|
||||
}
|
||||
}
|
@ -48,7 +48,7 @@ namespace MCGalaxy.BlockPhysics {
|
||||
Raw |= (uint)value << 14; }
|
||||
}
|
||||
|
||||
public byte Time {
|
||||
public byte Data {
|
||||
get { return (byte)(Raw >> 22); }
|
||||
set { Raw &= ~(0xFFu << 22);
|
||||
Raw |= (uint)value << 22; }
|
||||
|
@ -137,11 +137,11 @@ namespace MCGalaxy {
|
||||
break;
|
||||
|
||||
case "rplimit":
|
||||
try { Server.rpLimit = Convert.ToInt16(value); }
|
||||
try { Server.rpLimit = Convert.ToUInt16(value); }
|
||||
catch { Server.s.Log("rpLimit invalid! setting to default."); }
|
||||
break;
|
||||
case "rplimit-norm":
|
||||
try { Server.rpNormLimit = Convert.ToInt16(value); }
|
||||
try { Server.rpNormLimit = Convert.ToUInt16(value); }
|
||||
catch { Server.s.Log("rpLimit-norm invalid! setting to default."); }
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user