allow disabling checkpoints client side respawn

This commit is contained in:
UnknownShadow200 2019-01-10 19:06:49 +11:00
parent 18c10ceadd
commit 4ed9ded251
2 changed files with 7 additions and 3 deletions

View File

@ -38,7 +38,7 @@ namespace MCGalaxy.Blocks {
internal static bool Train(Player p, BlockID block, ushort x, ushort y, ushort z) {
if (!p.trainInvincible && p.level.Config.KillerBlocks) p.HandleDeath(Block.Train);
return true;
}
}
internal static bool DoPortal(Player p, BlockID block, ushort x, ushort y, ushort z) {
if (p.level.PosToInt(x, y, z) == p.lastWalkthrough) return true;
@ -59,8 +59,10 @@ namespace MCGalaxy.Blocks {
if (index != p.lastCheckpointIndex) {
Position pos = p.Pos;
pos.X = x * 32 + 16; pos.Z = z * 32 + 16;
p.SendPos(Entities.SelfID, pos, p.Rot);
Entities.Spawn(p, p);
if (Server.Config.CheckpointsRespawnClientside) {
p.SendPos(Entities.SelfID, pos, p.Rot);
Entities.Spawn(p, p);
}
p.lastCheckpointIndex = index;
}
return true;

View File

@ -78,6 +78,8 @@ namespace MCGalaxy {
public bool CheckForUpdates = true;
[ConfigBool("enable-cpe", "Server", true)]
public bool EnableCPE = true;
[ConfigBool("checkpoints-respawn-clientside", "Other", true)]
public bool CheckpointsRespawnClientside = true;
[ConfigInt("rplimit", "Other", 500, 0, 50000)]
public int PhysicsRestartLimit = 500;