mzte-nv: use procyon instead of fernflower as java decompiler

This commit is contained in:
LordMZTE 2023-10-24 16:39:30 +02:00
parent 4c89decbbe
commit f182e76912
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -103,15 +103,15 @@ fn lGetBundleInfo(l: *c.lua_State) !c_int {
// bundles // bundles
c.lua_newtable(l); c.lua_newtable(l);
var has_fernflower = false; var has_procyon = false;
var iter = dir.iterate(); var iter = dir.iterate();
var idx: c_int = 1; var idx: c_int = 1;
while (try iter.next()) |f| { while (try iter.next()) |f| {
if (f.kind != .file or !std.mem.endsWith(u8, f.name, ".jar")) if (f.kind != .file or !std.mem.endsWith(u8, f.name, ".jar"))
continue; continue;
if (!has_fernflower and std.mem.containsAtLeast(u8, f.name, 1, "fernflower")) if (!has_procyon and std.mem.containsAtLeast(u8, f.name, 1, "procyon"))
has_fernflower = true; has_procyon = true;
const path = try std.fs.path.joinZ(std.heap.c_allocator, &.{ bundle_path, f.name }); const path = try std.fs.path.joinZ(std.heap.c_allocator, &.{ bundle_path, f.name });
defer std.heap.c_allocator.free(path); defer std.heap.c_allocator.free(path);
@ -126,8 +126,8 @@ fn lGetBundleInfo(l: *c.lua_State) !c_int {
// content_provider // content_provider
c.lua_newtable(l); c.lua_newtable(l);
if (has_fernflower) { if (has_procyon) {
c.lua_pushstring(l, "fernflower"); c.lua_pushstring(l, "procyon");
c.lua_setfield(l, -2, "preferred"); c.lua_setfield(l, -2, "preferred");
} }