GregTechCEu Modern

GregTechCEu Modern

6M Downloads

[Bug] Unable to add ore veins to Ad Astra's Moon

DancingSnow0517 opened this issue ยท 6 comments

commented

GregTech CEu Version

1.0.17-build_323

Recipe Viewer Installed

JEI

Environment

SP

Cross-Mod Interaction

Yes

Expected Behavior

The ore vein add by KubeJS scripts should spawn on the moon.

Actual Behavior

No vein ore find on ad_astra moon

Steps to Reproduce

  1. Installed mods:
    gtceu-forge-1.20.1-1.0.17-build_323.jar
    ad_astra-forge-1.20.1-1.15.5.jar
    jei-1.20.1-forge-15.2.0.27.jar
    kubejs-forge-2001.6.4-build.107.jar

  2. Added the Startup scripts
    tag_prefixs.js:

GTCEuStartupEvents.registry('gtceu:tag_prefix', event => {
    event.create('moon_stone', 'ore')
        .langValue('Moon %s Ore')
        .materialIconType(GTMaterialIconType.ore)
        .unificationEnabled(true)
        .generationCondition(ItemGenerationCondition.hasOreProperty)
        .stateSupplier(() => Block.getBlock('ad_astra:moon_stone').defaultBlockState())
})

world_gen_layers.js

GTCEuStartupEvents.registry('gtceu:world_gen_layer', event => {
    event.create('t_moon')
        .target(['ad_astra:moon_stone', 'minecraft:soul_soil'])
})
  1. Added the Server scripts
    gt_ore_veins.js
GTCEuServerEvents.oreVeins(event => {
    const $DikeBlockDefinition = Java.loadClass('com.gregtechceu.gtceu.api.data.worldgen.generator.DikeVeinGenerator$DikeBlockDefinition')
    const $IndicatorPlacement = Java.loadClass('com.gregtechceu.gtceu.api.data.worldgen.generator.indicators.SurfaceIndicatorGenerator$IndicatorPlacement')
    
    event.add('test_moon_vein', builder => {
        builder.clusterSize(16)
            .weight(40)
            .density(4)
            .discardChanceOnAirExposure(0.0)
            .addSpawnDimension('ad_astra:moon')
            .addSpawnBiome('#ad_astra:has_structure/lunarian_village_biomes')
            .layer(GTWorldGenLayers.getByName('t_moon'))
            .heightRange({
                height: {
                    type: 'uniform',
                    min_inclusive: {
                        absolute: -50
                    },
                    max_inclusive: {
                        absolute: 10
                    }
                }
            })
            .generator(builder.generatorBuilder('gtceu:dike')
                .withBlock(new $DikeBlockDefinition['(com.gregtechceu.gtceu.api.data.chemical.material.Material,int,int,int)'](GTMaterials.Galena, 3, -50, 20))
                .withBlock(new $DikeBlockDefinition['(com.gregtechceu.gtceu.api.data.chemical.material.Material,int,int,int)'](GTMaterials.Lead, 1, -50, 20))
                .withBlock(new $DikeBlockDefinition['(com.gregtechceu.gtceu.api.data.chemical.material.Material,int,int,int)'](GTMaterials.Silver, 1, -50, 20))
                .minYLevel(-50)
                .maxYLevel(10)
                .parent()
                .surfaceIndicatorGenerator(indicator => indicator
                    .surfaceRock(GTMaterials.Galena)
                    .placement($IndicatorPlacement.ABOVE)
                )
            )
    })
})
  1. Restart Minecraft Client
  2. Create a new World and run command execute in as_astra:moon run tp 0 120 0
  3. Give myself Prospector, doesn't find any custom ore vein.

Additional Information

No response

commented

you didn't set valid dimensions for the world gen layer.

commented

https://github.com/Arborsm/Arbor-s-GTceu-Modern-Pack/blob/main/kubejs/server_scripts/gregtech/ores.js works, might help you, and the tagprefix registry on kjs has some issues, recommend to make a mod for it.

commented

Modifying scripts world_gen_layers.js

GTCEuStartupEvents.registry('gtceu:world_gen_layer', event => {
    event.create('t_moon')
        .target(['ad_astra:moon_stone', 'minecraft:soul_soil'])
        .dimensions(['ad_astra:moon'])
})

Still not working......

commented

Use addDimension methon doesn't work too...

GTCEuStartupEvents.registry('gtceu:world_gen_layer', event => {
    event.create('t_moon')
        .target(['ad_astra:moon_stone', 'minecraft:soul_soil'])
        .addDimension('ad_astra:moon')
})
commented

I write simple mod to registry tagprefix, and then, it works!!! Thanks

commented

https://github.com/Arborsm/Arbor-s-GTceu-Modern-Pack/blob/main/kubejs/server_scripts/gregtech/ores.js works, might help you, and the tagprefix registry on kjs has some issues, recommend to make a mod for it.

I have some problem in write mod, my mod build script like your ModPack-Core, but can't runClient in Dev environment.

May I ask if it's convenient to add a specific contact information? Thanks