From 528ccec86fbe4fe7200d1873019887e48d363ef5 Mon Sep 17 00:00:00 2001 From: Scribble Date: Tue, 17 Dec 2024 23:27:56 +0100 Subject: [PATCH] Fix disabeling extensions in config crashing on startup --- .../integrated/DesyncMonitorFileCommandExtension.java | 2 ++ .../filecommands/integrated/LabelFileCommandExtension.java | 4 +++- .../filecommands/integrated/OptionsFileCommandExtension.java | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/DesyncMonitorFileCommandExtension.java b/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/DesyncMonitorFileCommandExtension.java index 7c3fed4d..77d8f58b 100644 --- a/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/DesyncMonitorFileCommandExtension.java +++ b/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/DesyncMonitorFileCommandExtension.java @@ -328,6 +328,8 @@ private double parseDouble(String doublestring) throws ParseException { @Override public void onClear() { currentValues = null; + if (monitorContainer == null) + return; try { monitorContainer.clearMemory(); } catch (IOException e) { diff --git a/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/LabelFileCommandExtension.java b/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/LabelFileCommandExtension.java index 15fae616..46da8d32 100644 --- a/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/LabelFileCommandExtension.java +++ b/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/LabelFileCommandExtension.java @@ -18,7 +18,7 @@ public class LabelFileCommandExtension extends PlaybackFileCommandExtension { public LabelFileCommandExtension() { enabled = true; } - + @Override public String getExtensionName() { return "tasmod_label@v1"; @@ -58,6 +58,8 @@ public void onPlayback(long tick, TickContainer tickContainer) { @Override public void onClear() { + if (label == null) + return; try { label.clearMemory(); } catch (IOException e) { diff --git a/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/OptionsFileCommandExtension.java b/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/OptionsFileCommandExtension.java index 4ad9f7b9..a4c9476a 100644 --- a/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/OptionsFileCommandExtension.java +++ b/src/main/java/com/minecrafttas/tasmod/playback/filecommands/integrated/OptionsFileCommandExtension.java @@ -77,6 +77,8 @@ public void onPlayback(long tick, TickContainer tickContainer) { @Override public void onClear() { + if (hud == null) + return; try { hud.clearMemory(); } catch (IOException e) {