fix: remove broken haxe kubejs scripts
continuous-integration/drone/push Build is passing Details

This commit is contained in:
LordMZTE 2022-06-30 13:40:34 +02:00
parent b3791ea05f
commit 5169428ce2
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
7 changed files with 22 additions and 71 deletions

View File

@ -7,7 +7,6 @@ steps:
- apt update
- apt install -y
curl
haxe
jq
libarchive-dev
libcurl4-openssl-dev

View File

@ -38,8 +38,6 @@ pub fn main() !void {
try archiveCreateDir(zip.?, entry.?, "minecraft/");
try archiveCreateDir(zip.?, entry.?, "minecraft/mods/");
try installHaxe(zip.?, entry.?, &buf);
var overrides = try std.fs.cwd().openDir("overrides", .{ .iterate = true });
defer overrides.close();
var walker = try overrides.walk(std.heap.c_allocator);
@ -147,34 +145,6 @@ fn archiveCreateDir(
try handleArchiveErr(c.archive_write_header(archive, entry), archive);
}
fn installHaxe(archive: *c.archive, entry: *c.archive_entry, buf: []u8) !void {
const term = try std.ChildProcess.init(
&.{ "haxe", "kubejs/build.hxml" },
std.heap.c_allocator,
).spawnAndWait();
const term_n = switch (term) {
.Exited => |n| @intCast(u32, n),
.Signal, .Unknown, .Stopped => |n| n,
};
if (term_n != 0)
return error.BuildHaxeError;
try archiveCreateDir(archive, entry, "minecraft/kubejs/");
try archiveCreateDir(archive, entry, "minecraft/kubejs/server_scripts/");
var file = try std.fs.cwd().openFile("build/kubejs-server.js", .{});
defer file.close();
try archiveFile(
archive,
entry,
buf,
"minecraft/kubejs/server_scripts/script.js",
file,
);
}
fn readMods(list: *std.ArrayList([]u8), alloc: std.mem.Allocator) !void {
var file = try std.fs.cwd().openFile("mods.txt", .{});
defer file.close();

View File

@ -1,15 +0,0 @@
package;
import kubejs.Events;
import kubejs.Settings;
class Main {
static function main() {
Settings.logAddedRecipes = true;
Settings.logErroringRecipes = true;
Settings.logRemovedRecipes = true;
Settings.logSkippedRecipes = false;
Events.onEvent(EventType.RecipesEventType, Recipes.onEvent);
}
}

View File

@ -1,20 +0,0 @@
import kubejs.events.server.RecipesEvent;
class Recipes {
public static function onEvent(event:RecipesEvent) {
event.shaped(
"flight_rings:t_basic_ring_treasure",
[
"S", "W", "S",
"W", "R", "W",
"F", "W", "F",
],
{
S: "terramine:mana_crystal",
W: "minecraft:feather",
R: "botania:pixie_ring",
F: "create:encased_fan",
}
);
}
}

View File

@ -1,5 +0,0 @@
# invoke haxe from the repository root
-cp kubejs
-main Main
-lib kubejs
-js build/kubejs-server.js

View File

@ -0,0 +1,4 @@
settings.logAddedRecipes = true;
settings.logErroringRecipes = true;
settings.logRemovedRecipes = true;
settings.logSkippedRecipes = false;

View File

@ -0,0 +1,18 @@
function recipes(ev) {
ev.shaped(
"flight_rings:t_basic_ring_treasure",
[
"SWS",
"WRW",
"FWF",
],
{
S: "terramine:mana_crystal",
W: "minecraft:feather",
R: "botania:pixie_ring",
F: "create:encased_fan",
}
);
}
onEvent("recipes", recipes);