neuralgia/kubejs/server_scripts/tfg/events.chunks.js
Gustavo f3dfa471ec
Refactor & update to gt7
* gt7 removed credits/coins

* port gregtech additions to java

* add eslint locally

* add style linting

* switch target ECMA standard

* run linter

* clean up a bunch of linter errors

* remove outdated greate API calls

* forgot about the TFC multi compat issue

* reverted greate recipe removals

* some more linting stuff

* fix some issues with greenhouse recipes

* fix up some material stuff

* fix recipe types

* - Fixed single block machine rendering (#1465)

* minor fixes and changes

---------

Signed-off-by: Pyritie <pyritie@gmail.com>
Co-authored-by: Pyritie <pyritie@gmail.com>
Co-authored-by: Redeix <59435925+Redeix@users.noreply.github.com>
2025-07-28 12:27:06 +10:00

58 lines
1.6 KiB
JavaScript

// priority: 0
"use strict";
TFCEvents.createChunkDataProvider('mars', event => {
const rain = TFC.misc.lerpFloatLayer(0, 0, 0, 0);
const tempLayer = TFC.misc.newOpenSimplex2D(event.worldSeed + 4621678939469)
.spread(0.2)
.octaves(3)
.scaled(70, 90)
const forestLayer = TFC.misc.newOpenSimplex2D(event.worldSeed + 98713856895664)
.spread(0.8)
.terraces(9)
.affine(6, 12)
.scaled(6, 18, 0, 1)
// Precompute the surface & aquifer heights as constants as this is nether and does not realistically change
let heights = [];
let i = 0;
while (i < 256) {
heights.push(127);
i++;
}
let aquifer = [];
i = 0;
while (i < 16) {
aquifer.push(32);
i++;
}
event.partial((data, chunk) => {
let x = chunk.pos.minBlockX;
let z = chunk.pos.minBlockZ;
let temp = TFC.misc.lerpFloatLayer(
tempLayer.noise(x, z),
tempLayer.noise(x, z + 15),
tempLayer.noise(x + 15, z),
tempLayer.noise(x + 15, z + 15)
);
data.generatePartial(
rain,
temp,
forestLayer.noise(x, z) * 4, // Kube accepts ordinal numbers for enum constants
forestLayer.noise(x * 78423 + 869, z),
forestLayer.noise(x, z * 651349 - 698763)
);
});
event.full((data, chunk) => {
data.generateFull(heights, aquifer);
});
event.rocks((x, y, z, surfaceY, cache, rockLayers) => {
return rockLayers.sampleAtLayer(0, 0);
});
})