Skip to content

Commit ead6391

Browse files
authored
[Savestates] Fixes a crash when loadstating (#283)
2 parents bfd9bd8 + c086e1c commit ead6391

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ mod_email=scribble@minecrafttas.com
1616
# TASmod properties
1717
group=com.minecrafttas
1818
artifact=TASmod-1.12.2
19-
version=Beta2.1
19+
version=Beta2.2
2020
release=false

src/main/java/com/minecrafttas/tasmod/savestates/handlers/SavestateGuiHandlerClient.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ public void onClientPacket(PacketID id, ByteBuffer buf, String username) throws
4848
// Open Savestate screen
4949
SavestateState state = TASmodBufferBuilder.readEnum(SavestateState.class, buf);
5050

51-
String msg = "";
52-
if (state == SavestateState.SAVING)
53-
msg = "gui.tasmod.savestate.save.start";
54-
else if (state == SavestateState.LOADING)
55-
msg = "gui.tasmod.savestate.load.start";
56-
57-
mc.displayGuiScreen(new GuiSavestate(Component.translatable(msg).withStyle(TextFormatting.YELLOW).build()));
51+
TASmodClient.gameLoopSchedulerClient.add(() -> {
52+
String msg = "";
53+
if (state == SavestateState.SAVING)
54+
msg = "gui.tasmod.savestate.save.start";
55+
else if (state == SavestateState.LOADING)
56+
msg = "gui.tasmod.savestate.load.start";
57+
mc.displayGuiScreen(new GuiSavestate(Component.translatable(msg).withStyle(TextFormatting.YELLOW).build()));
58+
});
5859
break;
5960
case SAVESTATE_RENAME_SCREEN:
6061
int index = TASmodBufferBuilder.readInt(buf);

0 commit comments

Comments
 (0)