mirror of https://github.com/kami-blue/client
* ModuleManager safety * Module wasn't spelled correctly, causing NPE.
This commit is contained in:
parent
52af5bbead
commit
27dda1b073
|
@ -27,7 +27,7 @@ public class MixinC00Handshake {
|
|||
|
||||
@Inject(method = "writePacketData", at = @At(value = "HEAD"), cancellable = true)
|
||||
public void writePacketData(PacketBuffer buf, CallbackInfo info) {
|
||||
if (ModuleManager.isModuleEnabled("FakeVanilla")) {
|
||||
if (ModuleManager.isModuleEnabled("FakeVanillaClient")) {
|
||||
info.cancel();
|
||||
buf.writeVarInt(protocolVersion);
|
||||
buf.writeString(ip);
|
||||
|
|
|
@ -119,7 +119,11 @@ public class ModuleManager {
|
|||
|
||||
|
||||
public static Module getModuleByName(String name) {
|
||||
return modules.get(lookup.get(name.toLowerCase()));
|
||||
Integer index = lookup.get(name.toLowerCase());
|
||||
if (index == null) {
|
||||
throw new IllegalArgumentException("getModuleByName() failed. Are you calling this too early? Is the module spelled correctly? Please check!!!!");
|
||||
}
|
||||
return modules.get(index);
|
||||
}
|
||||
|
||||
public static boolean isModuleEnabled(String moduleName) {
|
||||
|
|
Loading…
Reference in New Issue