跳到正文

Groovy World

作者:phantamanta44

world feature generator toolkit for groovyscript

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

Groovy World provides a collection of tools for defining custom feature generators (ores, surface decorations, etc.) in GroovyScript.

You can register features with your own world generation logic in a closure:

mods.groovyworld.featureRegistry.addFeature("my_cool_feature") { rng, world, chunkMinX, chunkMinZ ->
    // randomly place one diamond ore block somewhere in the chunk
    world.setBlockState(
            new BlockPos(chunkMinX + rng.nextInt(16), rng.nextInt(64), chunkMinZ + rng.nextInt(16)),
            Blocks.DIAMOND_ORE.getDefaultState())
}

You can also assemble pieces of the Groovy World toolkit to quickly build more complex feature generators:

mods.groovyworld.featureRegistry.addFeature("my_awesome_feature", new FeatureBuilder()
        // only generate the feature in dimension 0 (the overworld)
        .setChunkFilter(ChunkFilters.dimension(0))
        // try to place the feature 4 times per chunk
        .setTriesPerChunk(4) 
        // distribute the feature uniformly between y=4 and y=32
        .setDistribution(FeatureDistributions.uniformY(4, 32))
        // only generate the feature if there is a stone block at the target position
        .setBlockFilter(BlockFilters.naturalStone())
        // paint a sphere of ore at the target position
        .setPainter(Painters.brush(
                BrushGeometries.sphere(2.5), // paint a sphere of radius 2.5
                BlockFilters.naturalStone(), // only paint the ore over stone blocks
                BlockPalettes.block(Blocks.DIAMOND_ORE, Blocks.GOLD_ORE))) // pick either diamond or gold for each ore
        .build())

For more information and examples, check out the GitHub repository.

常见问题

Groovy World 支持哪些 Minecraft 版本?

Groovy World 支持 Minecraft Java 版 1.12.2,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。

Groovy World 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

phantamanta44 的其他作品

查看全部 →