RetardsModpack/kubejs/server_scripts/creative.js
2026-02-08 21:40:15 +01:00

72 lines
1.8 KiB
JavaScript

// Creates and configures the Creative dimension
/*
const config = global.config;
const hexToRgb = global.hexToRgb;
/////////////////
/// DIMENSION ///
/////////////////
// Defines the Creative dimension
ServerEvents.highPriorityData((event) => {
event.addJson("retards:dimension/creative.json", {
type: "minecraft:overworld",
generator: {
type: "minecraft:flat",
settings: {
biome: "minecraft:plains",
lakes: false,
features: false,
layers: Object.entries(config.creative.layers).map(
([block, count]) => ({
block: block,
height: count,
}),
),
structures: {},
},
},
});
});
//////////////
/// PORTAL ///
//////////////
// Defines the Creative portal
/*
ServerEvents.highPriorityData((event) => {
const portal = config.creative;
const color = hexToRgb(portal.color);
event.addJson("retards:portals/creative.json", {
block: portal.material,
dim: "retards:creative",
r: color.r,
g: color.g,
b: color.b,
ignitionType: "FLUID",
ignitionSource: portal.fluid,
});
});
//////////////
/// DIMINV ///
//////////////
// Applies Dimensional Inventories to the Creative dimension
PlayerEvents.loggedIn((event) => {
const data = event.server.persistentData;
if (!data.creativeInitialized) {
data.creativeInitialized = true;
event.server.runCommandSilent("diminv pool creative create");
event.server.runCommandSilent(
"diminv pool creative dimension retards:creative assign",
);
event.server.runCommandSilent("diminv pool creative gameMode creative");
event.server.runCommandSilent(
"diminv pool creative progressAdvancements false",
);
event.server.runCommandSilent(
"diminv pool creative incrementStatistics false",
);
}
});
*/