added deep frozen state where chunk tickets will not be expiring as well, preventing chunks from unloading. Fixes #204

This commit is contained in:
gnembon committed 2020-04-14 01:28:00 -03:00
1 parent 07b3029820
commit 3e76adbdaa
5 files changed
+33 -4

No files matched your search

@@ -43,7 +43,8 @@ public class TickCommand
c.getSource(),
getInteger(c,"ticks"),
getString(c, "tail command")))))).
then(literal("freeze").executes( (c)-> toggleFreeze(c.getSource()))).
then(literal("freeze").executes( (c)-> toggleFreeze(c.getSource(), false)).
then(literal("deep").executes( (c)-> toggleFreeze(c.getSource(), true)))).
then(literal("step").
executes((c) -> step(1)).
then(argument("ticks", integer(1,72000)).
@@ -95,15 +96,18 @@ public class TickCommand
return 1;
}
private static int toggleFreeze(ServerCommandSource source)
private static int toggleFreeze(ServerCommandSource source, boolean isDeep)
{
TickSpeed.is_paused = !TickSpeed.is_paused;
if (TickSpeed.is_paused)
{
Messenger.m(source, "gi Game is paused");
TickSpeed.deepFreeze = isDeep;
Messenger.m(source, "gi Game is "+(isDeep?"deeply ":"")+"frozen");
}
else
{
TickSpeed.deepFreeze = false;
Messenger.m(source, "gi Game runs normally");
}
return 1;