aboutsummaryrefslogtreecommitdiff
path: root/loader/src
diff options
context:
space:
mode:
Diffstat (limited to 'loader/src')
-rw-r--r--loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DungeonsGuideReloadListener.java2
-rwxr-xr-xloader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java4
-rw-r--r--loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java18
-rw-r--r--loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/token/FailedAuthToken.java6
-rw-r--r--loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/branch/UpdateRetrieverUtil.java8
-rw-r--r--loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/DGAwareEventSubscriptionTransformer.java12
-rw-r--r--loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java6
-rw-r--r--loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java6
-rw-r--r--loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiUnloadingError.java2
9 files changed, 34 insertions, 30 deletions
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DungeonsGuideReloadListener.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DungeonsGuideReloadListener.java
index a96805c1..9fe530c0 100644
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DungeonsGuideReloadListener.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DungeonsGuideReloadListener.java
@@ -20,7 +20,7 @@ package kr.syeyoung.dungeonsguide.launcher;
public interface DungeonsGuideReloadListener {
/**
- * @implNote This is very important that you GET RID OF referene to DGInterface when this is called, or else dg is gonna crash with ReferenceLeakedException.
+ * @implNote This is very important that you GET RID OF reference to DGInterface when this is called, or else dg is gonna crash with ReferenceLeakedException.
*/
public void unloadReference();
public void onLoad(DGInterface dgInterface);
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java
index 79019c6a..b4d9622a 100755
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java
@@ -152,7 +152,7 @@ public class Main
public void unload() throws DungeonsGuideUnloadingException {
if (currentLoader != null && !currentLoader.isUnloadable()) {
- throw new UnsupportedOperationException("Current version is not unloadable");
+ throw new UnsupportedOperationException("Current version is not able to be unloaded");
}
dgInterface = null;
for (DungeonsGuideReloadListener listener : listeners) {
@@ -182,7 +182,7 @@ public class Main
try {
dgInterface.init(configDir);
} catch (Exception e) {
- throw new DungeonsGuideLoadingException("Exception occured while calling init", e);
+ throw new DungeonsGuideLoadingException("Exception occurred while calling init", e);
}
for (DungeonsGuideReloadListener listener : listeners) {
listener.onLoad(dgInterface);
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java
index 0325b758..f582ba6f 100644
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java
@@ -22,7 +22,7 @@ import com.google.common.base.Throwables;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import kr.syeyoung.dungeonsguide.launcher.auth.token.*;
import kr.syeyoung.dungeonsguide.launcher.events.AuthChangedEvent;
-import kr.syeyoung.dungeonsguide.launcher.exceptions.auth.AuthFailedExeption;
+import kr.syeyoung.dungeonsguide.launcher.exceptions.auth.AuthFailedException;
import kr.syeyoung.dungeonsguide.launcher.exceptions.auth.AuthenticationUnavailableException;
import kr.syeyoung.dungeonsguide.launcher.exceptions.auth.PrivacyPolicyRequiredException;
import kr.syeyoung.dungeonsguide.launcher.gui.screen.GuiDisplayer;
@@ -67,7 +67,7 @@ public class AuthManager {
*/
public String getWorkingTokenOrThrow() {
if (currentToken instanceof DGAuthToken) return currentToken.getToken();
- else if (currentToken instanceof FailedAuthToken) throw new AuthFailedExeption(((FailedAuthToken) currentToken).getException());
+ else if (currentToken instanceof FailedAuthToken) throw new AuthFailedException(((FailedAuthToken) currentToken).getException());
else if (currentToken instanceof NullToken) throw new AuthenticationUnavailableException("Null Token");
else if (currentToken instanceof PrivacyPolicyRequiredToken) throw new PrivacyPolicyRequiredException();
throw new IllegalStateException("weird token: "+currentToken);
@@ -90,7 +90,7 @@ public class AuthManager {
boolean shouldReAuth = false;
if (getToken().isUserVerified() && !getToken().getUUID().replace("-", "").equals(Minecraft.getMinecraft().getSession().getPlayerID())) {
shouldReAuth = true;
- } // TODO: try auth, check if current dungeons guide version is acceisible, and unload it if inaccessible.
+ } // TODO: try auth, check if current dungeons guide version is accessible, and unload it if inaccessible.
if (!getToken().isAuthenticated()) {
shouldReAuth = true;
}
@@ -152,7 +152,7 @@ public class AuthManager {
currentToken = new FailedAuthToken(e);
NotificationManager.INSTANCE.updateNotification(authenticationFailure, Notification.builder()
.title("Auth Error")
- .description("Authentication Error Occured\n"+e.getMessage())
+ .description("Authentication Error Occurred\n"+e.getMessage())
.titleColor(0xFFFF0000)
.unremovable(true)
.onClick(() -> {
@@ -161,7 +161,7 @@ public class AuthManager {
.build());
}
logger.error("Re-auth failed with message {}, trying again in a 2 seconds", String.valueOf(Throwables.getRootCause(e)));
- throw new AuthFailedExeption(e);
+ throw new AuthFailedException(e);
} finally {
reauthLock = false;
}
@@ -186,7 +186,7 @@ public class AuthManager {
if (e instanceof PrivacyPolicyRequiredException) {
NotificationManager.INSTANCE.updateNotification(privacyPolicyRequired, Notification.builder()
.title("Privacy Policy")
- .description("Please accept Dungeons Guide\nPrivacy Policy to enjoy server based\nfeatures of Dungeons Guide\n\n(Including Auto-Update/Remote-Jar)")
+ .description("Please accept the Dungeons Guide\nPrivacy Policy to enjoy server based\nfeatures of Dungeons Guide\n\n(Including Auto-Update/Remote-Jar)")
.titleColor(0xFFFF0000)
.unremovable(true)
.onClick(() -> {
@@ -197,7 +197,7 @@ public class AuthManager {
currentToken = new FailedAuthToken(e);
NotificationManager.INSTANCE.updateNotification(authenticationFailure, Notification.builder()
.title("Auth Error")
- .description("Authentication Error Occured\n"+e.getMessage())
+ .description("Authentication Error Occurred\n"+e.getMessage())
.titleColor(0xFFFF0000)
.unremovable(true)
.onClick(() -> {
@@ -205,8 +205,8 @@ public class AuthManager {
})
.build());
}
- logger.error("Accepting Privacy Policy failed with message {}, trying again in a 2 seconds", String.valueOf(Throwables.getRootCause(e)));
- throw new AuthFailedExeption(e);
+ logger.error("Accepting the Privacy Policy failed with message {}, trying again in a 2 seconds", String.valueOf(Throwables.getRootCause(e)));
+ throw new AuthFailedException(e);
} finally {
reauthLock = false;
}
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/token/FailedAuthToken.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/token/FailedAuthToken.java
index 84061473..a835b80a 100644
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/token/FailedAuthToken.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/token/FailedAuthToken.java
@@ -21,10 +21,10 @@ package kr.syeyoung.dungeonsguide.launcher.auth.token;
import java.time.Instant;
public class FailedAuthToken implements AuthToken {
- private final Throwable exeption;
+ private final Throwable exception;
public FailedAuthToken(Throwable exception) {
- this.exeption = exception;
+ this.exception = exception;
}
@Override
@@ -53,6 +53,6 @@ public class FailedAuthToken implements AuthToken {
}
public Throwable getException() {
- return exeption;
+ return exception;
}
}
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/branch/UpdateRetrieverUtil.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/branch/UpdateRetrieverUtil.java
index aaa44a3e..0414129c 100644
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/branch/UpdateRetrieverUtil.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/branch/UpdateRetrieverUtil.java
@@ -67,7 +67,7 @@ public class UpdateRetrieverUtil {
updateBranch.setName(a.getString("name"));
updateBranch.setMetadata(JSONObject.NULL.equals(a.get("metadata")) ? new JSONObject() : a.getJSONObject("metadata"));
if (JSONObject.NULL.equals(a.get("metadata") )) {
- System.out.println("Update Branch has null metadta: "+a_);
+ System.out.println("Update Branch has null metadata: "+a_);
}
branches.add(updateBranch);
}
@@ -188,10 +188,10 @@ public class UpdateRetrieverUtil {
connection.setRequestMethod(method);
return connection.getInputStream();
} catch (IOException e) {
- throw new RuntimeException("Error occured while downloading update asset from "+method+" "+url, e);
+ throw new RuntimeException("Error occurred while downloading update asset from "+method+" "+url, e);
}
} catch (IOException e) {
- throw new RuntimeException("Error occured while downloading update asset "+update+"/"+assetName, e);
+ throw new RuntimeException("Error occurred while downloading update asset "+update+"/"+assetName, e);
}
}
@@ -250,7 +250,7 @@ public class UpdateRetrieverUtil {
.friendlyVersionName(target.getName())
.build();
} catch (Exception e) {
- throw new NoVersionFoundException(branch, version, "Exception occured", e);
+ throw new NoVersionFoundException(branch, version, "Exception occurred", e);
}
}
}
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/DGAwareEventSubscriptionTransformer.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/DGAwareEventSubscriptionTransformer.java
index 4cf6bbc9..07eaa1d9 100644
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/DGAwareEventSubscriptionTransformer.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/DGAwareEventSubscriptionTransformer.java
@@ -74,8 +74,10 @@ public class DGAwareEventSubscriptionTransformer implements IClassTransformer
private boolean buildEvents(ClassNode classNode) throws Exception
{
- // Yes, this recursively loads classes until we get this base class. THIS IS NOT A ISSUE. Coremods should handle re-entry just fine.
- // If they do not this a COREMOD issue NOT a Forge/LaunchWrapper issue.
+ // Yes, this recursively loads classes until we get this base class.
+ // THIS IS NOT AN ISSUE.
+ // Coremods should handle re-entry just fine.
+ // If they do not, this is a COREMOD issue, NOT a Forge/LaunchWrapper issue.
Class<?> parent = classLoader.loadClass(classNode.superName.replace('/', '.'));
if (!Event.class.isAssignableFrom(parent))
{
@@ -186,10 +188,10 @@ public class DGAwareEventSubscriptionTransformer implements IClassTransformer
method.instructions.add(new VarInsnNode(ALOAD, 0));
method.instructions.add(new MethodInsnNode(INVOKESPECIAL, tSuper.getInternalName(), "setup", voidDesc, false));
method.instructions.add(new FieldInsnNode(GETSTATIC, classNode.name, "LISTENER_LIST", listDesc));
- LabelNode initLisitener = new LabelNode();
- method.instructions.add(new JumpInsnNode(IFNULL, initLisitener));
+ LabelNode initListener = new LabelNode();
+ method.instructions.add(new JumpInsnNode(IFNULL, initListener));
method.instructions.add(new InsnNode(RETURN));
- method.instructions.add(initLisitener);
+ method.instructions.add(initListener);
method.instructions.add(new FrameNode(F_SAME, 0, null, 0, null));
method.instructions.add(new TypeInsnNode(NEW, tList.getInternalName()));
method.instructions.add(new InsnNode(DUP));
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java
index 124a6bc7..41e17c1a 100644
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java
@@ -38,7 +38,7 @@ public class OwnerAwareASMEventHandler implements IEventListener
private static int IDs = 0;
private static final String HANDLER_DESC = Type.getInternalName(IEventListener.class);
private static final String HANDLER_FUNC_DESC = Type.getMethodDescriptor(IEventListener.class.getDeclaredMethods()[0]);
- private static final boolean GETCONTEXT = Boolean.parseBoolean(System.getProperty("fml.LogContext", "false"));
+ private static final boolean GET_CONTEXT = Boolean.parseBoolean(System.getProperty("fml.LogContext", "false"));
private final IEventListener handler;
private final SubscribeEvent subInfo;
@@ -56,7 +56,7 @@ public class OwnerAwareASMEventHandler implements IEventListener
@Override
public void invoke(Event event)
{
- if (GETCONTEXT)
+ if (GET_CONTEXT)
ThreadContext.put("mod", owner == null ? "" : owner.getName());
if (handler != null)
{
@@ -65,7 +65,7 @@ public class OwnerAwareASMEventHandler implements IEventListener
handler.invoke(event);
}
}
- if (GETCONTEXT)
+ if (GET_CONTEXT)
ThreadContext.remove("mod");
}
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java
index 39cf6e13..66b26111 100644
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiPrivacyPolicy.java
@@ -66,8 +66,10 @@ public class GuiPrivacyPolicy extends SpecialGuiScreen {
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj;
- fontRenderer.drawString("Please accept or deny Dungeons Guide Privacy Policy to continue", (sr.getScaledWidth()-fontRenderer.getStringWidth("Please accept or deny Dungeons Guide Privacy Policy to continue"))/2,40,0xFFFF0000);
- fontRenderer.drawString("Blah blah legal stuff", (sr.getScaledWidth()-fontRenderer.getStringWidth("Please accept or deny Dungeons Guide Privacy Policy to continue"))/2,sr.getScaledHeight() / 2, 0xFFFFFFFF);
+ final String ACCEPT_POLICY_MSG = "Please accept or deny the Dungeons Guide Privacy Policy to continue";
+
+ fontRenderer.drawString(ACCEPT_POLICY_MSG, (sr.getScaledWidth()-fontRenderer.getStringWidth(ACCEPT_POLICY_MSG))/2,40,0xFFFF0000);
+ fontRenderer.drawString("Blah blah legal stuff", (sr.getScaledWidth()-fontRenderer.getStringWidth(ACCEPT_POLICY_MSG))/2,sr.getScaledHeight() / 2, 0xFFFFFFFF);
super.drawScreen(mouseX, mouseY, partialTicks);
}
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiUnloadingError.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiUnloadingError.java
index eb714129..523c1ce4 100644
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiUnloadingError.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/GuiUnloadingError.java
@@ -66,7 +66,7 @@ public class GuiUnloadingError extends SpecialGuiScreen {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj;
fontRenderer.drawString("DungeonsGuide has ran into error while reloading", (sr.getScaledWidth()-fontRenderer.getStringWidth("DungeonsGuide has ran into error while reloading"))/2,40,0xFFFF0000);
fontRenderer.drawString("Please contact DungeonsGuide support with this screen", (sr.getScaledWidth()-fontRenderer.getStringWidth("Please contact developer with this screen"))/2, (int) (40+fontRenderer.FONT_HEIGHT*1.5),0xFFFF0000);
- fontRenderer.drawString("Playing in this state is VERY UNSUGGESTED. Undesired behaviors might occur.", (sr.getScaledWidth()-fontRenderer.getStringWidth("Playing in this state is VERY UNSUGGESTED. Undesired behaviors might occur."))/2, (int) (40+fontRenderer.FONT_HEIGHT*3),0xFFFF0000);
+ fontRenderer.drawString("Playing in this state is NOT RECOMMENDED. Undesired behaviors might occur.", (sr.getScaledWidth()-fontRenderer.getStringWidth("Playing in this state is NOT RECOMMENDED. Undesired behaviors might occur."))/2, (int) (40+fontRenderer.FONT_HEIGHT*3),0xFFFF0000);
int tenth = sr.getScaledWidth() / 10;