Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
LordMZTE | b5883bccd8 | ||
LordMZTE | c4878e6d42 | ||
LordMZTE | 49a8ef908a | ||
LordMZTE | cd515d9ace | ||
Timo Ley | 8b3f5ce53a | ||
LordMZTE | c396b9c99a | ||
LordMZTE | 2cb4b901e8 | ||
LordMZTE | 0de66cacf3 |
6
.prettierrc.json5
Normal file
6
.prettierrc.json5
Normal file
|
@ -0,0 +1,6 @@
|
|||
// Formatter configuration for the KubeJS scripts.
|
||||
{
|
||||
tabWidth: 4,
|
||||
trailingComma: "always",
|
||||
}
|
||||
|
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -1,8 +1,3 @@
|
|||
- added MoStructures
|
||||
- added custom window title and icon
|
||||
- changed tempad recipes
|
||||
- fixed austri3Fix emote (the irony lol)
|
||||
- fixed recipes
|
||||
- fixed some tags
|
||||
- updated options.txt
|
||||
- waystones in foreign claims are now usable
|
||||
- fixed some tags and recipes
|
||||
- removed ae2 spatial anchor (broken on fabric)
|
||||
- added `/rtp` command
|
||||
|
|
46
build.zig
46
build.zig
|
@ -45,18 +45,25 @@ pub fn main() !void {
|
|||
var walker = try overrides.walk(std.heap.c_allocator);
|
||||
defer walker.deinit();
|
||||
|
||||
const stdout = std.io.getStdOut().writer();
|
||||
while (try walker.next()) |e| {
|
||||
switch (e.kind) {
|
||||
.Directory => {
|
||||
const path = try std.mem.concat(
|
||||
stdout.print(
|
||||
"Writing Directory\t\x1b[34m{s}/\x1b[0m\n",
|
||||
.{e.path},
|
||||
) catch {};
|
||||
const path = try std.mem.concatWithSentinel(
|
||||
std.heap.c_allocator,
|
||||
u8,
|
||||
&[_][]const u8{ "minecraft/", e.path, "/\x00" },
|
||||
&[_][]const u8{ "minecraft/", e.path },
|
||||
0,
|
||||
);
|
||||
defer std.heap.c_allocator.free(path);
|
||||
try archiveCreateDir(zip.?, entry.?, path.ptr);
|
||||
},
|
||||
.File => {
|
||||
stdout.print("Writing File\t\t\x1b[34m{s}\x1b[0m\n", .{e.path}) catch {};
|
||||
const path = try std.mem.concatWithSentinel(
|
||||
std.heap.c_allocator,
|
||||
u8,
|
||||
|
@ -71,7 +78,7 @@ pub fn main() !void {
|
|||
zip.?,
|
||||
entry.?,
|
||||
&buf,
|
||||
path,
|
||||
path.ptr,
|
||||
file,
|
||||
);
|
||||
},
|
||||
|
@ -81,11 +88,10 @@ pub fn main() !void {
|
|||
|
||||
try installMmcPackJson(zip.?, entry.?);
|
||||
|
||||
const instance_cfg_data = "InstanceType=OneSix";
|
||||
c.archive_entry_set_pathname(entry, "instance.cfg");
|
||||
c.archive_entry_set_size(entry, instance_cfg_data.len);
|
||||
c.archive_entry_set_size(entry, settings.instance_cfg_data.len);
|
||||
try handleArchiveErr(c.archive_write_header(zip, entry), zip);
|
||||
try writer.writeAll(instance_cfg_data);
|
||||
try writer.writeAll(settings.instance_cfg_data);
|
||||
|
||||
var mods_arena = std.heap.ArenaAllocator.init(std.heap.c_allocator);
|
||||
defer mods_arena.deinit();
|
||||
|
@ -132,11 +138,8 @@ fn archiveFile(
|
|||
try handleArchiveErr(c.archive_write_header(archive, entry), archive);
|
||||
|
||||
const writer = ArchiveWriter{ .context = archive };
|
||||
var read = try file.read(buf);
|
||||
while (read != 0) {
|
||||
try writer.writeAll(buf[0..read]);
|
||||
read = try file.read(buf);
|
||||
}
|
||||
var fifo = std.fifo.LinearFifo(u8, .Slice).init(buf);
|
||||
try fifo.pump(file.reader(), writer);
|
||||
}
|
||||
|
||||
/// `name` must end with '/'!
|
||||
|
@ -271,6 +274,7 @@ const CurlInfo = struct {
|
|||
filename: []const u8,
|
||||
index: usize,
|
||||
total: usize,
|
||||
mod_number_width: usize,
|
||||
};
|
||||
|
||||
fn curlInfoCallback(
|
||||
|
@ -283,12 +287,13 @@ fn curlInfoCallback(
|
|||
_ = ultotal;
|
||||
_ = ulnow;
|
||||
std.io.getStdOut().writer().print(
|
||||
"\r\x1b[34m[{d}/{d}] \x1b[97m{s} \x1b[32m{}%",
|
||||
"\r\x1b[34m[{d:[4]}/{d}] \x1b[97m{s} \x1b[32m{}%",
|
||||
.{
|
||||
info.index,
|
||||
info.total,
|
||||
info.filename,
|
||||
if (dltotal != 0) @divTrunc(dlnow * 100, dltotal) else 0,
|
||||
info.mod_number_width,
|
||||
},
|
||||
) catch {};
|
||||
return 0;
|
||||
|
@ -307,16 +312,18 @@ fn downloadMods(
|
|||
try handleCurlErr(c.curl_easy_setopt(
|
||||
curl,
|
||||
c.CURLOPT_WRITEFUNCTION,
|
||||
curlWriteCallback,
|
||||
&curlWriteCallback,
|
||||
));
|
||||
try handleCurlErr(c.curl_easy_setopt(
|
||||
curl,
|
||||
c.CURLOPT_XFERINFOFUNCTION,
|
||||
curlInfoCallback,
|
||||
&curlInfoCallback,
|
||||
));
|
||||
try handleCurlErr(c.curl_easy_setopt(curl, c.CURLOPT_NOPROGRESS, @as(c_long, 0)));
|
||||
try handleCurlErr(c.curl_easy_setopt(curl, c.CURLOPT_FOLLOWLOCATION, @as(c_long, 1)));
|
||||
|
||||
const mod_number_width = std.math.log10(mods.len) + 1;
|
||||
|
||||
const writer = ArchiveWriter{ .context = zip };
|
||||
var mod_buf = std.ArrayList(u8).init(std.heap.c_allocator);
|
||||
defer mod_buf.deinit();
|
||||
|
@ -324,6 +331,7 @@ fn downloadMods(
|
|||
.filename = "",
|
||||
.index = 0,
|
||||
.total = mods.len,
|
||||
.mod_number_width = mod_number_width,
|
||||
};
|
||||
try handleCurlErr(c.curl_easy_setopt(curl, c.CURLOPT_XFERINFODATA, &info));
|
||||
// hide cursor
|
||||
|
@ -371,13 +379,13 @@ fn downloadMods(
|
|||
try handleCurlErr(c.curl_easy_setopt(
|
||||
curl,
|
||||
c.CURLOPT_URL,
|
||||
@ptrCast([*c]const u8, mod_cstr),
|
||||
mod_cstr.ptr,
|
||||
));
|
||||
try handleCurlErr(c.curl_easy_perform(curl));
|
||||
|
||||
std.io.getStdOut().writer().print(
|
||||
"\r\x1b[34m[{d}/{d}] \x1b[97m{s} \x1b[31mZipping...",
|
||||
.{ info.index, info.total, info.filename },
|
||||
"\r\x1b[34m[{d:[3]}/{d}] \x1b[97m{s} \x1b[31mZipping...",
|
||||
.{ info.index, info.total, info.filename, mod_number_width },
|
||||
) catch {};
|
||||
|
||||
var archive_path = try std.mem.concatWithSentinel(
|
||||
|
@ -393,8 +401,8 @@ fn downloadMods(
|
|||
try handleArchiveErr(c.archive_write_header(zip, entry), zip);
|
||||
try writer.writeAll(mod_buf.items);
|
||||
std.io.getStdOut().writer().print(
|
||||
"\x1b[2K\r\x1b[34m[{d}/{d}] \x1b[97m{s}\n",
|
||||
.{ info.index, info.total, info.filename },
|
||||
"\x1b[2K\r\x1b[34m[{d:[3]}/{d}] \x1b[97m{s}\n",
|
||||
.{ info.index, info.total, info.filename, mod_number_width },
|
||||
) catch {};
|
||||
}
|
||||
}
|
||||
|
|
2
mods.txt
2
mods.txt
|
@ -114,5 +114,5 @@ https://mediafiles.forgecdn.net/files/3793/108/polymorph-fabric-0.0.21-1.18.2.ja
|
|||
https://cdn.modrinth.com/data/sGmHWmeL/versions/1.1.1+1.17/mixintrace-1.1.1%2B1.17.jar
|
||||
https://cdn.modrinth.com/data/OvlwmUdC/versions/1.9.8-BETA+1.18/kibe-1.9.8-BETA%2B1.18.jar
|
||||
https://mediafiles.forgecdn.net/files/3875/410/BuildingWands_mc1.18.2-2.6_beta-fabric.jar
|
||||
https://cdn.tilera.xyz/minecraft/mods/palettefix/palettefix-1.0.0.jar
|
||||
https://git.tilera.org/api/packages/tilera/generic/palettefix/1.0.0/palettefix-1.0.0.jar
|
||||
https://cdn.modrinth.com/data/PTGd6dWp/versions/1.4.2+1.18.2/mostructures-1.4.2%2B1.18.2.jar
|
||||
|
|
104
overrides/kubejs/client_scripts/99-lang.js
Normal file
104
overrides/kubejs/client_scripts/99-lang.js
Normal file
|
@ -0,0 +1,104 @@
|
|||
function lang(ev) {
|
||||
const addAll = langs => {
|
||||
for (kv of langs) {
|
||||
ev.addLang(kv[0], kv[1]);
|
||||
}
|
||||
};
|
||||
|
||||
// Alectrolyzer
|
||||
addAll([
|
||||
[
|
||||
"advancements.modern_industrialization.electrolyzer.description",
|
||||
"Craft an Alectrolyzer",
|
||||
],
|
||||
[
|
||||
"block.modern_industrialization.electrolyzer",
|
||||
"Alectrolyzer",
|
||||
],
|
||||
[
|
||||
"block.techreborn.industrial_electrolyzer",
|
||||
"Industrial Alectrolyzer",
|
||||
],
|
||||
]);
|
||||
|
||||
// Alectronic Circuit
|
||||
addAll([
|
||||
[
|
||||
"advancements.modern_industrialization.electronic_circuit.description",
|
||||
"Craft an Alectronic Circuit",
|
||||
],
|
||||
[
|
||||
"item.modern_industrialization.electronic_circuit",
|
||||
"Alectronic Circuit",
|
||||
],
|
||||
[
|
||||
"item.modern_industrialization.electronic_circuit_board",
|
||||
"Alectronic Circuit Board",
|
||||
],
|
||||
[
|
||||
"item.techreborn.electronic_circuit",
|
||||
"Electronic Circuit",
|
||||
],
|
||||
]);
|
||||
|
||||
// Alectrum
|
||||
addAll([
|
||||
// Modern Industrialization
|
||||
["item.modern_industrialization.electrum_cable", "Alectrum Cable"],
|
||||
["item.modern_industrialization.electrum_double_ingot", "Alectrum Double Ingot"],
|
||||
["item.modern_industrialization.electrum_dust", "Alectrum Dust"],
|
||||
["item.modern_industrialization.electrum_fine_wire", "Alectrum Fine Wire"],
|
||||
["item.modern_industrialization.electrum_ingot", "Alectrum Ingot"],
|
||||
["item.modern_industrialization.electrum_nugget", "Alectrum Nugget"],
|
||||
["item.modern_industrialization.electrum_plate", "Alectrum Plate"],
|
||||
["item.modern_industrialization.electrum_tiny_dust", "Alectrum Tiny Dust"],
|
||||
["item.modern_industrialization.electrum_wire", "Alectrum Wire"],
|
||||
|
||||
// Industrial Revolution
|
||||
["block.indrev.electrum_block", "Block of Alectrum"],
|
||||
["item.indrev.electrum_ingot", "Alectrum Ingot"],
|
||||
["item.indrev.electrum_dust", "Alectrum Dust"],
|
||||
["item.indrev.electrum_plate", "Alectrum Plate"],
|
||||
["item.indrev.electrum_gear", "Alectrum Gear"],
|
||||
["item.indrev.electrum_nugget", "Alectrum Nugget"],
|
||||
|
||||
// Tech Reborn
|
||||
["block.techreborn.electrum_storage_block", "Block of Alectrum"],
|
||||
["block.techreborn.electrum_storage_block_stairs", "Alectrum Stairs"],
|
||||
["block.techreborn.electrum_storage_block_slab", "Alectrum Slab"],
|
||||
["block.techreborn.electrum_storage_block_wall", "Alectrum Wall"],
|
||||
["item.techreborn.electrum_dust", "Alectrum Dust"],
|
||||
["item.techreborn.electrum_small_dust", "Small Pile of Alectrum Dust"],
|
||||
["item.techreborn.electrum_ingot", "Alectrum Ingot"],
|
||||
["item.techreborn.electrum_nugget", "Alectrum Nugget"],
|
||||
["item.techreborn.electrum_plate", "Alectrum Plate"],
|
||||
]);
|
||||
|
||||
// Alectrolytic Separator
|
||||
addAll([
|
||||
["block.indrev.electrolytic_separator", "Alectrolytic Separator"],
|
||||
["block.indrev.electrolytic_separator_mk1", "Alectrolytic Separator MK1"],
|
||||
["block.indrev.electrolytic_separator_mk2", "Alectrolytic Separator MK2"],
|
||||
["block.indrev.electrolytic_separator_mk3", "Alectrolytic Separator MK3"],
|
||||
["block.indrev.electrolytic_separator_mk4", "Alectrolytic Separator MK4"],
|
||||
["block.indrev.electrolytic_separator_creative", "Alectrolytic Separator Creative"],
|
||||
]);
|
||||
|
||||
// Alectric Furnace
|
||||
addAll([
|
||||
// Tech Reborn
|
||||
["block.techreborn.electric_furnace", "Alectric Furnace"],
|
||||
|
||||
// Industrial Revolution
|
||||
["block.indrev.electric_furnace", "Alectric Furnace"],
|
||||
["block.indrev.electric_furnace_mk1", "Alectric Furnace MK1"],
|
||||
["block.indrev.electric_furnace_mk2", "Alectric Furnace MK2"],
|
||||
["block.indrev.electric_furnace_mk3", "Alectric Furnace MK3"],
|
||||
["block.indrev.electric_furnace_mk4", "Alectric Furnace MK4"],
|
||||
["block.indrev.electric_furnace_creative", "Alectric Furnace Creative"],
|
||||
["block.indrev.electric_furnace_factory", "Alectric Furnace Factory"],
|
||||
["block.indrev.electric_furnace_factory_mk4", "Alectric Furnace Factory MK4"],
|
||||
]);
|
||||
}
|
||||
|
||||
onEvent("client.generate_assets", lang);
|
5
overrides/kubejs/client_scripts/99-tooltips.js
Normal file
5
overrides/kubejs/client_scripts/99-tooltips.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
function itemTooltips(ev) {
|
||||
ev.add("ae2:spatial_anchor", Text.of("Broken on Fabric!").red());
|
||||
}
|
||||
|
||||
onEvent("item.tooltip", itemTooltips);
|
|
@ -11,9 +11,26 @@ const waystones = [
|
|||
"waystones:blackstone_brick_waystone",
|
||||
];
|
||||
|
||||
const ores_with_missing_tags = {
|
||||
iron: ["archon:cloud_iron"],
|
||||
quartz: [
|
||||
"byg:blue_nether_quartz_ore",
|
||||
"byg:brimstone_nether_quartz_ore",
|
||||
],
|
||||
lapis: ["betternether:nether_lapis_ore"],
|
||||
redstone: ["betternether:nether_redstone_ore"],
|
||||
};
|
||||
|
||||
function blockTags(ev) {
|
||||
// this allows players to activate other people's waystones
|
||||
ev.add("ftbchunks:interact_whitelist", waystones);
|
||||
|
||||
for (let [tag, ores] of Object.entries(ores_with_missing_tags)) {
|
||||
for (ore of ores) {
|
||||
ev.add(`c:${tag}_ores`, ore);
|
||||
ev.add(`c:ores/${tag}`, ore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addNuggetTags(ev, material, item) {
|
||||
|
@ -25,6 +42,13 @@ function itemTags(ev) {
|
|||
// ConsistencyPlus actually doesn't know how tags work
|
||||
addNuggetTags(ev, "copper", "consistency_plus:copper_nugget");
|
||||
addNuggetTags(ev, "netherite", "consistency_plus:netherite_nugget");
|
||||
|
||||
for (let [tag, ores] of Object.entries(ores_with_missing_tags)) {
|
||||
for (ore of ores) {
|
||||
ev.add(`c:${tag}_ores`, ore);
|
||||
ev.add(`c:ores/${tag}`, ore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onEvent("tags.blocks", blockTags);
|
||||
|
|
|
@ -1,15 +1,31 @@
|
|||
function recipes(ev) {
|
||||
ev.remove({output: "tempad:tempad"});
|
||||
|
||||
// conflicts with copper nuggets
|
||||
ev.remove({output: "redstonebits:copper_button"});
|
||||
|
||||
const removeBrokenGrinderRecipe = metal => {
|
||||
// This recipe allows to turn ingots back into raw ores,
|
||||
// allowing infinite duplication.
|
||||
ev.remove({
|
||||
type: "techreborn:industrial_grinder",
|
||||
input: `#c:${metal}_ingots`,
|
||||
output: `#c:raw_${metal}_ores`
|
||||
});
|
||||
};
|
||||
removeBrokenGrinderRecipe("copper");
|
||||
removeBrokenGrinderRecipe("gold");
|
||||
removeBrokenGrinderRecipe("iridium");
|
||||
removeBrokenGrinderRecipe("iron");
|
||||
removeBrokenGrinderRecipe("lead");
|
||||
removeBrokenGrinderRecipe("silver");
|
||||
removeBrokenGrinderRecipe("tin");
|
||||
removeBrokenGrinderRecipe("tungsten");
|
||||
removeBrokenGrinderRecipe("zinc");
|
||||
|
||||
// this recipe makes alectrum out of copper. wtf.
|
||||
ev.remove({
|
||||
type: "create:mixing",
|
||||
output: "techreborn:electrum_ingot",
|
||||
});
|
||||
|
||||
ev.custom({
|
||||
type: "create:mixing",
|
||||
ingredients: [
|
||||
|
@ -29,6 +45,7 @@ function recipes(ev) {
|
|||
C: "#c:copper_ingots",
|
||||
});
|
||||
|
||||
ev.remove({output: "tempad:tempad"});
|
||||
ev.shaped("tempad:tempad", [
|
||||
"GGG",
|
||||
"PCD",
|
||||
|
@ -39,7 +56,6 @@ function recipes(ev) {
|
|||
C: "powah:ender_core",
|
||||
D: "techreborn:digital_display",
|
||||
});
|
||||
|
||||
ev.shaped("tempad:he_who_remains_tempad", [
|
||||
"ITF",
|
||||
"NSN",
|
||||
|
@ -52,6 +68,16 @@ function recipes(ev) {
|
|||
I: "dimdoors:infrangible_fiber",
|
||||
F: "dimdoors:frayed_filament",
|
||||
});
|
||||
|
||||
// broken on fabric
|
||||
ev.remove({
|
||||
output: "ae2:spatial_anchor",
|
||||
});
|
||||
|
||||
// duplicate
|
||||
ev.remove({
|
||||
id: "techreborn:grinder/nether_lapis_ore",
|
||||
});
|
||||
}
|
||||
|
||||
onEvent("recipes", recipes);
|
||||
|
|
37
overrides/kubejs/server_scripts/99-rtp.js
Normal file
37
overrides/kubejs/server_scripts/99-rtp.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
const diameter = 1000000;
|
||||
const y = 200;
|
||||
|
||||
function getRandomCoord() {
|
||||
var n = Math.floor(Math.random() * diameter);
|
||||
if (Math.round(Math.random())) {
|
||||
n *= -1;
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
function onRtpExecute(ctx) {
|
||||
const player = ctx.source.getPlayerOrException().asKJS();
|
||||
const x = getRandomCoord();
|
||||
const z = getRandomCoord();
|
||||
|
||||
// add slow falling so the player doesn't immediately die
|
||||
player.potionEffects.add(
|
||||
"minecraft:slow_falling",
|
||||
15 * 20, // 15 seconds
|
||||
);
|
||||
|
||||
// teleport
|
||||
player.setPositionAndRotation(x, y, z, 0, 0);
|
||||
|
||||
// 1 = success
|
||||
return 1;
|
||||
}
|
||||
|
||||
function commandRegistry(ev) {
|
||||
const { commands: Commands } = ev;
|
||||
|
||||
ev.register(Commands.literal("rtp").executes(onRtpExecute));
|
||||
}
|
||||
|
||||
onEvent("command.registry", commandRegistry);
|
11
settings.zig
11
settings.zig
|
@ -1,8 +1,11 @@
|
|||
// Version number used for the archive name
|
||||
pub const version = "1.3.0";
|
||||
/// Version number used for the archive name
|
||||
pub const version = "1.4.1";
|
||||
pub const build_dir = "build";
|
||||
pub const minecraft_version = "1.18.2";
|
||||
pub const fabric_loader_version = "0.14.8";
|
||||
// zip compression level. 9 is max. ask libarchive why this is a string.
|
||||
/// the data for the `instance.cfg` file
|
||||
pub const instance_cfg_data =
|
||||
\\InstanceType=OneSix
|
||||
;
|
||||
/// zip compression level. 9 is max. ask libarchive why this is a string.
|
||||
pub const compression_level = "9";
|
||||
|
||||
|
|
Loading…
Reference in a new issue