Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.minecrafttas.tasmod.networking.TASmodBufferBuilder;
import com.minecrafttas.tasmod.playback.PlaybackControllerClient.TASstate;
import com.minecrafttas.tasmod.registries.TASmodPackets;
import com.minecrafttas.tasmod.savestates.SavestateHandlerServer.SavestateState;
import com.minecrafttas.tasmod.savestates.exceptions.LoadstateException;

import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -50,9 +51,21 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
try {
TASmod.savestateHandlerServer.loadState(0, false);
} catch (LoadstateException e) {
e.printStackTrace();
TASmod.LOGGER.catching(e);
if (e.getMessage() != null) {
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Could not load the initial savestate: " + e.getMessage()));
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do better logging for the loadstate exception at some point, when I redo all the command messages and add i18n

TASmod.savestateHandlerServer.state = SavestateState.NONE;
TASmod.tickratechanger.pauseGame(false);
return;
} catch (IOException e) {
e.printStackTrace();
TASmod.LOGGER.catching(e);
if (e.getMessage() != null) {
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Could not load the initial savestate: " + e.getMessage()));
}
TASmod.savestateHandlerServer.state = SavestateState.NONE;
TASmod.tickratechanger.pauseGame(false);
return;
}
TASmod.playbackControllerServer.setServerState(TASstate.PLAYBACK);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void togglePause() {
}

/**
* Enables tickrate 0
* Enables/Disables tickrate 0 on both client and server
*
* @param pause True if the game should be paused, false if unpause
*/
Expand Down