Skip to content

Commit

Permalink
Revert "feat(generator-accessor-runtime): NeoForge support"
Browse files Browse the repository at this point in the history
This reverts commit 90cbdaf.
  • Loading branch information
zlataovce committed Nov 1, 2023
1 parent 90cbdaf commit 63b8330
Showing 1 changed file with 2 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
public enum MapperPlatforms implements MapperPlatform {
/**
* An abstraction for platforms that implement the Bukkit API (Spigot mappings).
* An abstraction for platforms that implement the Bukkit API.
*/
BUKKIT {
private String minecraftVersion = null;
Expand Down Expand Up @@ -83,45 +83,7 @@ public boolean isSupported() {
},

/**
* An abstraction for NeoForge-based platforms (Mojang mappings).
*/
NEOFORGE {
private String minecraftVersion = null;

{
try {
final Class<?> neoFormVersionClass = Class.forName(
"net.neoforged.neoforge.internal.versions.neoform.NeoFormVersion",
true, getClassLoader()
);
minecraftVersion = (String) neoFormVersionClass.getMethod("getMCVersion").invoke(null);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException("Failed to get Minecraft version", e);
} catch (ClassNotFoundException ignored) {
}
}

@Override
public boolean isSupported() {
return minecraftVersion != null;
}

@Override
public @NotNull String getVersion() {
if (!isSupported()) {
throw new UnsupportedOperationException("NeoForge is not supported by this environment");
}
return minecraftVersion;
}

@Override
public @NotNull String[] getMappingNamespaces() {
return new String[] { "mojang" };
}
},

/**
* An abstraction for Forge-based platforms (Searge mappings).
* An abstraction for Forge-based platforms.
*/
FORGE {
private String minecraftVersion = null;
Expand Down

0 comments on commit 63b8330

Please sign in to comment.