Skip to content

Commit

Permalink
Move a couple java-hacks from kettinglauncher
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3-M4513R committed Jan 20, 2024
1 parent e721692 commit e25b25a
Show file tree
Hide file tree
Showing 5 changed files with 524 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
import java.util.Map;
import java.util.jar.JarFile;

/**
* @author C0D3 M4513R
* @author JustRed32
*/
@SuppressWarnings("unused")
public class KettingConstants {
public static final String NAME = "Ketting";
public static final String BRAND = "KettingPowered";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import java.io.File;

/**
* @author C0D3 M4513R
* @author JustRed32
*/
@SuppressWarnings("unused")
public class KettingFileVersioned {
private static final String
MC = KettingConstants.MINECRAFT_VERSION,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package org.kettingpowered.ketting.internal;

import java.io.File;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
* @author C0D3 M4513R
* @author JustRed32
*/
@SuppressWarnings("unused")
public class KettingFiles {
public static final String DATA_DIR = "data/";
public static final File MAIN_FOLDER_FILE;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.kettingpowered.ketting.internal.hacks;

import java.util.Set;

/**
* @author AllmightySatan
*/
@SuppressWarnings("unused")
public final class JavaHacks {
//Fixes weird behaviour with org.apache.commons.lang.enum where enum would be seen as a java keyword
public static void clearReservedIdentifiers() {
try {
Unsafe.lookup().findStaticSetter(Class.forName("jdk.internal.module.Checks"), "RESERVED", Set.class).invoke(Set.of());
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
}
Loading

0 comments on commit e25b25a

Please sign in to comment.