Skip to content

Commit

Permalink
remove awkward spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Jan 6, 2025
1 parent aa68538 commit b01e8ae
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions shared/src/main/java/me/xginko/aef/commands/BukkitCommandWrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ private boolean resolveSyncCommandsMethod() {
syncCommandsMethod.setAccessible(true);
return true;
} catch (NoSuchMethodException | ClassNotFoundException e) {

return false;
}
}
Expand All @@ -82,7 +81,6 @@ private boolean fetchCommandMapField() {
commandMapField.setAccessible(true);
return true;
} catch (NoSuchFieldException | ClassNotFoundException e) {

return false;
}
}
Expand All @@ -95,7 +93,6 @@ private boolean fetchKnownCommandsField() {
knownCommandsField.setAccessible(true);
return true;
} catch (NoSuchFieldException e) {

return false;
}
}
Expand Down Expand Up @@ -181,7 +178,6 @@ private boolean resolveRemoveCommandMethod() {
try {
return vanillaCommandDispatcherField.get(server);
} catch (IllegalAccessException e) {

return null;
}
}
Expand All @@ -190,7 +186,6 @@ private Object getServerInstance() {
try {
return getServerMethod.invoke(minecraftServerClass);
} catch (IllegalAccessException | InvocationTargetException e) {

return null;
}
}
Expand Down Expand Up @@ -235,12 +230,9 @@ private boolean resolveBField() {
return true;
} catch (NoSuchFieldException | ClassNotFoundException e) {
try {
Class<?> clazz = Class.forName("net.minecraft.commands.CommandDispatcher");
Field gField = clazz.getDeclaredField("g");
if (gField.getType() == CommandDispatcher.class)
bField = gField;
else
bField = clazz.getDeclaredField("h");
Class<?> commandDispatcher = Class.forName("net.minecraft.commands.CommandDispatcher");
Field gField = commandDispatcher.getDeclaredField("g");
bField = gField.getType() == CommandDispatcher.class ? gField : commandDispatcher.getDeclaredField("h");
bField.setAccessible(true);
return true;
} catch (NoSuchFieldException | ClassNotFoundException ex) {
Expand Down

0 comments on commit b01e8ae

Please sign in to comment.