Commit 34f0049815e055710301201f5264f6292119df03

Authored by Mumfrey
1 parent 92321dab

minor fixes

java/client/com/mumfrey/liteloader/client/transformers/CrashReportTransformer.java
... ... @@ -18,7 +18,7 @@ public class CrashReportTransformer extends ClassTransformer
18 18 @Override
19 19 public byte[] transform(String name, String transformedName, byte[] basicClass)
20 20 {
21   - if (Obf.CrashReport$6.name.equals(name) || Obf.CrashReport$6.obf.equals(name))
  21 + if (basicClass != null && (Obf.CrashReport$6.name.equals(name) || Obf.CrashReport$6.obf.equals(name)))
22 22 {
23 23 try
24 24 {
... ...
java/common/com/mumfrey/liteloader/launch/LiteLoaderTransformer.java
... ... @@ -18,6 +18,8 @@ public class LiteLoaderTransformer extends ClassTransformer
18 18 @Override
19 19 public byte[] transform(String name, String transformedName, byte[] basicClass)
20 20 {
  21 + if (basicClass == null) return basicClass;
  22 +
21 23 if (Obf.MinecraftMain.name.equals(transformedName))
22 24 {
23 25 return this.transformMain(basicClass);
... ...
java/common/com/mumfrey/liteloader/launch/StartupEnvironment.java
... ... @@ -35,11 +35,11 @@ public abstract class StartupEnvironment implements GameEnvironment
35 35  
36 36 public StartupEnvironment(List<String> args, File gameDirectory, File assetsDirectory, String profile)
37 37 {
38   - this.initArgs(args);
39   -
40 38 this.gameDirectory = gameDirectory;
41 39 this.assetsDirectory = assetsDirectory;
42 40 this.profile = profile;
  41 +
  42 + this.initArgs(args);
43 43 }
44 44  
45 45 public abstract void registerCoreAPIs(List<String> apisToLoad);
... ... @@ -134,13 +134,13 @@ public abstract class StartupEnvironment implements GameEnvironment
134 134 */
135 135 public void provideRequiredArgs()
136 136 {
137   - if (!this.launchArgs.containsKey("--version"))
  137 + if (this.launchArgs.get("--version") == null)
138 138 this.addClassifiedArg("--version", LiteLoaderTweaker.VERSION);
139 139  
140   - if (!this.launchArgs.containsKey("--gameDir") && this.gameDirectory != null)
  140 + if (this.launchArgs.get("--gameDir") == null && this.gameDirectory != null)
141 141 this.addClassifiedArg("--gameDir", this.gameDirectory.getAbsolutePath());
142 142  
143   - if (!this.launchArgs.containsKey("--assetsDir") && this.assetsDirectory != null)
  143 + if (this.launchArgs.get("--assetsDir") == null && this.assetsDirectory != null)
144 144 this.addClassifiedArg("--assetsDir", this.assetsDirectory.getAbsolutePath());
145 145 }
146 146  
... ...
java/common/com/mumfrey/liteloader/transformers/ClassOverlayTransformer.java
... ... @@ -167,7 +167,7 @@ public abstract class ClassOverlayTransformer extends ClassTransformer
167 167 {
168 168 throw new RuntimeException(String.format("%s is an overlay class and cannot be referenced directly", this.overlayClassName));
169 169 }
170   - else if (this.remappingAgent)
  170 + else if (this.remappingAgent && basicClass != null)
171 171 {
172 172 return this.remapClass(transformedName, basicClass);
173 173 }
... ...
java/common/com/mumfrey/liteloader/transformers/PacketTransformer.java
... ... @@ -107,7 +107,7 @@ public abstract class PacketTransformer extends ClassTransformer
107 107 @Override
108 108 public final byte[] transform(String name, String transformedName, byte[] basicClass)
109 109 {
110   - if (this.packetClass.equals(transformedName) || this.packetClassObf.equals(transformedName))
  110 + if (basicClass != null && (this.packetClass.equals(transformedName) || this.packetClassObf.equals(transformedName)))
111 111 {
112 112 LiteLoaderLogger.info("PacketTransformer: Running transformer %s for %s", this.getClass().getName(), name);
113 113  
... ...