aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2022-11-02 13:16:50 +0000
committerGitHub <noreply@github.com>2022-11-02 14:16:50 +0100
commit3ca2f856a5c2aaa5f3ea7e6136b8084d98279af1 (patch)
tree572bdc728f5decd89446eae3ea9556abaf7b381c /src/main/java/io
parent225ca575ba53b581e7ecfb77ae5f5dbc3b8483eb (diff)
downloadNotEnoughUpdates-3ca2f856a5c2aaa5f3ea7e6136b8084d98279af1.tar.gz
NotEnoughUpdates-3ca2f856a5c2aaa5f3ea7e6136b8084d98279af1.tar.bz2
NotEnoughUpdates-3ca2f856a5c2aaa5f3ea7e6136b8084d98279af1.zip
Fixed presets not having load button when triple click -> ctrl c (#417)
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));