aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java5
2 files changed, 8 insertions, 1 deletions
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));