From 3ca2f856a5c2aaa5f3ea7e6136b8084d98279af1 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:16:50 +0000 Subject: Fixed presets not having load button when triple click -> ctrl c (#417) --- .../github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java | 4 ++++ .../moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java index b90b1356..5053ae70 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java @@ -538,6 +538,8 @@ public class GuiEnchantColour extends GuiScreen { if (base64.length() <= sharePrefix.length()) return false; + base64 = base64.trim(); + try { return new String(Base64.getDecoder().decode(base64)).startsWith(sharePrefix); } catch (IllegalArgumentException e) { @@ -656,6 +658,8 @@ public class GuiEnchantColour extends GuiScreen { if (base64.length() <= sharePrefix.length()) return; + base64 = base64.trim(); + String jsonString; try { jsonString = new String(Base64.getDecoder().decode(base64)); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index 7aa0d2ec..c40bb331 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -25,7 +25,6 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonParser; import com.google.gson.JsonPrimitive; -import io.github.moulberry.notenoughupdates.NEUOverlay; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.GlScissorStack; import io.github.moulberry.notenoughupdates.core.GuiElementTextField; @@ -688,6 +687,8 @@ public class GuiInvButtonEditor extends GuiScreen { if (base64.length() <= sharePrefix.length()) return false; + base64 = base64.trim(); + try { return new String(Base64.getDecoder().decode(base64)).startsWith(sharePrefix); } catch (IllegalArgumentException e) { @@ -817,6 +818,8 @@ public class GuiInvButtonEditor extends GuiScreen { if (base64.length() <= sharePrefix.length()) return; + base64 = base64.trim(); + String jsonString; try { jsonString = new String(Base64.getDecoder().decode(base64)); -- cgit