├── .editorconfig ├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.md │ ├── FEATURE_REQUEST.md │ ├── OTHER_ISSUES.md │ └── config.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── gradle-build.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts └── src │ └── main │ └── kotlin │ ├── AddonConfig.kt │ ├── CompilationConfig.kt │ ├── DependencyConfig.kt │ ├── DistributionConfig.kt │ ├── PublishingConfig.kt │ ├── Utils.kt │ ├── Versions.kt │ └── com │ └── dfsek │ └── terra │ └── tectonicdoc │ ├── DocumentedTemplate.kt │ ├── GenerateDocsTask.kt │ └── TectonicDocPlugin.kt ├── common ├── addons │ ├── README.md │ ├── api-addon-loader │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── addon │ │ │ └── loader │ │ │ ├── ApiAddon.java │ │ │ ├── ApiAddonClassLoader.java │ │ │ └── ApiAddonLoader.java │ ├── biome-provider-extrusion │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── biome │ │ │ │ └── extrusion │ │ │ │ ├── BaseBiomeColumn.java │ │ │ │ ├── BiomeExtrusionAddon.java │ │ │ │ ├── BiomeExtrusionProvider.java │ │ │ │ ├── api │ │ │ │ ├── Extrusion.java │ │ │ │ ├── PresentBiome.java │ │ │ │ ├── ReplaceableBiome.java │ │ │ │ └── SelfBiome.java │ │ │ │ ├── config │ │ │ │ ├── BiomeExtrusionTemplate.java │ │ │ │ ├── ReplaceableBiomeLoader.java │ │ │ │ └── extrusions │ │ │ │ │ ├── ReplaceExtrusionTemplate.java │ │ │ │ │ ├── SamplerExtrusionTemplate.java │ │ │ │ │ └── SetExtrusionTemplate.java │ │ │ │ └── extrusions │ │ │ │ ├── ReplaceExtrusion.java │ │ │ │ └── SetExtrusion.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── biome-provider-image-v2 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── biome │ │ │ │ └── image │ │ │ │ └── v2 │ │ │ │ ├── ImageBiomeProvider.java │ │ │ │ ├── ImageBiomeProviderAddon.java │ │ │ │ └── config │ │ │ │ ├── ImageProviderTemplate.java │ │ │ │ └── converter │ │ │ │ ├── ClosestBiomeColorConverterTemplate.java │ │ │ │ ├── ExactBiomeColorConverterTemplate.java │ │ │ │ └── mapping │ │ │ │ └── DefinedBiomeColorMappingTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── biome-provider-image │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── biome │ │ │ │ └── image │ │ │ │ ├── ImageBiomeProvider.java │ │ │ │ ├── ImageBiomeProviderAddon.java │ │ │ │ └── ImageProviderTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── biome-provider-pipeline-v2 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── biome │ │ │ │ └── pipeline │ │ │ │ └── v2 │ │ │ │ ├── BiomePipelineAddon.java │ │ │ │ ├── BiomePipelineColumn.java │ │ │ │ ├── PipelineBiomeProvider.java │ │ │ │ ├── api │ │ │ │ ├── BiomeChunk.java │ │ │ │ ├── Expander.java │ │ │ │ ├── Pipeline.java │ │ │ │ ├── Source.java │ │ │ │ ├── Stage.java │ │ │ │ └── biome │ │ │ │ │ ├── DelegatedPipelineBiome.java │ │ │ │ │ ├── PipelineBiome.java │ │ │ │ │ ├── PlaceholderPipelineBiome.java │ │ │ │ │ └── SelfPipelineBiome.java │ │ │ │ ├── config │ │ │ │ ├── BiomePipelineTemplate.java │ │ │ │ ├── PipelineBiomeLoader.java │ │ │ │ ├── source │ │ │ │ │ ├── SamplerSourceTemplate.java │ │ │ │ │ └── SourceTemplate.java │ │ │ │ └── stage │ │ │ │ │ ├── StageTemplate.java │ │ │ │ │ ├── expander │ │ │ │ │ └── ExpanderStageTemplate.java │ │ │ │ │ └── mutator │ │ │ │ │ ├── BorderListStageTemplate.java │ │ │ │ │ ├── BorderStageTemplate.java │ │ │ │ │ ├── ReplaceListStageTemplate.java │ │ │ │ │ ├── ReplaceStageTemplate.java │ │ │ │ │ └── SmoothStageTemplate.java │ │ │ │ ├── pipeline │ │ │ │ ├── BiomeChunkImpl.java │ │ │ │ └── PipelineImpl.java │ │ │ │ ├── source │ │ │ │ ├── SamplerSource.java │ │ │ │ └── SingleSource.java │ │ │ │ └── stage │ │ │ │ ├── expander │ │ │ │ └── FractalExpander.java │ │ │ │ └── mutators │ │ │ │ ├── BorderListStage.java │ │ │ │ ├── BorderStage.java │ │ │ │ ├── ReplaceListStage.java │ │ │ │ ├── ReplaceStage.java │ │ │ │ └── SmoothStage.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── biome-provider-pipeline │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── biome │ │ │ │ └── pipeline │ │ │ │ ├── BiomeHolderImpl.java │ │ │ │ ├── BiomePipeline.java │ │ │ │ ├── BiomePipelineAddon.java │ │ │ │ ├── BiomePipelineColumn.java │ │ │ │ ├── BiomePipelineProvider.java │ │ │ │ ├── api │ │ │ │ ├── BiomeHolder.java │ │ │ │ ├── delegate │ │ │ │ │ ├── BiomeDelegate.java │ │ │ │ │ ├── DelegatedBiome.java │ │ │ │ │ ├── EphemeralBiomeDelegate.java │ │ │ │ │ └── SelfDelegate.java │ │ │ │ └── stage │ │ │ │ │ ├── Stage.java │ │ │ │ │ └── type │ │ │ │ │ ├── BiomeExpander.java │ │ │ │ │ └── BiomeMutator.java │ │ │ │ ├── config │ │ │ │ ├── BiomeDelegateLoader.java │ │ │ │ ├── BiomePipelineTemplate.java │ │ │ │ ├── BiomeProviderTemplate.java │ │ │ │ ├── SamplerSourceTemplate.java │ │ │ │ ├── SourceTemplate.java │ │ │ │ └── stage │ │ │ │ │ ├── StageTemplate.java │ │ │ │ │ ├── expander │ │ │ │ │ └── ExpanderStageTemplate.java │ │ │ │ │ └── mutator │ │ │ │ │ ├── BorderListMutatorTemplate.java │ │ │ │ │ ├── BorderMutatorTemplate.java │ │ │ │ │ ├── ReplaceListMutatorTemplate.java │ │ │ │ │ ├── ReplaceMutatorTemplate.java │ │ │ │ │ └── SmoothMutatorTemplate.java │ │ │ │ ├── expand │ │ │ │ └── FractalExpander.java │ │ │ │ ├── mutator │ │ │ │ ├── BorderListMutator.java │ │ │ │ ├── BorderMutator.java │ │ │ │ ├── ReplaceListMutator.java │ │ │ │ ├── ReplaceMutator.java │ │ │ │ └── SmoothMutator.java │ │ │ │ ├── source │ │ │ │ ├── BiomeSource.java │ │ │ │ └── SamplerSource.java │ │ │ │ └── stages │ │ │ │ ├── ExpanderStage.java │ │ │ │ └── MutatorStage.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── biome-provider-single │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── biome │ │ │ │ └── single │ │ │ │ ├── SingleBiomeProvider.java │ │ │ │ ├── SingleBiomeProviderAddon.java │ │ │ │ └── SingleBiomeProviderTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── biome-query-api │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── biome │ │ │ │ └── query │ │ │ │ ├── BiomeQueryAPIAddon.java │ │ │ │ ├── api │ │ │ │ └── BiomeQueries.java │ │ │ │ └── impl │ │ │ │ ├── BiomeTagFlattener.java │ │ │ │ ├── BiomeTagHolder.java │ │ │ │ └── SingleTagQuery.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── chunk-generator-noise-3d │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── chunkgenerator │ │ │ │ ├── NoiseChunkGenerator3DAddon.java │ │ │ │ ├── config │ │ │ │ ├── NoiseChunkGeneratorPackConfigTemplate.java │ │ │ │ ├── noise │ │ │ │ │ ├── BiomeNoiseConfigTemplate.java │ │ │ │ │ ├── BiomeNoiseProperties.java │ │ │ │ │ └── ThreadLocalNoiseHolder.java │ │ │ │ └── palette │ │ │ │ │ ├── BiomePaletteTemplate.java │ │ │ │ │ └── slant │ │ │ │ │ └── SlantLayerTemplate.java │ │ │ │ ├── generation │ │ │ │ ├── NoiseChunkGenerator3D.java │ │ │ │ └── math │ │ │ │ │ ├── SlantCalculationMethod.java │ │ │ │ │ ├── interpolation │ │ │ │ │ ├── ChunkInterpolator.java │ │ │ │ │ ├── ElevationInterpolator.java │ │ │ │ │ ├── Interpolator.java │ │ │ │ │ ├── Interpolator3.java │ │ │ │ │ └── LazilyEvaluatedInterpolator.java │ │ │ │ │ └── samplers │ │ │ │ │ ├── Sampler3D.java │ │ │ │ │ └── SamplerProvider.java │ │ │ │ └── palette │ │ │ │ ├── BiomePaletteInfo.java │ │ │ │ ├── PaletteHolder.java │ │ │ │ └── slant │ │ │ │ ├── MultipleSlantHolder.java │ │ │ │ ├── SingleSlantHolder.java │ │ │ │ ├── SlantHolder.java │ │ │ │ └── SlantHolderImpl.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── command-addons │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── commands │ │ │ │ └── addons │ │ │ │ └── AddonsCommandAddon.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── command-packs │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── commands │ │ │ │ └── packs │ │ │ │ └── PacksCommandAddon.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── command-profiler │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── commands │ │ │ │ └── profiler │ │ │ │ └── ProfilerCommandAddon.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── command-structures │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── commands │ │ │ │ └── structure │ │ │ │ └── StructureCommandAddon.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-biome │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── biome │ │ │ │ ├── BiomeAddon.java │ │ │ │ ├── BiomeConfigType.java │ │ │ │ ├── BiomeFactory.java │ │ │ │ ├── BiomeTemplate.java │ │ │ │ ├── PaletteSettingsImpl.java │ │ │ │ ├── UserDefinedBiome.java │ │ │ │ └── holder │ │ │ │ ├── PaletteHolder.java │ │ │ │ ├── PaletteHolderBuilder.java │ │ │ │ └── PaletteHolderLoader.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-distributors │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── feature │ │ │ │ └── distributor │ │ │ │ ├── DistributorAddon.java │ │ │ │ ├── config │ │ │ │ ├── AndDistributorTemplate.java │ │ │ │ ├── NoDistributorTemplate.java │ │ │ │ ├── OrDistributorTemplate.java │ │ │ │ ├── PaddedGridDistributorTemplate.java │ │ │ │ ├── PointSetDistributorTemplate.java │ │ │ │ ├── SamplerDistributorTemplate.java │ │ │ │ ├── XorDistributorTemplate.java │ │ │ │ └── YesDistributorTemplate.java │ │ │ │ ├── distributors │ │ │ │ ├── PaddedGridDistributor.java │ │ │ │ ├── PointSetDistributor.java │ │ │ │ └── SamplerDistributor.java │ │ │ │ └── util │ │ │ │ ├── Point.java │ │ │ │ └── PointTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-feature │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── feature │ │ │ │ ├── ConfiguredFeature.java │ │ │ │ ├── FeatureAddon.java │ │ │ │ ├── FeatureConfigType.java │ │ │ │ ├── FeatureFactory.java │ │ │ │ └── FeatureTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-flora │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── flora │ │ │ │ ├── FloraAddon.java │ │ │ │ ├── FloraConfigType.java │ │ │ │ ├── FloraFactory.java │ │ │ │ ├── FloraTemplate.java │ │ │ │ ├── config │ │ │ │ └── BlockLayerTemplate.java │ │ │ │ └── flora │ │ │ │ └── gen │ │ │ │ ├── BlockLayer.java │ │ │ │ └── TerraFlora.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-locators │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── feature │ │ │ │ └── locator │ │ │ │ ├── LocatorAddon.java │ │ │ │ ├── config │ │ │ │ ├── AdjacentPatternLocatorTemplate.java │ │ │ │ ├── AndLocatorTemplate.java │ │ │ │ ├── GaussianRandomLocatorTemplate.java │ │ │ │ ├── OrLocatorTemplate.java │ │ │ │ ├── PatternLocatorTemplate.java │ │ │ │ ├── RandomLocatorTemplate.java │ │ │ │ ├── Sampler3DLocatorTemplate.java │ │ │ │ ├── SamplerLocatorTemplate.java │ │ │ │ ├── SurfaceLocatorTemplate.java │ │ │ │ ├── TopLocatorTemplate.java │ │ │ │ ├── XorLocatorTemplate.java │ │ │ │ └── pattern │ │ │ │ │ ├── AirMatchPatternTemplate.java │ │ │ │ │ ├── AndPatternTemplate.java │ │ │ │ │ ├── BlockSetMatchPatternTemplate.java │ │ │ │ │ ├── NotPatternTemplate.java │ │ │ │ │ ├── OrPatternTemplate.java │ │ │ │ │ ├── SingleBlockMatchPatternTemplate.java │ │ │ │ │ ├── SolidMatchPatternTemplate.java │ │ │ │ │ └── XorPatternTemplate.java │ │ │ │ ├── locators │ │ │ │ ├── AdjacentPatternLocator.java │ │ │ │ ├── GaussianRandomLocator.java │ │ │ │ ├── PatternLocator.java │ │ │ │ ├── RandomLocator.java │ │ │ │ ├── Sampler3DLocator.java │ │ │ │ ├── SamplerLocator.java │ │ │ │ ├── SurfaceLocator.java │ │ │ │ └── TopLocator.java │ │ │ │ └── patterns │ │ │ │ ├── MatchPattern.java │ │ │ │ └── Pattern.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-noise-function │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── noise │ │ │ │ ├── NoiseAddon.java │ │ │ │ ├── NoiseConfigPackTemplate.java │ │ │ │ ├── config │ │ │ │ ├── CubicSplinePointTemplate.java │ │ │ │ ├── DimensionApplicableNoiseSampler.java │ │ │ │ └── templates │ │ │ │ │ ├── BinaryArithmeticTemplate.java │ │ │ │ │ ├── CacheSamplerTemplate.java │ │ │ │ │ ├── DerivativeNoiseSamplerTemplate.java │ │ │ │ │ ├── DomainWarpTemplate.java │ │ │ │ │ ├── FunctionTemplate.java │ │ │ │ │ ├── ImageSamplerTemplate.java │ │ │ │ │ ├── KernelTemplate.java │ │ │ │ │ ├── LinearHeightmapSamplerTemplate.java │ │ │ │ │ ├── SamplerTemplate.java │ │ │ │ │ ├── TranslateSamplerTemplate.java │ │ │ │ │ ├── noise │ │ │ │ │ ├── CellularNoiseTemplate.java │ │ │ │ │ ├── ConstantNoiseTemplate.java │ │ │ │ │ ├── DerivativeNoiseTemplate.java │ │ │ │ │ ├── DistanceSamplerTemplate.java │ │ │ │ │ ├── ExpressionFunctionTemplate.java │ │ │ │ │ ├── GaborNoiseTemplate.java │ │ │ │ │ ├── NoiseTemplate.java │ │ │ │ │ ├── PseudoErosionTemplate.java │ │ │ │ │ ├── SimpleNoiseTemplate.java │ │ │ │ │ └── fractal │ │ │ │ │ │ ├── BrownianMotionTemplate.java │ │ │ │ │ │ ├── FractalTemplate.java │ │ │ │ │ │ ├── PingPongTemplate.java │ │ │ │ │ │ └── RidgedFractalTemplate.java │ │ │ │ │ └── normalizer │ │ │ │ │ ├── ClampNormalizerTemplate.java │ │ │ │ │ ├── CubicSplineNormalizerTemplate.java │ │ │ │ │ ├── ExpressionNormalizerTemplate.java │ │ │ │ │ ├── LinearMapNormalizerTemplate.java │ │ │ │ │ ├── LinearNormalizerTemplate.java │ │ │ │ │ ├── NormalNormalizerTemplate.java │ │ │ │ │ ├── NormalizerTemplate.java │ │ │ │ │ ├── PosterizationNormalizerTemplate.java │ │ │ │ │ ├── ProbabilityNormalizerTemplate.java │ │ │ │ │ └── ScaleNormalizerTemplate.java │ │ │ │ ├── math │ │ │ │ └── CubicSpline.java │ │ │ │ ├── normalizer │ │ │ │ ├── ClampNormalizer.java │ │ │ │ ├── CubicSplineNoiseSampler.java │ │ │ │ ├── ExpressionNormalizer.java │ │ │ │ ├── LinearMapNormalizer.java │ │ │ │ ├── LinearNormalizer.java │ │ │ │ ├── NormalNormalizer.java │ │ │ │ ├── Normalizer.java │ │ │ │ ├── PosterizationNormalizer.java │ │ │ │ ├── ProbabilityNormalizer.java │ │ │ │ └── ScaleNormalizer.java │ │ │ │ ├── paralithic │ │ │ │ ├── FunctionUtil.java │ │ │ │ ├── defined │ │ │ │ │ └── UserDefinedFunction.java │ │ │ │ └── noise │ │ │ │ │ ├── NoiseFunction2.java │ │ │ │ │ ├── NoiseFunction3.java │ │ │ │ │ ├── SaltedNoiseFunction2.java │ │ │ │ │ ├── SaltedNoiseFunction3.java │ │ │ │ │ └── SeedContext.java │ │ │ │ └── samplers │ │ │ │ ├── CacheSampler.java │ │ │ │ ├── DomainWarpedSampler.java │ │ │ │ ├── ImageSampler.java │ │ │ │ ├── KernelSampler.java │ │ │ │ ├── LinearHeightmapSampler.java │ │ │ │ ├── TranslateSampler.java │ │ │ │ ├── arithmetic │ │ │ │ ├── AdditionSampler.java │ │ │ │ ├── BinaryArithmeticSampler.java │ │ │ │ ├── DivisionSampler.java │ │ │ │ ├── MaxSampler.java │ │ │ │ ├── MinSampler.java │ │ │ │ ├── MultiplicationSampler.java │ │ │ │ └── SubtractionSampler.java │ │ │ │ └── noise │ │ │ │ ├── CellularSampler.java │ │ │ │ ├── ConstantSampler.java │ │ │ │ ├── DerivativeNoiseFunction.java │ │ │ │ ├── DistanceSampler.java │ │ │ │ ├── ExpressionFunction.java │ │ │ │ ├── GaborNoiseSampler.java │ │ │ │ ├── NoiseFunction.java │ │ │ │ ├── PseudoErosionSampler.java │ │ │ │ ├── fractal │ │ │ │ ├── BrownianMotionSampler.java │ │ │ │ ├── FractalNoiseFunction.java │ │ │ │ ├── PingPongSampler.java │ │ │ │ └── RidgedFractalSampler.java │ │ │ │ ├── random │ │ │ │ ├── GaussianNoiseSampler.java │ │ │ │ ├── PositiveWhiteNoiseSampler.java │ │ │ │ └── WhiteNoiseSampler.java │ │ │ │ ├── simplex │ │ │ │ ├── OpenSimplex2SSampler.java │ │ │ │ ├── OpenSimplex2Sampler.java │ │ │ │ ├── PerlinSampler.java │ │ │ │ ├── SimplexSampler.java │ │ │ │ └── SimplexStyleSampler.java │ │ │ │ └── value │ │ │ │ ├── ValueCubicSampler.java │ │ │ │ ├── ValueSampler.java │ │ │ │ └── ValueStyleNoise.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-number-predicate │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── numberpredicate │ │ │ │ ├── DoublePredicateLoader.java │ │ │ │ └── NumberPredicateAddon.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-ore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── ore │ │ │ │ ├── OreAddon.java │ │ │ │ ├── OreConfigType.java │ │ │ │ ├── OreFactory.java │ │ │ │ ├── OreTemplate.java │ │ │ │ ├── ScatteredOreConfigType.java │ │ │ │ ├── ScatteredOreFactory.java │ │ │ │ ├── ScatteredOreTemplate.java │ │ │ │ ├── ores │ │ │ │ ├── VanillaOre.java │ │ │ │ └── VanillaScatteredOre.java │ │ │ │ └── utils │ │ │ │ └── VanillaOreUtils.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-palette │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── palette │ │ │ │ ├── PaletteAddon.java │ │ │ │ ├── PaletteConfigType.java │ │ │ │ ├── PaletteFactory.java │ │ │ │ ├── PaletteTemplate.java │ │ │ │ └── palette │ │ │ │ ├── PaletteImpl.java │ │ │ │ ├── PaletteLayerHolder.java │ │ │ │ └── PaletteLayerLoader.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── config-structure │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── structure │ │ │ │ ├── BiomeStructures.java │ │ │ │ ├── BiomeStructuresTemplate.java │ │ │ │ ├── StructureAddon.java │ │ │ │ ├── StructureConfigType.java │ │ │ │ ├── StructureFactory.java │ │ │ │ ├── StructureTemplate.java │ │ │ │ ├── TerraStructure.java │ │ │ │ └── structures │ │ │ │ └── loot │ │ │ │ ├── Entry.java │ │ │ │ ├── LootTableImpl.java │ │ │ │ ├── Pool.java │ │ │ │ └── functions │ │ │ │ ├── AmountFunction.java │ │ │ │ ├── DamageFunction.java │ │ │ │ ├── EnchantFunction.java │ │ │ │ └── LootFunction.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── generation-stage-feature │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── generation │ │ │ │ └── feature │ │ │ │ ├── FeatureGenerationAddon.java │ │ │ │ ├── FeatureGenerationStage.java │ │ │ │ └── config │ │ │ │ ├── BiomeFeatures.java │ │ │ │ └── FeatureStageTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── generation-stage-structure │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── generation │ │ │ │ └── structure │ │ │ │ ├── StructureGenerationAddon.java │ │ │ │ ├── StructureGenerationStage.java │ │ │ │ └── config │ │ │ │ ├── BiomeStructures.java │ │ │ │ └── BiomeStructuresTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── language-yaml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── yaml │ │ │ │ └── YamlAddon.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── library-image │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── image │ │ │ │ ├── ImageLibraryAddon.java │ │ │ │ ├── colorsampler │ │ │ │ ├── ColorSampler.java │ │ │ │ ├── image │ │ │ │ │ ├── SingleImageColorSampler.java │ │ │ │ │ ├── TileImageColorSampler.java │ │ │ │ │ └── transform │ │ │ │ │ │ ├── Alignment.java │ │ │ │ │ │ └── ImageTransformation.java │ │ │ │ └── mutate │ │ │ │ │ ├── RotateColorSampler.java │ │ │ │ │ └── TranslateColorSampler.java │ │ │ │ ├── config │ │ │ │ ├── ColorLoader.java │ │ │ │ ├── ImageLibraryPackConfigTemplate.java │ │ │ │ ├── colorsampler │ │ │ │ │ ├── ConstantColorSamplerTemplate.java │ │ │ │ │ ├── image │ │ │ │ │ │ ├── ImageColorSamplerTemplate.java │ │ │ │ │ │ ├── SingleImageColorSamplerTemplate.java │ │ │ │ │ │ └── TileImageColorSamplerTemplate.java │ │ │ │ │ └── mutate │ │ │ │ │ │ ├── MutateColorSamplerTemplate.java │ │ │ │ │ │ ├── RotateColorSamplerTemplate.java │ │ │ │ │ │ └── TranslateColorSamplerTemplate.java │ │ │ │ ├── converter │ │ │ │ │ ├── ClosestColorConverterTemplate.java │ │ │ │ │ ├── ColorConverterTemplate.java │ │ │ │ │ └── ExactColorConverterTemplate.java │ │ │ │ ├── image │ │ │ │ │ ├── ImageCache.java │ │ │ │ │ ├── ImageTemplate.java │ │ │ │ │ └── StitchedImageTemplate.java │ │ │ │ └── noisesampler │ │ │ │ │ ├── ChannelNoiseSamplerTemplate.java │ │ │ │ │ └── DistanceTransformNoiseSamplerTemplate.java │ │ │ │ ├── converter │ │ │ │ ├── ClosestMatchColorConverter.java │ │ │ │ ├── ColorConverter.java │ │ │ │ ├── ExactColorConverter.java │ │ │ │ └── mapping │ │ │ │ │ ├── BiomeDefinedColorMapping.java │ │ │ │ │ └── ColorMapping.java │ │ │ │ ├── image │ │ │ │ ├── BufferedImageWrapper.java │ │ │ │ ├── Image.java │ │ │ │ ├── StitchedImage.java │ │ │ │ └── SuppliedImage.java │ │ │ │ ├── noisesampler │ │ │ │ └── ChannelNoiseSampler.java │ │ │ │ ├── operator │ │ │ │ └── DistanceTransform.java │ │ │ │ └── util │ │ │ │ ├── ColorUtil.java │ │ │ │ ├── MapUtil.java │ │ │ │ └── MathUtil.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── locator-slant-noise-3d │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addon │ │ │ │ └── feature │ │ │ │ └── locator │ │ │ │ └── slant │ │ │ │ ├── SlantLocator.java │ │ │ │ ├── SlantLocatorAddon.java │ │ │ │ └── SlantLocatorTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── manifest-addon-loader │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── addons │ │ │ └── manifest │ │ │ ├── api │ │ │ └── AddonInitializer.java │ │ │ └── impl │ │ │ ├── ManifestAddon.java │ │ │ ├── ManifestAddonClassLoader.java │ │ │ ├── ManifestAddonLoader.java │ │ │ ├── config │ │ │ ├── AddonManifest.java │ │ │ ├── WebsiteConfig.java │ │ │ └── loaders │ │ │ │ ├── VersionLoader.java │ │ │ │ └── VersionRangeLoader.java │ │ │ └── exception │ │ │ ├── AddonException.java │ │ │ ├── ManifestException.java │ │ │ └── ManifestNotPresentException.java │ ├── palette-block-shortcut │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── palette │ │ │ │ └── shortcut │ │ │ │ └── block │ │ │ │ ├── PaletteBlockShortcutAddon.java │ │ │ │ └── SingletonPalette.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── pipeline-image │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── biome │ │ │ │ └── pipeline │ │ │ │ └── image │ │ │ │ ├── ImageSource.java │ │ │ │ ├── PipelineImageAddon.java │ │ │ │ └── config │ │ │ │ ├── ImageSourceTemplate.java │ │ │ │ └── converter │ │ │ │ ├── ClosestPipelineBiomeColorConverterTemplate.java │ │ │ │ ├── ExactPipelineBiomeColorConverterTemplate.java │ │ │ │ └── mapping │ │ │ │ └── DefinedPipelineBiomeColorMappingTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── structure-block-shortcut │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── palette │ │ │ │ └── shortcut │ │ │ │ └── block │ │ │ │ ├── SingletonStructure.java │ │ │ │ └── StructureBlockShortcutAddon.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── structure-mutator │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── structure │ │ │ │ └── mutator │ │ │ │ ├── MutatedStructure.java │ │ │ │ ├── MutatedStructureConfigType.java │ │ │ │ ├── MutatedStructureFactory.java │ │ │ │ ├── StructureMutatorAddon.java │ │ │ │ └── config │ │ │ │ └── MutatedStructureTemplate.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── structure-sponge-loader │ │ ├── LICENSE │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addons │ │ │ │ └── sponge │ │ │ │ ├── SpongeSchematicAddon.java │ │ │ │ └── SpongeStructure.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ ├── structure-terrascript-loader │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── dfsek │ │ │ │ │ └── terra │ │ │ │ │ └── addons │ │ │ │ │ └── terrascript │ │ │ │ │ ├── TerraScriptAddon.java │ │ │ │ │ ├── parser │ │ │ │ │ ├── Parser.java │ │ │ │ │ ├── ParserUtil.java │ │ │ │ │ ├── exceptions │ │ │ │ │ │ └── ParseException.java │ │ │ │ │ └── lang │ │ │ │ │ │ ├── Block.java │ │ │ │ │ │ ├── Executable.java │ │ │ │ │ │ ├── ImplementationArguments.java │ │ │ │ │ │ ├── Item.java │ │ │ │ │ │ ├── Keyword.java │ │ │ │ │ │ ├── Returnable.java │ │ │ │ │ │ ├── Scope.java │ │ │ │ │ │ ├── Statement.java │ │ │ │ │ │ ├── constants │ │ │ │ │ │ ├── BooleanConstant.java │ │ │ │ │ │ ├── ConstantExpression.java │ │ │ │ │ │ ├── NumericConstant.java │ │ │ │ │ │ └── StringConstant.java │ │ │ │ │ │ ├── functions │ │ │ │ │ │ ├── Function.java │ │ │ │ │ │ └── FunctionBuilder.java │ │ │ │ │ │ ├── keywords │ │ │ │ │ │ ├── flow │ │ │ │ │ │ │ ├── BreakKeyword.java │ │ │ │ │ │ │ ├── ContinueKeyword.java │ │ │ │ │ │ │ ├── FailKeyword.java │ │ │ │ │ │ │ └── ReturnKeyword.java │ │ │ │ │ │ └── looplike │ │ │ │ │ │ │ ├── ForKeyword.java │ │ │ │ │ │ │ ├── IfKeyword.java │ │ │ │ │ │ │ └── WhileKeyword.java │ │ │ │ │ │ ├── operations │ │ │ │ │ │ ├── BinaryOperation.java │ │ │ │ │ │ ├── BooleanAndOperation.java │ │ │ │ │ │ ├── BooleanNotOperation.java │ │ │ │ │ │ ├── BooleanOrOperation.java │ │ │ │ │ │ ├── ConcatenationOperation.java │ │ │ │ │ │ ├── DivisionOperation.java │ │ │ │ │ │ ├── ModuloOperation.java │ │ │ │ │ │ ├── MultiplicationOperation.java │ │ │ │ │ │ ├── NegationOperation.java │ │ │ │ │ │ ├── NumberAdditionOperation.java │ │ │ │ │ │ ├── SubtractionOperation.java │ │ │ │ │ │ ├── UnaryOperation.java │ │ │ │ │ │ └── statements │ │ │ │ │ │ │ ├── EqualsStatement.java │ │ │ │ │ │ │ ├── GreaterOrEqualsThanStatement.java │ │ │ │ │ │ │ ├── GreaterThanStatement.java │ │ │ │ │ │ │ ├── LessThanOrEqualsStatement.java │ │ │ │ │ │ │ ├── LessThanStatement.java │ │ │ │ │ │ │ └── NotEqualsStatement.java │ │ │ │ │ │ └── variables │ │ │ │ │ │ ├── BooleanVariable.java │ │ │ │ │ │ ├── NumberVariable.java │ │ │ │ │ │ ├── StringVariable.java │ │ │ │ │ │ ├── Variable.java │ │ │ │ │ │ ├── assign │ │ │ │ │ │ ├── BoolAssignmentNode.java │ │ │ │ │ │ ├── NumAssignmentNode.java │ │ │ │ │ │ ├── StrAssignmentNode.java │ │ │ │ │ │ └── VariableAssignmentNode.java │ │ │ │ │ │ └── reference │ │ │ │ │ │ ├── BoolVariableReferenceNode.java │ │ │ │ │ │ ├── NumVariableReferenceNode.java │ │ │ │ │ │ ├── StrVariableReferenceNode.java │ │ │ │ │ │ └── VariableReferenceNode.java │ │ │ │ │ ├── script │ │ │ │ │ ├── StructureScript.java │ │ │ │ │ ├── TerraImplementationArguments.java │ │ │ │ │ ├── builders │ │ │ │ │ │ ├── BinaryNumberFunctionBuilder.java │ │ │ │ │ │ ├── BiomeFunctionBuilder.java │ │ │ │ │ │ ├── BlockFunctionBuilder.java │ │ │ │ │ │ ├── CheckBlockFunctionBuilder.java │ │ │ │ │ │ ├── EntityFunctionBuilder.java │ │ │ │ │ │ ├── GetMarkFunctionBuilder.java │ │ │ │ │ │ ├── LootFunctionBuilder.java │ │ │ │ │ │ ├── PullFunctionBuilder.java │ │ │ │ │ │ ├── RandomFunctionBuilder.java │ │ │ │ │ │ ├── RecursionsFunctionBuilder.java │ │ │ │ │ │ ├── SetMarkFunctionBuilder.java │ │ │ │ │ │ ├── StateFunctionBuilder.java │ │ │ │ │ │ ├── StructureFunctionBuilder.java │ │ │ │ │ │ ├── UnaryBooleanFunctionBuilder.java │ │ │ │ │ │ ├── UnaryNumberFunctionBuilder.java │ │ │ │ │ │ ├── UnaryStringFunctionBuilder.java │ │ │ │ │ │ └── ZeroArgFunctionBuilder.java │ │ │ │ │ └── functions │ │ │ │ │ │ ├── BiomeFunction.java │ │ │ │ │ │ ├── BlockFunction.java │ │ │ │ │ │ ├── CheckBlockFunction.java │ │ │ │ │ │ ├── EntityFunction.java │ │ │ │ │ │ ├── GetMarkFunction.java │ │ │ │ │ │ ├── LootFunction.java │ │ │ │ │ │ ├── PullFunction.java │ │ │ │ │ │ ├── RandomFunction.java │ │ │ │ │ │ ├── RecursionsFunction.java │ │ │ │ │ │ ├── SetMarkFunction.java │ │ │ │ │ │ ├── StateFunction.java │ │ │ │ │ │ └── StructureFunction.java │ │ │ │ │ └── tokenizer │ │ │ │ │ ├── Char.java │ │ │ │ │ ├── Lookahead.java │ │ │ │ │ ├── Position.java │ │ │ │ │ ├── Token.java │ │ │ │ │ ├── Tokenizer.java │ │ │ │ │ └── exceptions │ │ │ │ │ ├── EOFException.java │ │ │ │ │ ├── FormatException.java │ │ │ │ │ └── TokenizerException.java │ │ │ └── resources │ │ │ │ └── terra.addon.yml │ │ │ └── test │ │ │ ├── java │ │ │ └── structure │ │ │ │ ├── LookaheadTest.java │ │ │ │ └── ParserTest.java │ │ │ └── resources │ │ │ └── test.tesf │ ├── terrascript-function-check-noise-3d │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── addon │ │ │ │ └── terrascript │ │ │ │ └── check │ │ │ │ ├── CheckFunction.java │ │ │ │ ├── CheckFunctionBuilder.java │ │ │ │ └── TerraScriptCheckFunctionAddon.java │ │ │ └── resources │ │ │ └── terra.addon.yml │ └── terrascript-function-sampler │ │ ├── build.gradle.kts │ │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── addons │ │ │ └── terrascript │ │ │ └── sampler │ │ │ ├── ConstantSamplerFunction.java │ │ │ ├── SamplerFunction.java │ │ │ ├── SamplerFunctionBuilder.java │ │ │ └── TerraScriptSamplerFunctionAddon.java │ │ └── resources │ │ └── terra.addon.yml ├── api │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── api │ │ │ ├── Handle.java │ │ │ ├── Platform.java │ │ │ ├── addon │ │ │ ├── BaseAddon.java │ │ │ └── bootstrap │ │ │ │ ├── BootstrapAddonClassLoader.java │ │ │ │ └── BootstrapBaseAddon.java │ │ │ ├── block │ │ │ ├── BlockType.java │ │ │ ├── entity │ │ │ │ ├── BlockEntity.java │ │ │ │ ├── Container.java │ │ │ │ ├── MobSpawner.java │ │ │ │ ├── SerialState.java │ │ │ │ └── Sign.java │ │ │ └── state │ │ │ │ ├── BlockState.java │ │ │ │ └── properties │ │ │ │ ├── Property.java │ │ │ │ ├── base │ │ │ │ ├── BooleanProperty.java │ │ │ │ ├── EnumProperty.java │ │ │ │ └── IntProperty.java │ │ │ │ └── enums │ │ │ │ ├── Axis.java │ │ │ │ ├── Direction.java │ │ │ │ ├── Half.java │ │ │ │ ├── RailShape.java │ │ │ │ ├── RedstoneConnection.java │ │ │ │ └── WallHeight.java │ │ │ ├── command │ │ │ ├── CommandSender.java │ │ │ └── arguments │ │ │ │ └── RegistryArgument.java │ │ │ ├── config │ │ │ ├── AbstractableTemplate.java │ │ │ ├── ConfigFactory.java │ │ │ ├── ConfigPack.java │ │ │ ├── ConfigType.java │ │ │ ├── Loader.java │ │ │ ├── PluginConfig.java │ │ │ └── meta │ │ │ │ └── Meta.java │ │ │ ├── entity │ │ │ ├── Entity.java │ │ │ ├── EntityType.java │ │ │ └── Player.java │ │ │ ├── event │ │ │ ├── EventHandler.java │ │ │ ├── EventManager.java │ │ │ ├── events │ │ │ │ ├── AbstractCancellable.java │ │ │ │ ├── Cancellable.java │ │ │ │ ├── Event.java │ │ │ │ ├── FailThroughEvent.java │ │ │ │ ├── PackEvent.java │ │ │ │ ├── config │ │ │ │ │ ├── ConfigurationDiscoveryEvent.java │ │ │ │ │ ├── ConfigurationLoadEvent.java │ │ │ │ │ ├── pack │ │ │ │ │ │ ├── ConfigPackLoadEvent.java │ │ │ │ │ │ ├── ConfigPackPostLoadEvent.java │ │ │ │ │ │ └── ConfigPackPreLoadEvent.java │ │ │ │ │ └── type │ │ │ │ │ │ ├── ConfigTypeLoadEvent.java │ │ │ │ │ │ ├── ConfigTypePostLoadEvent.java │ │ │ │ │ │ └── ConfigTypePreLoadEvent.java │ │ │ │ ├── platform │ │ │ │ │ ├── CommandRegistrationEvent.java │ │ │ │ │ └── PlatformInitializationEvent.java │ │ │ │ └── world │ │ │ │ │ └── generation │ │ │ │ │ ├── EntitySpawnEvent.java │ │ │ │ │ └── LootPopulateEvent.java │ │ │ └── functional │ │ │ │ ├── EventContext.java │ │ │ │ └── FunctionalEventHandler.java │ │ │ ├── handle │ │ │ ├── ItemHandle.java │ │ │ └── WorldHandle.java │ │ │ ├── inject │ │ │ ├── Injector.java │ │ │ ├── annotations │ │ │ │ └── Inject.java │ │ │ ├── exception │ │ │ │ └── InjectionException.java │ │ │ └── impl │ │ │ │ └── InjectorImpl.java │ │ │ ├── inventory │ │ │ ├── BlockInventoryHolder.java │ │ │ ├── Inventory.java │ │ │ ├── InventoryHolder.java │ │ │ ├── Item.java │ │ │ ├── ItemStack.java │ │ │ └── item │ │ │ │ ├── Damageable.java │ │ │ │ ├── Enchantment.java │ │ │ │ └── ItemMeta.java │ │ │ ├── noise │ │ │ ├── DerivativeNoiseSampler.java │ │ │ └── NoiseSampler.java │ │ │ ├── profiler │ │ │ ├── Profiler.java │ │ │ └── Timings.java │ │ │ ├── properties │ │ │ ├── Context.java │ │ │ ├── Properties.java │ │ │ ├── PropertyHolder.java │ │ │ ├── PropertyKey.java │ │ │ └── annotations │ │ │ │ └── Linked.java │ │ │ ├── registry │ │ │ ├── CheckedRegistry.java │ │ │ ├── OpenRegistry.java │ │ │ ├── Registry.java │ │ │ ├── exception │ │ │ │ ├── DuplicateEntryException.java │ │ │ │ └── NoSuchEntryException.java │ │ │ ├── key │ │ │ │ ├── Keyed.java │ │ │ │ ├── Namespaced.java │ │ │ │ ├── RegistryKey.java │ │ │ │ └── StringIdentifiable.java │ │ │ └── meta │ │ │ │ ├── CheckedRegistryHolder.java │ │ │ │ ├── RegistryHolder.java │ │ │ │ └── RegistryProvider.java │ │ │ ├── structure │ │ │ ├── LootTable.java │ │ │ ├── Structure.java │ │ │ ├── StructureSpawn.java │ │ │ ├── configured │ │ │ │ └── ConfiguredStructure.java │ │ │ └── feature │ │ │ │ ├── BinaryColumn.java │ │ │ │ ├── Distributor.java │ │ │ │ ├── Feature.java │ │ │ │ └── Locator.java │ │ │ ├── tectonic │ │ │ ├── ConfigLoadingDelegate.java │ │ │ ├── LoaderRegistrar.java │ │ │ └── ShortcutLoader.java │ │ │ ├── transform │ │ │ ├── Transform.java │ │ │ ├── Transformer.java │ │ │ ├── Validator.java │ │ │ └── exception │ │ │ │ ├── AttemptsFailedException.java │ │ │ │ └── TransformException.java │ │ │ ├── util │ │ │ ├── Column.java │ │ │ ├── ConstantRange.java │ │ │ ├── GeometryUtil.java │ │ │ ├── MathUtil.java │ │ │ ├── PopulationUtil.java │ │ │ ├── Range.java │ │ │ ├── Rotation.java │ │ │ ├── RotationUtil.java │ │ │ ├── StringUtil.java │ │ │ ├── cache │ │ │ │ ├── CacheUtils.java │ │ │ │ ├── DoubleSeededVector2Key.java │ │ │ │ ├── DoubleSeededVector3Key.java │ │ │ │ ├── SeededVector2Key.java │ │ │ │ └── SeededVector3Key.java │ │ │ ├── collection │ │ │ │ ├── MaterialSet.java │ │ │ │ └── ProbabilityCollection.java │ │ │ ├── function │ │ │ │ ├── IntIntObjConsumer.java │ │ │ │ ├── IntObjConsumer.java │ │ │ │ └── IntToBooleanFunction.java │ │ │ ├── generic │ │ │ │ ├── Construct.java │ │ │ │ ├── Lazy.java │ │ │ │ ├── either │ │ │ │ │ └── Either.java │ │ │ │ └── pair │ │ │ │ │ └── Pair.java │ │ │ ├── mutable │ │ │ │ ├── MutableBoolean.java │ │ │ │ ├── MutableDouble.java │ │ │ │ ├── MutableInteger.java │ │ │ │ ├── MutableNumber.java │ │ │ │ ├── MutablePrimitive.java │ │ │ │ └── package-info.java │ │ │ ├── reflection │ │ │ │ ├── ReflectionUtil.java │ │ │ │ └── TypeKey.java │ │ │ └── vector │ │ │ │ ├── Vector2.java │ │ │ │ ├── Vector2Int.java │ │ │ │ ├── Vector3.java │ │ │ │ └── Vector3Int.java │ │ │ └── world │ │ │ ├── BufferedWorld.java │ │ │ ├── ReadableWorld.java │ │ │ ├── ServerWorld.java │ │ │ ├── World.java │ │ │ ├── WritableWorld.java │ │ │ ├── biome │ │ │ ├── Biome.java │ │ │ ├── PaletteSettings.java │ │ │ ├── PlatformBiome.java │ │ │ └── generation │ │ │ │ ├── BiomeColumn.java │ │ │ │ ├── BiomeProvider.java │ │ │ │ └── CachingBiomeProvider.java │ │ │ ├── chunk │ │ │ ├── Chunk.java │ │ │ ├── ChunkAccess.java │ │ │ └── generation │ │ │ │ ├── ChunkGenerator.java │ │ │ │ ├── ProtoChunk.java │ │ │ │ ├── ProtoWorld.java │ │ │ │ ├── stage │ │ │ │ ├── Chunkified.java │ │ │ │ └── GenerationStage.java │ │ │ │ └── util │ │ │ │ ├── Column.java │ │ │ │ ├── GeneratorWrapper.java │ │ │ │ ├── Palette.java │ │ │ │ └── provider │ │ │ │ ├── ChunkGeneratorProvider.java │ │ │ │ └── GenerationStageProvider.java │ │ │ ├── info │ │ │ └── WorldProperties.java │ │ │ └── util │ │ │ ├── Interceptors.java │ │ │ ├── ReadInterceptor.java │ │ │ └── WriteInterceptor.java │ │ └── test │ │ └── java │ │ └── util │ │ └── ColumnTest.java └── implementation │ ├── LICENSE │ ├── base │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ ├── AbstractPlatform.java │ │ │ │ ├── addon │ │ │ │ ├── DependencySorter.java │ │ │ │ ├── EphemeralAddon.java │ │ │ │ ├── InternalAddon.java │ │ │ │ └── dependency │ │ │ │ │ ├── CircularDependencyException.java │ │ │ │ │ ├── DependencyException.java │ │ │ │ │ └── DependencyVersionException.java │ │ │ │ ├── config │ │ │ │ ├── GenericLoaders.java │ │ │ │ ├── PluginConfigImpl.java │ │ │ │ ├── fileloaders │ │ │ │ │ ├── FolderLoader.java │ │ │ │ │ ├── LoaderImpl.java │ │ │ │ │ └── ZIPLoader.java │ │ │ │ ├── loaders │ │ │ │ │ ├── ExpressionParserOptionsTemplate.java │ │ │ │ │ ├── GenericTemplateSupplierLoader.java │ │ │ │ │ ├── LinkedHashMapLoader.java │ │ │ │ │ ├── MaterialSetLoader.java │ │ │ │ │ ├── ProbabilityCollectionLoader.java │ │ │ │ │ ├── RangeLoader.java │ │ │ │ │ ├── VersionLoader.java │ │ │ │ │ ├── VersionRangeLoader.java │ │ │ │ │ └── config │ │ │ │ │ │ └── BufferedImageLoader.java │ │ │ │ ├── pack │ │ │ │ │ ├── ConfigPackAddonsTemplate.java │ │ │ │ │ ├── ConfigPackExpressionOptionsTemplate.java │ │ │ │ │ ├── ConfigPackImpl.java │ │ │ │ │ ├── ConfigPackPostTemplate.java │ │ │ │ │ └── ConfigPackTemplate.java │ │ │ │ ├── preprocessor │ │ │ │ │ ├── MetaListLikePreprocessor.java │ │ │ │ │ ├── MetaMapPreprocessor.java │ │ │ │ │ ├── MetaNumberPreprocessor.java │ │ │ │ │ ├── MetaPreprocessor.java │ │ │ │ │ ├── MetaStringPreprocessor.java │ │ │ │ │ └── MetaValuePreprocessor.java │ │ │ │ └── prototype │ │ │ │ │ └── ProtoConfig.java │ │ │ │ ├── event │ │ │ │ ├── EventContextImpl.java │ │ │ │ ├── EventManagerImpl.java │ │ │ │ └── FunctionalEventHandlerImpl.java │ │ │ │ ├── profiler │ │ │ │ ├── Frame.java │ │ │ │ ├── ProfilerImpl.java │ │ │ │ └── exception │ │ │ │ │ ├── MalformedStackException.java │ │ │ │ │ └── ProfilerException.java │ │ │ │ ├── registry │ │ │ │ ├── CheckedRegistryImpl.java │ │ │ │ ├── LockedRegistryImpl.java │ │ │ │ ├── OpenRegistryImpl.java │ │ │ │ ├── ShortcutHolder.java │ │ │ │ └── master │ │ │ │ │ └── ConfigRegistry.java │ │ │ │ └── transform │ │ │ │ ├── MapTransform.java │ │ │ │ └── TransformerImpl.java │ │ └── resources │ │ │ └── config.yml │ │ └── test │ │ ├── java │ │ ├── MetaTest.java │ │ ├── profiler │ │ │ └── ProfilerTest.java │ │ └── registry │ │ │ └── RegistryTest.java │ │ └── resources │ │ ├── config.yml │ │ ├── map.jpg │ │ ├── meta.yml │ │ └── metaTarget.yml │ └── bootstrap-addon-loader │ ├── build.gradle.kts │ └── src │ └── main │ └── java │ └── com │ └── dfsek │ └── terra │ └── addon │ ├── BootstrapAddonLoader.java │ └── exception │ └── AddonLoadException.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── platforms ├── LICENSE ├── allay │ ├── README.md │ ├── build.gradle.kts │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── allay │ │ │ ├── AllayPlatform.java │ │ │ ├── JeBlockState.java │ │ │ ├── Mapping.java │ │ │ ├── TerraAllayPlugin.java │ │ │ ├── delegate │ │ │ ├── AllayBiome.java │ │ │ ├── AllayBlockState.java │ │ │ ├── AllayBlockType.java │ │ │ ├── AllayChunk.java │ │ │ ├── AllayEnchantment.java │ │ │ ├── AllayFakeEntity.java │ │ │ ├── AllayItemMeta.java │ │ │ ├── AllayItemStack.java │ │ │ ├── AllayItemType.java │ │ │ ├── AllayProtoChunk.java │ │ │ ├── AllayProtoWorld.java │ │ │ └── AllayServerWorld.java │ │ │ ├── generator │ │ │ └── AllayGeneratorWrapper.java │ │ │ └── handle │ │ │ ├── AllayItemHandle.java │ │ │ └── AllayWorldHandle.java │ │ └── resources │ │ ├── je_block_default_states.json │ │ └── plugin.json ├── bukkit │ ├── build.gradle.kts │ ├── common │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── dfsek │ │ │ │ └── terra │ │ │ │ └── bukkit │ │ │ │ ├── BukkitAddon.java │ │ │ │ ├── BukkitCommandSender.java │ │ │ │ ├── BukkitEntity.java │ │ │ │ ├── BukkitPlayer.java │ │ │ │ ├── PlatformImpl.java │ │ │ │ ├── TerraBukkitPlugin.java │ │ │ │ ├── config │ │ │ │ └── PreLoadCompatibilityOptions.java │ │ │ │ ├── generator │ │ │ │ ├── BukkitBiomeProvider.java │ │ │ │ ├── BukkitBlockPopulator.java │ │ │ │ ├── BukkitChunkGeneratorWrapper.java │ │ │ │ └── BukkitProtoChunk.java │ │ │ │ ├── handles │ │ │ │ ├── BukkitItemHandle.java │ │ │ │ └── BukkitWorldHandle.java │ │ │ │ ├── listeners │ │ │ │ ├── CommonListener.java │ │ │ │ └── SpigotListener.java │ │ │ │ ├── nms │ │ │ │ └── Initializer.java │ │ │ │ ├── util │ │ │ │ ├── BukkitUtils.java │ │ │ │ ├── MinecraftUtils.java │ │ │ │ ├── PaperUtil.java │ │ │ │ └── VersionUtil.java │ │ │ │ └── world │ │ │ │ ├── BukkitAdapter.java │ │ │ │ ├── BukkitChunk.java │ │ │ │ ├── BukkitPlatformBiome.java │ │ │ │ ├── BukkitProtoWorld.java │ │ │ │ ├── BukkitServerWorld.java │ │ │ │ ├── BukkitWorldProperties.java │ │ │ │ ├── block │ │ │ │ ├── BukkitBlockTypeAndItem.java │ │ │ │ ├── data │ │ │ │ │ └── BukkitBlockState.java │ │ │ │ └── state │ │ │ │ │ ├── BukkitBlockEntity.java │ │ │ │ │ ├── BukkitContainer.java │ │ │ │ │ ├── BukkitMobSpawner.java │ │ │ │ │ └── BukkitSign.java │ │ │ │ ├── entity │ │ │ │ └── BukkitEntityType.java │ │ │ │ └── inventory │ │ │ │ ├── BukkitInventory.java │ │ │ │ ├── BukkitItemMeta.java │ │ │ │ ├── BukkitItemStack.java │ │ │ │ └── meta │ │ │ │ ├── BukkitDamageable.java │ │ │ │ └── BukkitEnchantment.java │ │ │ └── resources │ │ │ └── plugin.yml │ └── nms │ │ └── v1_21_5 │ │ ├── build.gradle.kts │ │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── dfsek │ │ └── terra │ │ └── bukkit │ │ └── nms │ │ └── v1_21_5 │ │ ├── AwfulBukkitHacks.java │ │ ├── NMSAddon.java │ │ ├── NMSBiomeInfo.java │ │ ├── NMSBiomeInjector.java │ │ ├── NMSBiomeProvider.java │ │ ├── NMSChunkGeneratorDelegate.java │ │ ├── NMSInitializer.java │ │ ├── NMSInjectListener.java │ │ ├── NMSWorldProperties.java │ │ ├── Reflection.java │ │ ├── RegistryFetcher.java │ │ └── config │ │ ├── BiomeAdditionsSoundTemplate.java │ │ ├── BiomeMoodSoundTemplate.java │ │ ├── BiomeParticleConfigTemplate.java │ │ ├── EntityTypeTemplate.java │ │ ├── MusicSoundTemplate.java │ │ ├── SoundEventTemplate.java │ │ ├── SpawnCostConfig.java │ │ ├── SpawnEntryConfig.java │ │ ├── SpawnSettingsTemplate.java │ │ ├── SpawnTypeConfig.java │ │ ├── VanillaBiomeProperties.java │ │ └── VillagerTypeTemplate.java ├── cli │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── dfsek │ │ └── terra │ │ └── cli │ │ ├── CLIPlatform.java │ │ ├── NBTSerializable.java │ │ ├── TerraCLI.java │ │ ├── block │ │ ├── CLIBlockState.java │ │ └── CLIBlockType.java │ │ ├── handle │ │ ├── CLIItemHandle.java │ │ └── CLIWorldHandle.java │ │ └── world │ │ ├── CLIWorld.java │ │ ├── Region.java │ │ └── chunk │ │ └── CLIChunk.java ├── fabric │ ├── build.gradle.kts │ ├── gradle.properties │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── fabric │ │ │ ├── FabricAddon.java │ │ │ ├── FabricEntryPoint.java │ │ │ └── FabricPlatform.java │ │ └── resources │ │ ├── assets │ │ └── terra │ │ │ ├── icon.png │ │ │ └── lang │ │ │ └── en_us.json │ │ ├── fabric.mod.json │ │ └── terra.fabric.mixins.json ├── forge │ ├── build.gradle.kts.disabled │ ├── gradle.properties │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── forge │ │ │ ├── AwfulForgeHacks.java │ │ │ ├── ForgeAddon.java │ │ │ ├── ForgeEntryPoint.java │ │ │ ├── ForgePlatform.java │ │ │ ├── mixin │ │ │ └── lifecycle │ │ │ │ ├── NoiseConfigMixin.java │ │ │ │ └── package-info.java │ │ │ └── util │ │ │ └── BiomeUtil.java │ │ └── resources │ │ ├── META-INF │ │ └── mods.toml │ │ ├── pack.mcmeta │ │ └── terra.forge.mixins.json ├── merged │ └── build.gradle.kts ├── minestom │ ├── build.gradle.kts │ ├── example │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── minestom │ │ │ └── TerraMinestomExample.java │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── dfsek │ │ └── terra │ │ └── minestom │ │ ├── MinestomAdapter.java │ │ ├── MinestomPlatform.java │ │ ├── api │ │ ├── BlockEntityFactory.java │ │ └── EntityFactory.java │ │ ├── biome │ │ ├── MinestomBiome.java │ │ └── MinestomBiomeLoader.java │ │ ├── block │ │ ├── DefaultBlockEntityFactory.java │ │ ├── MinestomBlockState.java │ │ └── MinestomBlockType.java │ │ ├── chunk │ │ ├── CachedChunk.java │ │ ├── GeneratedChunkCache.java │ │ └── TerraMinestomChunk.java │ │ ├── entity │ │ ├── DefaultEntityFactory.java │ │ ├── DeferredMinestomEntity.java │ │ ├── MinestomEntity.java │ │ └── MinestomEntityType.java │ │ ├── item │ │ ├── MinestomEnchantment.java │ │ ├── MinestomItemHandle.java │ │ ├── MinestomItemMeta.java │ │ ├── MinestomItemStack.java │ │ └── MinestomMaterial.java │ │ └── world │ │ ├── MinestomChunkGeneratorWrapper.java │ │ ├── MinestomProtoWorld.java │ │ ├── MinestomWorldHandle.java │ │ ├── TerraMinestomWorld.java │ │ └── TerraMinestomWorldBuilder.java ├── mixin-common │ ├── README.md │ ├── build.gradle.kts │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── mod │ │ │ ├── CommonPlatform.java │ │ │ ├── MinecraftAddon.java │ │ │ ├── ModPlatform.java │ │ │ ├── config │ │ │ ├── BiomeAdditionsSoundTemplate.java │ │ │ ├── BiomeMoodSoundTemplate.java │ │ │ ├── BiomeParticleConfigTemplate.java │ │ │ ├── EntityTypeTemplate.java │ │ │ ├── MusicSoundTemplate.java │ │ │ ├── PostLoadCompatibilityOptions.java │ │ │ ├── PreLoadCompatibilityOptions.java │ │ │ ├── ProtoPlatformBiome.java │ │ │ ├── SoundEventTemplate.java │ │ │ ├── SpawnCostConfig.java │ │ │ ├── SpawnEntryConfig.java │ │ │ ├── SpawnSettingsTemplate.java │ │ │ ├── SpawnTypeConfig.java │ │ │ ├── VanillaBiomeProperties.java │ │ │ └── VillagerTypeTemplate.java │ │ │ ├── data │ │ │ └── Codecs.java │ │ │ ├── generation │ │ │ ├── MinecraftChunkGeneratorWrapper.java │ │ │ └── TerraBiomeSource.java │ │ │ ├── handle │ │ │ ├── MinecraftItemHandle.java │ │ │ └── MinecraftWorldHandle.java │ │ │ ├── mixin │ │ │ ├── access │ │ │ │ ├── BiomeAccessor.java │ │ │ │ ├── MobSpawnerLogicAccessor.java │ │ │ │ ├── StateAccessor.java │ │ │ │ ├── StructureAccessorAccessor.java │ │ │ │ └── VillagerTypeAccessor.java │ │ │ ├── fix │ │ │ │ ├── BeeMoveGoalsUnsynchronizedRandomAccessFix.java │ │ │ │ └── NetherFossilOptimization.java │ │ │ ├── implementations │ │ │ │ ├── compat │ │ │ │ │ └── GenerationSettingsFloraFeaturesMixin.java │ │ │ │ └── terra │ │ │ │ │ ├── BiomeMixin.java │ │ │ │ │ ├── HandleImplementationMixin.java │ │ │ │ │ ├── block │ │ │ │ │ ├── BlockMixin.java │ │ │ │ │ ├── entity │ │ │ │ │ │ ├── BlockEntityMixin.java │ │ │ │ │ │ ├── LootableContainerBlockEntityMixin.java │ │ │ │ │ │ ├── MobSpawnerBlockEntityMixin.java │ │ │ │ │ │ └── SignBlockEntityMixin.java │ │ │ │ │ └── state │ │ │ │ │ │ ├── BlockStateMixin.java │ │ │ │ │ │ └── PropertyMixin.java │ │ │ │ │ ├── chunk │ │ │ │ │ ├── ChunkRegionMixin.java │ │ │ │ │ ├── WorldChunkMixin.java │ │ │ │ │ └── data │ │ │ │ │ │ └── ProtoChunkMixin.java │ │ │ │ │ ├── entity │ │ │ │ │ ├── EntityMixin.java │ │ │ │ │ ├── EntityTypeMixin.java │ │ │ │ │ ├── PlayerEntityMixin.java │ │ │ │ │ └── ServerCommandSourceMixin.java │ │ │ │ │ ├── inventory │ │ │ │ │ ├── LockableContainerBlockEntityMixin.java │ │ │ │ │ ├── item │ │ │ │ │ │ ├── ItemMixin.java │ │ │ │ │ │ └── ItemStackMixin.java │ │ │ │ │ └── meta │ │ │ │ │ │ ├── EnchantmentMixin.java │ │ │ │ │ │ ├── ItemStackDamageableMixin.java │ │ │ │ │ │ └── ItemStackMetaMixin.java │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── world │ │ │ │ │ ├── ChunkRegionMixin.java │ │ │ │ │ └── ServerWorldMixin.java │ │ │ ├── invoke │ │ │ │ ├── BiomeInvoker.java │ │ │ │ └── FluidBlockInvoker.java │ │ │ └── lifecycle │ │ │ │ └── DataPackContentsMixin.java │ │ │ ├── mixin_ifaces │ │ │ └── FloraFeatureHolder.java │ │ │ └── util │ │ │ ├── BiomeUtil.java │ │ │ ├── MinecraftAdapter.java │ │ │ ├── MinecraftUtil.java │ │ │ ├── PresetUtil.java │ │ │ ├── SeedHack.java │ │ │ └── TagUtil.java │ │ └── resources │ │ ├── terra.accesswidener │ │ └── terra.common.mixins.json ├── mixin-lifecycle │ ├── README.md │ ├── build.gradle.kts │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── lifecycle │ │ │ ├── LifecycleEntryPoint.java │ │ │ ├── LifecyclePlatform.java │ │ │ ├── mixin │ │ │ ├── NoiseConfigMixin.java │ │ │ ├── RegistryEntryReferenceInvoker.java │ │ │ ├── RegistryMixin.java │ │ │ ├── SimpleRegistryMixin.java │ │ │ └── lifecycle │ │ │ │ ├── CreateWorldScreenMixin.java │ │ │ │ ├── MinecraftServerMixin.java │ │ │ │ ├── RegistryLoaderMixin.java │ │ │ │ └── SaveLoadingMixin.java │ │ │ └── util │ │ │ ├── LifecycleBiomeUtil.java │ │ │ ├── LifecycleUtil.java │ │ │ ├── RegistryHack.java │ │ │ └── RegistryUtil.java │ │ └── resources │ │ └── terra.lifecycle.mixins.json ├── quilt │ ├── build.gradle.kts.disabled │ ├── gradle.properties │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dfsek │ │ │ └── terra │ │ │ └── quilt │ │ │ ├── AwfulQuiltHacks.java │ │ │ ├── QuiltAddon.java │ │ │ ├── QuiltEntryPoint.java │ │ │ ├── QuiltPlatform.java │ │ │ └── QuiltPreLaunchEntryPoint.java │ │ └── resources │ │ ├── assets │ │ └── terra │ │ │ ├── icon.png │ │ │ └── lang │ │ │ └── en_us.json │ │ ├── quilt.mod.json │ │ └── terra.quilt.mixins.json └── sponge │ ├── build.gradle.kts.disabled │ └── src │ └── main │ ├── java │ └── com │ │ └── dfsek │ │ └── terra │ │ └── sponge │ │ ├── PlatformImpl.java │ │ ├── SpongeListener.java │ │ ├── TerraSpongePlugin.java │ │ ├── block │ │ ├── SpongeBlockState.java │ │ └── SpongeBlockType.java │ │ └── handle │ │ └── SpongeWorldHandle.java │ └── resources │ └── META-INF │ └── plugins.json └── settings.gradle.kts /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # These are explicitly windows files and should use crlf 5 | *.bat text eol=crlf 6 | 7 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Global owners, automatically request review when pull request is submitted 2 | * @dfsek @solonovamax @duplexsystem @astrsh @justaureus 3 | 4 | # Platforms 5 | /platforms/ @dfsek @solonovamax @duplexsystem @justaureus 6 | /platforms/bukkit @dfsek @solonovamax @duplexsystem @justaureus @OakLoaf 7 | 8 | # Common 9 | /common/ @dfsek @solonovamax @duplexsystem @astrsh 10 | 11 | # Gradle Stuff 12 | /buildSrc/ @dfsek @solonovamax @duplexsystem 13 | *.gradle.kts @dfsek @solonovamax @duplexsystem 14 | /gradle/ @dfsek @solonovamax @duplexsystem 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/OTHER_ISSUES.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Other Issue" 3 | about: "Use this template if your issue doesn't accurately fit into any of the 4 | other categories." 5 | title: "" 6 | labels: "Type: Question, Status: Pending" 7 | assignees: "" 8 | 9 | --- 10 | 11 | ## Describe the issue 12 | 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Which Issue Template do I Choose? 4 | url: https://github.com/PolyhedralDev/Terra/wiki/How-To-Choose-An-Issue-Template 5 | about: Click this if you don't know which issue template to select. This will help you make sure you choose the right one and provide enough information for us to help you. 6 | - name: Terra Wiki 7 | url: https://github.com/PolyhedralDev/Terra/wiki 8 | about: Documentation for all things Terra. 9 | - name: Join the Support Discord 10 | url: https://discord.dfsek.com 11 | about: If you have a basic support question, join the Discord instead. -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | kotlin("jvm") version embeddedKotlinVersion 4 | } 5 | 6 | repositories { 7 | mavenCentral() 8 | gradlePluginPortal() 9 | maven("https://repo.codemc.org/repository/maven-public") { 10 | name = "CodeMC" 11 | } 12 | maven("https://repo.papermc.io/repository/maven-public/") { 13 | name = "PaperMC" 14 | } 15 | } 16 | 17 | dependencies { 18 | //TODO Allow pulling from Versions.kt 19 | implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.6") 20 | 21 | implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "2.0.0-beta.17") 22 | implementation("org.ow2.asm", "asm", "9.8") 23 | implementation("org.ow2.asm", "asm-tree", "9.8") 24 | implementation("com.dfsek.tectonic", "common", "4.2.1") 25 | implementation("org.yaml", "snakeyaml", "2.4") 26 | } -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/com/dfsek/terra/tectonicdoc/DocumentedTemplate.kt: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.tectonicdoc 2 | 3 | class DocumentedTemplate(private val name: String) { 4 | private val template = HashMap() 5 | 6 | fun add(name: String, content: String) { 7 | template[name] = content 8 | } 9 | 10 | fun format(): String { 11 | val builder = StringBuilder("# ").append(name).append("\n\n") 12 | template.forEach { name, content -> 13 | builder 14 | .append("### $name\n\n") 15 | .append(content) 16 | .append("\n\n") 17 | } 18 | return builder.toString() 19 | } 20 | } -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/com/dfsek/terra/tectonicdoc/TectonicDocPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.tectonicdoc 2 | 3 | import org.gradle.api.Plugin 4 | import org.gradle.api.Project 5 | 6 | class TectonicDocPlugin : Plugin { 7 | override fun apply(project: Project) { 8 | project.tasks.create("generateDocs", GenerateDocsTask::class.java) 9 | } 10 | } -------------------------------------------------------------------------------- /common/addons/README.md: -------------------------------------------------------------------------------- 1 | # Core Addons 2 | 3 | This directory contains the modularized "core addons" that implement Terra's 4 | default behavior. -------------------------------------------------------------------------------- /common/addons/api-addon-loader/README.md: -------------------------------------------------------------------------------- 1 | # api addon loader 2 | 3 | Loads dependencies as addons -------------------------------------------------------------------------------- /common/addons/api-addon-loader/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("0.1.0") 2 | 3 | dependencies { 4 | } 5 | 6 | tasks.withType { 7 | manifest { 8 | attributes("Terra-Bootstrap-Addon-Entry-Point" to "com.dfsek.terra.addon.loader.ApiAddonLoader") 9 | } 10 | } 11 | 12 | project.extra.set("bootstrap", true) -------------------------------------------------------------------------------- /common/addons/api-addon-loader/src/main/java/com/dfsek/terra/addon/loader/ApiAddon.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addon.loader; 2 | 3 | import ca.solostudios.strata.version.Version; 4 | 5 | import com.dfsek.terra.api.addon.BaseAddon; 6 | 7 | 8 | public class ApiAddon implements BaseAddon { 9 | private final Version version; 10 | private final String id; 11 | 12 | public ApiAddon(Version version, String id) { 13 | this.version = version; 14 | this.id = id; 15 | } 16 | 17 | @Override 18 | public Version getVersion() { 19 | return version; 20 | } 21 | 22 | @Override 23 | public String getID() { 24 | return id; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /common/addons/api-addon-loader/src/main/java/com/dfsek/terra/addon/loader/ApiAddonClassLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addon.loader; 9 | 10 | import java.net.URL; 11 | import java.net.URLClassLoader; 12 | 13 | 14 | public class ApiAddonClassLoader extends URLClassLoader { 15 | static { 16 | ClassLoader.registerAsParallelCapable(); 17 | } 18 | 19 | public ApiAddonClassLoader(URL[] urls, ClassLoader parent) { 20 | super(urls, parent); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/addons/biome-provider-extrusion/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | compileOnlyApi(project(":common:addons:biome-query-api")) 6 | } 7 | -------------------------------------------------------------------------------- /common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/api/Extrusion.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.extrusion.api; 2 | 3 | import com.dfsek.terra.api.world.biome.Biome; 4 | 5 | import java.util.Collection; 6 | 7 | 8 | public interface Extrusion { 9 | Biome extrude(Biome original, int x, int y, int z, long seed); 10 | 11 | Collection getBiomes(); 12 | } 13 | -------------------------------------------------------------------------------- /common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/api/PresentBiome.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.extrusion.api; 2 | 3 | 4 | import com.dfsek.terra.api.world.biome.Biome; 5 | 6 | 7 | final class PresentBiome implements ReplaceableBiome { 8 | private final Biome biome; 9 | 10 | PresentBiome(Biome biome) { 11 | this.biome = biome; 12 | } 13 | 14 | @Override 15 | public Biome get(Biome existing) { 16 | return biome; 17 | } 18 | 19 | @Override 20 | public boolean isSelf() { 21 | return false; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/api/SelfBiome.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.extrusion.api; 2 | 3 | 4 | import java.util.Objects; 5 | 6 | import com.dfsek.terra.api.world.biome.Biome; 7 | 8 | 9 | final class SelfBiome implements ReplaceableBiome { 10 | public static final SelfBiome INSTANCE = new SelfBiome(); 11 | 12 | @Override 13 | public Biome get(Biome existing) { 14 | return Objects.requireNonNull(existing); 15 | } 16 | 17 | @Override 18 | public boolean isSelf() { 19 | return true; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/config/extrusions/SamplerExtrusionTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.extrusion.config.extrusions; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 5 | 6 | import com.dfsek.terra.addons.biome.extrusion.api.Extrusion; 7 | import com.dfsek.terra.api.config.meta.Meta; 8 | import com.dfsek.terra.api.noise.NoiseSampler; 9 | import com.dfsek.terra.api.util.Range; 10 | 11 | 12 | public abstract class SamplerExtrusionTemplate implements ObjectTemplate { 13 | @Value("sampler") 14 | protected @Meta NoiseSampler sampler; 15 | 16 | @Value("range") 17 | protected @Meta Range range; 18 | } 19 | -------------------------------------------------------------------------------- /common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/config/extrusions/SetExtrusionTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.extrusion.config.extrusions; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | 5 | import com.dfsek.terra.addons.biome.extrusion.api.Extrusion; 6 | import com.dfsek.terra.addons.biome.extrusion.api.ReplaceableBiome; 7 | import com.dfsek.terra.addons.biome.extrusion.extrusions.SetExtrusion; 8 | import com.dfsek.terra.api.config.meta.Meta; 9 | import com.dfsek.terra.api.util.collection.ProbabilityCollection; 10 | 11 | 12 | public class SetExtrusionTemplate extends SamplerExtrusionTemplate { 13 | @Value("to") 14 | private @Meta ProbabilityCollection<@Meta ReplaceableBiome> biomes; 15 | 16 | @Override 17 | public Extrusion get() { 18 | return new SetExtrusion(sampler, range, biomes); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/biome-provider-extrusion/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: biome-provider-extrusion 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.biome.extrusion.BiomeExtrusionAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | depends: 14 | biome-query-api: "1.+" -------------------------------------------------------------------------------- /common/addons/biome-provider-image-v2/README.md: -------------------------------------------------------------------------------- 1 | # biome-provider-image-v2 2 | 3 | Implements and registers the `IMAGE` biome provider, which 4 | utilizes various config types provided by the `library-image` addon to 5 | distribute biomes based on images. 6 | -------------------------------------------------------------------------------- /common/addons/biome-provider-image-v2/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.1") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | compileOnlyApi(project(":common:addons:library-image")) 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/addons/biome-provider-image-v2/src/main/java/com/dfsek/terra/addons/biome/image/v2/config/converter/ClosestBiomeColorConverterTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.image.v2.config.converter; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | 5 | import com.dfsek.terra.addons.image.config.converter.ClosestColorConverterTemplate; 6 | import com.dfsek.terra.addons.image.converter.mapping.ColorMapping; 7 | import com.dfsek.terra.api.world.biome.Biome; 8 | 9 | 10 | public class ClosestBiomeColorConverterTemplate extends ClosestColorConverterTemplate { 11 | 12 | @Value("match") 13 | private ColorMapping match; 14 | 15 | @Override 16 | protected ColorMapping getMapping() { 17 | return match; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/addons/biome-provider-image-v2/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: biome-provider-image-v2 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.biome.image.v2.ImageBiomeProviderAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | depends: 14 | library-image: "1.+" 15 | -------------------------------------------------------------------------------- /common/addons/biome-provider-image/README.md: -------------------------------------------------------------------------------- 1 | # biome-provider-image 2 | 3 | Implements and registers the `IMAGE` biome provider, a biome provider which 4 | generates biomes from an image, using the `color` attribute of biomes. 5 | 6 | This addon registers the provider type, and all associated config options. -------------------------------------------------------------------------------- /common/addons/biome-provider-image/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.1") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /common/addons/biome-provider-image/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: biome-provider-image 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.biome.image.ImageBiomeProviderAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/README.md: -------------------------------------------------------------------------------- 1 | # biome-provider-pipeline-2 2 | 3 | The second version of the Biome Pipeline, a procedural biome provider that uses a series 4 | of "stages" to apply "mutations" to a 2D grid of biomes. 5 | 6 | Version 2 is a re-implementation of the original addon with the primary goal of providing 7 | consistent scaling for noise relative to the world 8 | (See https://github.com/PolyhedralDev/Terra/issues/264 for more details), and has been 9 | included as a separate addon to maintain parity with packs utilizing the first version. 10 | 11 | This addon registers the `PIPELINE` biome provider type, and all associated 12 | configurations. -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.1") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/api/BiomeChunk.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.pipeline.v2.api; 2 | 3 | 4 | import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome; 5 | 6 | 7 | public interface BiomeChunk { 8 | 9 | PipelineBiome get(int xInChunk, int zInChunk); 10 | } 11 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/api/Pipeline.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.pipeline.v2.api; 2 | 3 | import com.dfsek.terra.api.util.cache.SeededVector2Key; 4 | 5 | import java.util.List; 6 | 7 | 8 | public interface Pipeline { 9 | BiomeChunk generateChunk(SeededVector2Key worldCoordinates); 10 | 11 | int getChunkSize(); 12 | 13 | Source getSource(); 14 | 15 | List getStages(); 16 | } 17 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/api/Source.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.pipeline.v2.api; 2 | 3 | 4 | import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome; 5 | 6 | 7 | public interface Source { 8 | PipelineBiome get(long seed, int x, int z); 9 | 10 | Iterable getBiomes(); 11 | } -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/api/Stage.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.pipeline.v2.api; 2 | 3 | import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome; 4 | import com.dfsek.terra.addons.biome.pipeline.v2.pipeline.BiomeChunkImpl.ViewPoint; 5 | 6 | 7 | public interface Stage { 8 | PipelineBiome apply(ViewPoint viewPoint); 9 | 10 | int maxRelativeReadDistance(); 11 | 12 | default Iterable getBiomes(Iterable biomes) { 13 | return biomes; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/config/source/SourceTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome.pipeline.v2.config.source; 9 | 10 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 11 | 12 | import com.dfsek.terra.addons.biome.pipeline.v2.api.Source; 13 | 14 | 15 | public abstract class SourceTemplate implements ObjectTemplate { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/config/stage/expander/ExpanderStageTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome.pipeline.v2.config.stage.expander; 9 | 10 | import com.dfsek.terra.addons.biome.pipeline.v2.api.Expander; 11 | import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate; 12 | import com.dfsek.terra.addons.biome.pipeline.v2.stage.expander.FractalExpander; 13 | 14 | 15 | public class ExpanderStageTemplate extends StageTemplate { 16 | @Override 17 | public Expander get() { 18 | return new FractalExpander(noise); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/config/stage/mutator/SmoothStageTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator; 9 | 10 | import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage; 11 | import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate; 12 | import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.SmoothStage; 13 | 14 | 15 | public class SmoothStageTemplate extends StageTemplate { 16 | @Override 17 | public Stage get() { 18 | return new SmoothStage(noise); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/source/SingleSource.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.pipeline.v2.source; 2 | 3 | import java.util.Collections; 4 | import java.util.Set; 5 | 6 | import com.dfsek.terra.addons.biome.pipeline.v2.api.Source; 7 | import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome; 8 | 9 | 10 | public class SingleSource implements Source { 11 | 12 | private final PipelineBiome biome; 13 | 14 | public SingleSource(PipelineBiome biome) { 15 | this.biome = biome; 16 | } 17 | 18 | @Override 19 | public PipelineBiome get(long seed, int x, int z) { 20 | return biome; 21 | } 22 | 23 | @Override 24 | public Set getBiomes() { 25 | return Collections.singleton(biome); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline-v2/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: biome-provider-pipeline-v2 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.biome.pipeline.v2.BiomePipelineAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline/README.md: -------------------------------------------------------------------------------- 1 | # biome-provider-pipeline 2 | 3 | Implements the Biome Pipeline, a procedural biome provider that uses a series 4 | of "stages" to apply "mutations" to a 2D grid of biomes. 5 | 6 | This addon registers the `PIPELINE` biome provider type, and all associated 7 | configurations. -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.2") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/stage/Stage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome.pipeline.api.stage; 9 | 10 | import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder; 11 | import com.dfsek.terra.addons.biome.pipeline.api.delegate.BiomeDelegate; 12 | 13 | 14 | public interface Stage { 15 | BiomeHolder apply(BiomeHolder in, long seed); 16 | 17 | boolean isExpansion(); 18 | 19 | Iterable getBiomes(Iterable biomes); 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/stage/type/BiomeExpander.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome.pipeline.api.stage.type; 9 | 10 | import com.dfsek.terra.addons.biome.pipeline.api.delegate.BiomeDelegate; 11 | 12 | 13 | public interface BiomeExpander { 14 | BiomeDelegate getBetween(double x, double z, long seed, BiomeDelegate... others); 15 | } 16 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/SourceTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome.pipeline.config; 9 | 10 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 11 | 12 | import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource; 13 | 14 | 15 | public abstract class SourceTemplate implements ObjectTemplate { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/expander/ExpanderStageTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome.pipeline.config.stage.expander; 9 | 10 | import com.dfsek.terra.addons.biome.pipeline.api.stage.Stage; 11 | import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate; 12 | import com.dfsek.terra.addons.biome.pipeline.expand.FractalExpander; 13 | import com.dfsek.terra.addons.biome.pipeline.stages.ExpanderStage; 14 | 15 | 16 | public class ExpanderStageTemplate extends StageTemplate { 17 | @Override 18 | public Stage get() { 19 | return new ExpanderStage(new FractalExpander(noise)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/SmoothMutatorTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator; 9 | 10 | import com.dfsek.terra.addons.biome.pipeline.api.stage.Stage; 11 | import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate; 12 | import com.dfsek.terra.addons.biome.pipeline.mutator.SmoothMutator; 13 | import com.dfsek.terra.addons.biome.pipeline.stages.MutatorStage; 14 | 15 | 16 | public class SmoothMutatorTemplate extends StageTemplate { 17 | @Override 18 | public Stage get() { 19 | return new MutatorStage(new SmoothMutator(noise)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/BiomeSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome.pipeline.source; 9 | 10 | import com.dfsek.terra.addons.biome.pipeline.api.delegate.BiomeDelegate; 11 | 12 | 13 | public interface BiomeSource { 14 | BiomeDelegate getBiome(double x, double z, long seed); 15 | 16 | Iterable getBiomes(); 17 | } 18 | -------------------------------------------------------------------------------- /common/addons/biome-provider-pipeline/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: biome-provider-pipeline 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.biome.pipeline.BiomePipelineAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/biome-provider-single/README.md: -------------------------------------------------------------------------------- 1 | # biome-provider-single 2 | 3 | Registers and configures the `SINGLE` biome provider, a biome provider which 4 | accepts a single biome to generate continuously. -------------------------------------------------------------------------------- /common/addons/biome-provider-single/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/biome-provider-single/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: biome-provider-single 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.biome.single.SingleBiomeProviderAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/biome-query-api/README.md: -------------------------------------------------------------------------------- 1 | # Biome Query API 2 | 3 | This addon contains an API to allow other addons to quickly query 4 | Biome data, by baking queries and using Contexts on biomes. -------------------------------------------------------------------------------- /common/addons/biome-query-api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/biome-query-api/src/main/java/com/dfsek/terra/addons/biome/query/api/BiomeQueries.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.query.api; 2 | 3 | import java.util.function.Predicate; 4 | 5 | import com.dfsek.terra.addons.biome.query.impl.SingleTagQuery; 6 | import com.dfsek.terra.api.world.biome.Biome; 7 | 8 | 9 | public final class BiomeQueries { 10 | private BiomeQueries() { 11 | 12 | } 13 | 14 | public static Predicate has(String tag) { 15 | return new SingleTagQuery(tag); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/addons/biome-query-api/src/main/java/com/dfsek/terra/addons/biome/query/impl/BiomeTagFlattener.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.query.impl; 2 | 3 | import java.util.List; 4 | 5 | 6 | public class BiomeTagFlattener { 7 | private final List tags; 8 | 9 | public BiomeTagFlattener(List tags) { 10 | this.tags = tags; 11 | } 12 | 13 | public int index(String tag) { 14 | return tags.indexOf(tag); 15 | } 16 | 17 | public int size() { 18 | return tags.size(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/biome-query-api/src/main/java/com/dfsek/terra/addons/biome/query/impl/BiomeTagHolder.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.query.impl; 2 | 3 | import com.dfsek.terra.api.properties.Properties; 4 | import com.dfsek.terra.api.world.biome.Biome; 5 | 6 | 7 | public class BiomeTagHolder implements Properties { 8 | private final boolean[] tags; 9 | private final BiomeTagFlattener flattener; 10 | 11 | public BiomeTagHolder(Biome biome, BiomeTagFlattener flattener) { 12 | this.tags = new boolean[flattener.size()]; 13 | this.flattener = flattener; 14 | for(String tag : biome.getTags()) { 15 | tags[flattener.index(tag)] = true; 16 | } 17 | } 18 | 19 | boolean get(int index) { 20 | return tags[index]; 21 | } 22 | 23 | public BiomeTagFlattener getFlattener() { 24 | return flattener; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /common/addons/biome-query-api/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: biome-query-api 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.biome.query.BiomeQueryAPIAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/chunk-generator-noise-3d/README.md: -------------------------------------------------------------------------------- 1 | # chunk-generator-noise-3d 2 | 3 | Registers the `NOISE_3D` chunk generator, a chunk generator which uses biomes' 4 | samplers in 3D to generate chunk data. -------------------------------------------------------------------------------- /common/addons/chunk-generator-noise-3d/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.2.1") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/noise/BiomeNoiseProperties.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.chunkgenerator.config.noise; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | import com.dfsek.terra.api.properties.Properties; 5 | 6 | 7 | public record BiomeNoiseProperties(NoiseSampler base, 8 | NoiseSampler elevation, 9 | NoiseSampler carving, 10 | int blendDistance, 11 | int blendStep, 12 | double blendWeight, 13 | double elevationWeight, 14 | ThreadLocalNoiseHolder noiseHolder) implements Properties { 15 | } 16 | -------------------------------------------------------------------------------- /common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SingleSlantHolder.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.chunkgenerator.palette.slant; 2 | 3 | import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod; 4 | import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder; 5 | 6 | 7 | final class SingleSlantHolder extends SlantHolderImpl { 8 | 9 | private final SlantHolder.Layer layer; 10 | 11 | public SingleSlantHolder(SlantHolder.Layer layer, int slantDepth, SlantCalculationMethod calculationMethod) { 12 | super(slantDepth, calculationMethod); 13 | this.layer = layer; 14 | } 15 | 16 | @Override 17 | public PaletteHolder getPalette(double slant) { 18 | return layer.palette(); 19 | } 20 | 21 | @Override 22 | protected double getSlantThreshold() { 23 | return layer.threshold(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/addons/chunk-generator-noise-3d/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: chunk-generator-noise-3d 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.chunkgenerator.NoiseChunkGenerator3DAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/command-addons/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/command-addons/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: command-addons 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.commands.addons.AddonsCommandAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/command-packs/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/command-packs/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: command-packs 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.commands.packs.PacksCommandAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/command-profiler/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/command-profiler/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: command-profiler 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.commands.profiler.ProfilerCommandAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/command-structures/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/command-structures/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: command-structures 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.commands.structure.StructureCommandAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/config-biome/README.md: -------------------------------------------------------------------------------- 1 | # config-biome 2 | 3 | Registers the default configuration for Terra Biomes, `BIOME`. -------------------------------------------------------------------------------- /common/addons/config-biome/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/PaletteSettingsImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.biome; 9 | 10 | import com.dfsek.terra.addons.biome.holder.PaletteHolder; 11 | import com.dfsek.terra.api.world.biome.PaletteSettings; 12 | import com.dfsek.terra.api.world.chunk.generation.util.Palette; 13 | 14 | 15 | public class PaletteSettingsImpl implements PaletteSettings { 16 | private final PaletteHolder palette; 17 | 18 | public PaletteSettingsImpl(PaletteHolder palette) { 19 | this.palette = palette; 20 | } 21 | 22 | @Override 23 | public Palette getPalette(int y) { 24 | return palette.getPalette(y); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /common/addons/config-biome/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-biome 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.biome.BiomeAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/config-distributors/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.1") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/config-distributors/src/main/java/com/dfsek/terra/addons/feature/distributor/config/NoDistributorTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.feature.distributor.config; 9 | 10 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 11 | 12 | import com.dfsek.terra.api.structure.feature.Distributor; 13 | 14 | 15 | public class NoDistributorTemplate implements ObjectTemplate { 16 | @Override 17 | public Distributor get() { 18 | return Distributor.no(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/config-distributors/src/main/java/com/dfsek/terra/addons/feature/distributor/config/YesDistributorTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.feature.distributor.config; 9 | 10 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 11 | 12 | import com.dfsek.terra.api.structure.feature.Distributor; 13 | 14 | 15 | public class YesDistributorTemplate implements ObjectTemplate { 16 | @Override 17 | public Distributor get() { 18 | return Distributor.yes(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/config-distributors/src/main/java/com/dfsek/terra/addons/feature/distributor/util/PointTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.feature.distributor.util; 9 | 10 | import com.dfsek.tectonic.api.config.template.annotations.Value; 11 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 12 | 13 | import com.dfsek.terra.api.config.meta.Meta; 14 | 15 | 16 | public class PointTemplate implements ObjectTemplate { 17 | @Value("x") 18 | private @Meta int x; 19 | 20 | @Value("z") 21 | private @Meta int z; 22 | 23 | @Override 24 | public Point get() { 25 | return new Point(x, z); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/addons/config-distributors/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-distributors 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.feature.distributor.DistributorAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | depends: 14 | config-feature: "1.+" 15 | generation-stage-feature: "1.+" -------------------------------------------------------------------------------- /common/addons/config-feature/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/config-feature/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-feature 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.feature.FeatureAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | depends: 14 | generation-stage-feature: "1.+" -------------------------------------------------------------------------------- /common/addons/config-flora/README.md: -------------------------------------------------------------------------------- 1 | # config-flora 2 | 3 | Registers the default configuration for Terra Flora, `FLORA`. -------------------------------------------------------------------------------- /common/addons/config-flora/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.1") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/config-flora/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-flora 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.flora.FloraAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/config-locators/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.1.1") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } -------------------------------------------------------------------------------- /common/addons/config-locators/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-locators 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.feature.locator.LocatorAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | depends: 14 | config-feature: "1.+" 15 | generation-stage-feature: "1.+" -------------------------------------------------------------------------------- /common/addons/config-noise-function/README.md: -------------------------------------------------------------------------------- 1 | # config-noise-function 2 | 3 | Registers the default noise functions. -------------------------------------------------------------------------------- /common/addons/config-noise-function/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.2.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | api("com.dfsek", "paralithic", Versions.Libraries.paralithic) 6 | } 7 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/CubicSplinePointTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.config; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 5 | 6 | import com.dfsek.terra.addons.noise.math.CubicSpline.Point; 7 | import com.dfsek.terra.api.config.meta.Meta; 8 | 9 | 10 | public class CubicSplinePointTemplate implements ObjectTemplate { 11 | 12 | @Value("from") 13 | private @Meta double from; 14 | 15 | @Value("to") 16 | private @Meta double to; 17 | 18 | @Value("gradient") 19 | private @Meta double gradient; 20 | 21 | @Override 22 | public Point get() { 23 | return new Point(from, to, gradient); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeNoiseTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.config.templates.noise; 2 | 3 | import com.dfsek.terra.addons.noise.samplers.noise.DerivativeNoiseFunction; 4 | 5 | 6 | public abstract class DerivativeNoiseTemplate extends NoiseTemplate { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/normalizer/NormalizerTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.noise.config.templates.normalizer; 9 | 10 | import com.dfsek.tectonic.api.config.template.annotations.Value; 11 | 12 | import com.dfsek.terra.addons.noise.config.templates.SamplerTemplate; 13 | import com.dfsek.terra.addons.noise.normalizer.Normalizer; 14 | import com.dfsek.terra.api.config.meta.Meta; 15 | import com.dfsek.terra.api.noise.NoiseSampler; 16 | 17 | 18 | public abstract class NormalizerTemplate extends SamplerTemplate { 19 | @Value("sampler") 20 | protected @Meta NoiseSampler function; 21 | } 22 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/normalizer/ProbabilityNormalizerTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.config.templates.normalizer; 2 | 3 | import com.dfsek.terra.addons.noise.normalizer.ProbabilityNormalizer; 4 | import com.dfsek.terra.api.noise.NoiseSampler; 5 | 6 | 7 | public class ProbabilityNormalizerTemplate extends NormalizerTemplate { 8 | @Override 9 | public NoiseSampler get() { 10 | return new ProbabilityNormalizer(function); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/normalizer/ScaleNormalizerTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.config.templates.normalizer; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | 5 | import com.dfsek.terra.addons.noise.normalizer.ScaleNormalizer; 6 | import com.dfsek.terra.api.config.meta.Meta; 7 | import com.dfsek.terra.api.noise.NoiseSampler; 8 | 9 | 10 | public class ScaleNormalizerTemplate extends NormalizerTemplate { 11 | @Value("amplitude") 12 | private @Meta double amplitude; 13 | 14 | @Override 15 | public NoiseSampler get() { 16 | return new ScaleNormalizer(function, amplitude); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/normalizer/ClampNormalizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.noise.normalizer; 9 | 10 | import com.dfsek.terra.api.noise.NoiseSampler; 11 | 12 | 13 | public class ClampNormalizer extends Normalizer { 14 | private final double min; 15 | private final double max; 16 | 17 | public ClampNormalizer(NoiseSampler sampler, double min, double max) { 18 | super(sampler); 19 | this.min = min; 20 | this.max = max; 21 | } 22 | 23 | @Override 24 | public double normalize(double in) { 25 | return Math.max(Math.min(in, max), min); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/normalizer/CubicSplineNoiseSampler.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.normalizer; 2 | 3 | import com.dfsek.terra.addons.noise.math.CubicSpline; 4 | import com.dfsek.terra.api.noise.NoiseSampler; 5 | 6 | 7 | public class CubicSplineNoiseSampler extends Normalizer { 8 | 9 | private final CubicSpline spline; 10 | 11 | public CubicSplineNoiseSampler(NoiseSampler sampler, CubicSpline spline) { 12 | super(sampler); 13 | this.spline = spline; 14 | } 15 | 16 | @Override 17 | public double normalize(double in) { 18 | return spline.apply(in); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/normalizer/LinearMapNormalizer.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.normalizer; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | 5 | 6 | public class LinearMapNormalizer extends Normalizer { 7 | 8 | private final double aFrom; 9 | 10 | private final double aTo; 11 | 12 | private final double bFrom; 13 | 14 | private final double bTo; 15 | 16 | public LinearMapNormalizer(NoiseSampler sampler, double aFrom, double aTo, double bFrom, double bTo) { 17 | super(sampler); 18 | this.aFrom = aFrom; 19 | this.aTo = aTo; 20 | this.bFrom = bFrom; 21 | this.bTo = bTo; 22 | } 23 | 24 | @Override 25 | public double normalize(double in) { 26 | return (in - aFrom) * (aTo - bTo) / (aFrom - bFrom) + aTo; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/normalizer/PosterizationNormalizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.noise.normalizer; 9 | 10 | import com.dfsek.terra.api.noise.NoiseSampler; 11 | 12 | 13 | public class PosterizationNormalizer extends Normalizer { 14 | private final double stepSize; 15 | 16 | public PosterizationNormalizer(NoiseSampler sampler, int steps) { 17 | super(sampler); 18 | this.stepSize = 2.0 / (steps - 1); 19 | } 20 | 21 | @Override 22 | public double normalize(double in) { 23 | return (int) Math.round((in + 1) / stepSize) * stepSize - 1; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/normalizer/ProbabilityNormalizer.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.normalizer; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | 5 | 6 | public class ProbabilityNormalizer extends Normalizer { 7 | public ProbabilityNormalizer(NoiseSampler sampler) { 8 | super(sampler); 9 | } 10 | 11 | @Override 12 | public double normalize(double in) { 13 | return (in + 1) / 2; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/normalizer/ScaleNormalizer.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.normalizer; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | 5 | 6 | public class ScaleNormalizer extends Normalizer { 7 | private final double scale; 8 | 9 | public ScaleNormalizer(NoiseSampler sampler, double scale) { 10 | super(sampler); 11 | this.scale = scale; 12 | } 13 | 14 | @Override 15 | public double normalize(double in) { 16 | return in * scale; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SeedContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.noise.paralithic.noise; 9 | 10 | import com.dfsek.paralithic.functions.dynamic.Context; 11 | 12 | 13 | public class SeedContext implements Context { 14 | private final long seed; 15 | 16 | public SeedContext(long seed) { 17 | this.seed = seed; 18 | } 19 | 20 | public long getSeed() { 21 | return seed; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/LinearHeightmapSampler.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.samplers; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | 5 | 6 | public class LinearHeightmapSampler implements NoiseSampler { 7 | private final NoiseSampler sampler; 8 | private final double scale; 9 | private final double base; 10 | 11 | public LinearHeightmapSampler(NoiseSampler sampler, double scale, double base) { 12 | this.sampler = sampler; 13 | this.scale = scale; 14 | this.base = base; 15 | } 16 | 17 | 18 | @Override 19 | public double noise(long seed, double x, double y) { 20 | return noise(seed, x, 0, y); 21 | } 22 | 23 | @Override 24 | public double noise(long seed, double x, double y, double z) { 25 | return -y + base + sampler.noise(seed, x, y, z) * scale; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/TranslateSampler.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.samplers; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | 5 | 6 | public class TranslateSampler implements NoiseSampler { 7 | 8 | private final NoiseSampler sampler; 9 | private final double dx, dy, dz; 10 | 11 | public TranslateSampler(NoiseSampler sampler, double dx, double dy, double dz) { 12 | this.sampler = sampler; 13 | this.dx = dx; 14 | this.dy = dy; 15 | this.dz = dz; 16 | } 17 | 18 | @Override 19 | public double noise(long seed, double x, double y) { 20 | return sampler.noise(seed, x - dx, y - dz); 21 | } 22 | 23 | @Override 24 | public double noise(long seed, double x, double y, double z) { 25 | return sampler.noise(seed, x - dx, y - dy, z - dz); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/arithmetic/AdditionSampler.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.samplers.arithmetic; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | 5 | 6 | public class AdditionSampler extends BinaryArithmeticSampler { 7 | public AdditionSampler(NoiseSampler left, NoiseSampler right) { 8 | super(left, right); 9 | } 10 | 11 | @Override 12 | public double operate(double left, double right) { 13 | return left + right; 14 | } 15 | 16 | @Override 17 | public double[] operateDerivative(double[] left, double[] right) { 18 | int dimensions = left.length; 19 | double[] out = new double[dimensions]; 20 | for(int i = 0; i < dimensions; i++) { 21 | out[i] = left[i] + right[i]; 22 | } 23 | return out; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/arithmetic/MaxSampler.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.samplers.arithmetic; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | 5 | 6 | public class MaxSampler extends BinaryArithmeticSampler { 7 | public MaxSampler(NoiseSampler left, NoiseSampler right) { 8 | super(left, right); 9 | } 10 | 11 | @Override 12 | public double operate(double left, double right) { 13 | return Math.max(left, right); 14 | } 15 | 16 | @Override 17 | public double[] operateDerivative(double[] left, double[] right) { 18 | double leftValue = left[0]; 19 | double rightValue = right[0]; 20 | return leftValue > rightValue ? left : right; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/arithmetic/MinSampler.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.samplers.arithmetic; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | 5 | 6 | public class MinSampler extends BinaryArithmeticSampler { 7 | public MinSampler(NoiseSampler left, NoiseSampler right) { 8 | super(left, right); 9 | } 10 | 11 | @Override 12 | public double operate(double left, double right) { 13 | return Math.min(left, right); 14 | } 15 | 16 | @Override 17 | public double[] operateDerivative(double[] left, double[] right) { 18 | double leftValue = left[0]; 19 | double rightValue = right[0]; 20 | return leftValue < rightValue ? left : right; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/arithmetic/SubtractionSampler.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.noise.samplers.arithmetic; 2 | 3 | import com.dfsek.terra.api.noise.NoiseSampler; 4 | 5 | 6 | public class SubtractionSampler extends BinaryArithmeticSampler { 7 | public SubtractionSampler(NoiseSampler left, NoiseSampler right) { 8 | super(left, right); 9 | } 10 | 11 | @Override 12 | public double operate(double left, double right) { 13 | return left - right; 14 | } 15 | 16 | @Override 17 | public double[] operateDerivative(double[] left, double[] right) { 18 | int dimensions = left.length; 19 | double[] out = new double[dimensions]; 20 | for(int i = 0; i < dimensions; i++) { 21 | out[i] = left[i] - right[i]; 22 | } 23 | return out; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/addons/config-noise-function/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-noise-function 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.noise.NoiseAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/config-number-predicate/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar 2 | 3 | version = version("1.0.0") 4 | 5 | dependencies { 6 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 7 | api("com.dfsek", "paralithic", Versions.Libraries.paralithic) 8 | } -------------------------------------------------------------------------------- /common/addons/config-number-predicate/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-number-predicate 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.numberpredicate.NumberPredicateAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/config-ore/README.md: -------------------------------------------------------------------------------- 1 | # config-ore 2 | 3 | Registers the default configuration for Terra Ores, `ORE`. -------------------------------------------------------------------------------- /common/addons/config-ore/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.1.1") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | 7 | -------------------------------------------------------------------------------- /common/addons/config-ore/src/main/java/com/dfsek/terra/addons/ore/ScatteredOreTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.ore; 9 | 10 | import com.dfsek.tectonic.api.config.template.annotations.Value; 11 | 12 | import com.dfsek.terra.api.config.meta.Meta; 13 | 14 | 15 | @SuppressWarnings({ "unused", "FieldMayBeFinal" }) 16 | public class ScatteredOreTemplate extends OreTemplate { 17 | @Value("size") 18 | private @Meta int spread = 7; 19 | 20 | 21 | public int getSpread() { 22 | return spread; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/addons/config-ore/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-ore 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.ore.OreAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/config-palette/README.md: -------------------------------------------------------------------------------- 1 | # config-palette 2 | 3 | Registers the default configuration for Terra Palettes, `PALETTE`. -------------------------------------------------------------------------------- /common/addons/config-palette/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/config-palette/src/main/java/com/dfsek/terra/addons/palette/PaletteFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.palette; 9 | 10 | import com.dfsek.terra.addons.palette.palette.PaletteImpl; 11 | import com.dfsek.terra.api.Platform; 12 | import com.dfsek.terra.api.config.ConfigFactory; 13 | import com.dfsek.terra.api.world.chunk.generation.util.Palette; 14 | 15 | 16 | public class PaletteFactory implements ConfigFactory { 17 | @Override 18 | public Palette build(PaletteTemplate config, Platform platform) { 19 | return new PaletteImpl(config.getPalette(), config.getDefaultSampler()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/addons/config-palette/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-palette 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.palette.PaletteAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/config-structure/README.md: -------------------------------------------------------------------------------- 1 | # config-structure 2 | 3 | Registers the default configuration for Terra Structures, `STRUCTURE`. -------------------------------------------------------------------------------- /common/addons/config-structure/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.1") 2 | 3 | dependencies { 4 | api("com.googlecode.json-simple:json-simple:1.1.1") 5 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 6 | } 7 | -------------------------------------------------------------------------------- /common/addons/config-structure/src/main/java/com/dfsek/terra/addons/structure/BiomeStructures.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.structure; 9 | 10 | import java.util.Set; 11 | 12 | import com.dfsek.terra.api.properties.Properties; 13 | import com.dfsek.terra.api.structure.configured.ConfiguredStructure; 14 | 15 | 16 | public class BiomeStructures implements Properties { 17 | private final Set structures; 18 | 19 | public BiomeStructures(Set structures) { 20 | this.structures = structures; 21 | } 22 | 23 | public Set getStructures() { 24 | return structures; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /common/addons/config-structure/src/main/java/com/dfsek/terra/addons/structure/StructureFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.structure; 9 | 10 | import com.dfsek.terra.api.Platform; 11 | import com.dfsek.terra.api.config.ConfigFactory; 12 | import com.dfsek.terra.api.structure.configured.ConfiguredStructure; 13 | 14 | 15 | public class StructureFactory implements ConfigFactory { 16 | @Override 17 | public ConfiguredStructure build(StructureTemplate config, Platform platform) { 18 | return new TerraStructure(config.getStructures(), config.getY(), config.getSpawn(), config.getID()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/config-structure/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: config-structure 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.structure.StructureAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/generation-stage-feature/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.1.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/generation-stage-feature/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: generation-stage-feature 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.generation.feature.FeatureGenerationAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/generation-stage-structure/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/generation-stage-structure/src/main/java/com/dfsek/terra/addons/generation/structure/StructureGenerationStage.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.generation.structure; 2 | 3 | import com.dfsek.terra.api.Platform; 4 | import com.dfsek.terra.api.world.chunk.generation.ProtoWorld; 5 | import com.dfsek.terra.api.world.chunk.generation.stage.GenerationStage; 6 | 7 | 8 | public class StructureGenerationStage implements GenerationStage { 9 | private final Platform platform; 10 | 11 | public StructureGenerationStage(Platform platform) { this.platform = platform; } 12 | 13 | @Override 14 | public void populate(ProtoWorld world) { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/addons/generation-stage-structure/src/main/java/com/dfsek/terra/addons/generation/structure/config/BiomeStructures.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.generation.structure.config; 2 | 3 | import java.util.List; 4 | 5 | import com.dfsek.terra.api.properties.Properties; 6 | import com.dfsek.terra.api.structure.configured.ConfiguredStructure; 7 | 8 | 9 | public class BiomeStructures implements Properties { 10 | private final List structures; 11 | 12 | public BiomeStructures(List structures) { this.structures = structures; } 13 | 14 | public List getStructures() { 15 | return structures; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/addons/generation-stage-structure/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: generation-stage-structure 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.generation.structure.StructureGenerationAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/language-yaml/README.md: -------------------------------------------------------------------------------- 1 | # language-yaml 2 | 3 | Allows `*.yml` files to be loaded as Terra configurations. -------------------------------------------------------------------------------- /common/addons/language-yaml/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | implementation("com.dfsek.tectonic:yaml:${Versions.Libraries.tectonic}") 5 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 6 | } 7 | -------------------------------------------------------------------------------- /common/addons/language-yaml/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: language-yaml 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.yaml.YamlAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/library-image/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.1.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/colorsampler/ColorSampler.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.colorsampler; 2 | 3 | @FunctionalInterface 4 | public interface ColorSampler { 5 | 6 | /** 7 | * @param x World x coordinate 8 | * @param z World z coordinate 9 | * 10 | * @return Integer representing a web color 11 | */ 12 | int apply(int x, int z); 13 | } 14 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/colorsampler/image/transform/Alignment.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.colorsampler.image.transform; 2 | 3 | import com.dfsek.terra.addons.image.image.Image; 4 | 5 | 6 | public enum Alignment implements ImageTransformation { 7 | 8 | NONE() { 9 | @Override 10 | public int transformX(Image image, int x) { 11 | return x; 12 | } 13 | 14 | @Override 15 | public int transformZ(Image image, int z) { 16 | return z; 17 | } 18 | }, 19 | CENTER { 20 | @Override 21 | public int transformX(Image image, int x) { 22 | return x + image.getWidth() / 2; 23 | } 24 | 25 | @Override 26 | public int transformZ(Image image, int z) { 27 | return z + image.getHeight() / 2; 28 | } 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/colorsampler/image/transform/ImageTransformation.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.colorsampler.image.transform; 2 | 3 | import com.dfsek.terra.addons.image.image.Image; 4 | 5 | 6 | public interface ImageTransformation { 7 | 8 | int transformX(Image image, int x); 9 | 10 | int transformZ(Image image, int z); 11 | } 12 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/colorsampler/mutate/TranslateColorSampler.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.colorsampler.mutate; 2 | 3 | import com.dfsek.terra.addons.image.colorsampler.ColorSampler; 4 | 5 | 6 | public class TranslateColorSampler implements ColorSampler { 7 | 8 | private final ColorSampler sampler; 9 | private final int translateX, translateZ; 10 | 11 | public TranslateColorSampler(ColorSampler sampler, int translateX, int translateZ) { 12 | this.sampler = sampler; 13 | this.translateX = translateX; 14 | this.translateZ = translateZ; 15 | } 16 | 17 | @Override 18 | public int apply(int x, int z) { 19 | return sampler.apply(x - translateX, z - translateZ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/colorsampler/ConstantColorSamplerTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.colorsampler; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 5 | 6 | import com.dfsek.terra.addons.image.colorsampler.ColorSampler; 7 | import com.dfsek.terra.addons.image.config.ColorLoader.ColorString; 8 | 9 | 10 | public class ConstantColorSamplerTemplate implements ObjectTemplate { 11 | 12 | @Value("color") 13 | private ColorString color; 14 | 15 | @Override 16 | public ColorSampler get() { 17 | return ((x, z) -> color.getColor()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/colorsampler/image/ImageColorSamplerTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.colorsampler.image; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Default; 4 | import com.dfsek.tectonic.api.config.template.annotations.Value; 5 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 6 | 7 | import com.dfsek.terra.addons.image.colorsampler.ColorSampler; 8 | import com.dfsek.terra.addons.image.colorsampler.image.transform.Alignment; 9 | import com.dfsek.terra.addons.image.image.Image; 10 | 11 | 12 | public abstract class ImageColorSamplerTemplate implements ObjectTemplate { 13 | 14 | @Value("image") 15 | protected Image image; 16 | 17 | @Value("align") 18 | @Default 19 | protected Alignment alignment = Alignment.NONE; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/colorsampler/image/SingleImageColorSamplerTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.colorsampler.image; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | 5 | import com.dfsek.terra.addons.image.colorsampler.ColorSampler; 6 | import com.dfsek.terra.addons.image.colorsampler.image.SingleImageColorSampler; 7 | 8 | 9 | public class SingleImageColorSamplerTemplate extends ImageColorSamplerTemplate { 10 | @Value("outside-sampler") 11 | private ColorSampler fallback; 12 | 13 | @Override 14 | public ColorSampler get() { 15 | return new SingleImageColorSampler(image, fallback, alignment); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/colorsampler/image/TileImageColorSamplerTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.colorsampler.image; 2 | 3 | import com.dfsek.terra.addons.image.colorsampler.ColorSampler; 4 | import com.dfsek.terra.addons.image.colorsampler.image.TileImageColorSampler; 5 | 6 | 7 | public class TileImageColorSamplerTemplate extends ImageColorSamplerTemplate { 8 | 9 | @Override 10 | public ColorSampler get() { 11 | return new TileImageColorSampler(image, alignment); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/colorsampler/mutate/MutateColorSamplerTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.colorsampler.mutate; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 5 | 6 | import com.dfsek.terra.addons.image.colorsampler.ColorSampler; 7 | 8 | 9 | public abstract class MutateColorSamplerTemplate implements ObjectTemplate { 10 | 11 | @Value("color-sampler") 12 | protected ColorSampler sampler; 13 | } 14 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/colorsampler/mutate/RotateColorSamplerTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.colorsampler.mutate; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | 5 | import com.dfsek.terra.addons.image.colorsampler.ColorSampler; 6 | import com.dfsek.terra.addons.image.colorsampler.mutate.RotateColorSampler; 7 | 8 | 9 | public class RotateColorSamplerTemplate extends MutateColorSamplerTemplate { 10 | 11 | @Value("angle") 12 | private double degrees; 13 | 14 | @Override 15 | public ColorSampler get() { 16 | return new RotateColorSampler(sampler, degrees); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/colorsampler/mutate/TranslateColorSamplerTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.colorsampler.mutate; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | 5 | import com.dfsek.terra.addons.image.colorsampler.ColorSampler; 6 | import com.dfsek.terra.addons.image.colorsampler.mutate.TranslateColorSampler; 7 | 8 | 9 | public class TranslateColorSamplerTemplate extends MutateColorSamplerTemplate { 10 | 11 | @Value("x") 12 | private int translateX; 13 | 14 | @Value("z") 15 | private int translateZ; 16 | 17 | @Override 18 | public ColorSampler get() { 19 | return new TranslateColorSampler(sampler, translateX, translateZ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/converter/ClosestColorConverterTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.converter; 2 | 3 | import com.dfsek.terra.addons.image.converter.ClosestMatchColorConverter; 4 | import com.dfsek.terra.addons.image.converter.ColorConverter; 5 | import com.dfsek.terra.addons.image.converter.mapping.ColorMapping; 6 | 7 | 8 | public abstract class ClosestColorConverterTemplate implements ColorConverterTemplate { 9 | 10 | protected abstract ColorMapping getMapping(); 11 | 12 | @Override 13 | public ColorConverter get() { 14 | return new ClosestMatchColorConverter(getMapping().get()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/converter/ColorConverterTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.converter; 2 | 3 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 4 | 5 | import com.dfsek.terra.addons.image.converter.ColorConverter; 6 | 7 | 8 | public interface ColorConverterTemplate extends ObjectTemplate> { 9 | } 10 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/config/converter/ExactColorConverterTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.config.converter; 2 | 3 | import com.dfsek.terra.addons.image.converter.ColorConverter; 4 | import com.dfsek.terra.addons.image.converter.ExactColorConverter; 5 | import com.dfsek.terra.addons.image.converter.mapping.ColorMapping; 6 | 7 | 8 | public abstract class ExactColorConverterTemplate implements ColorConverterTemplate { 9 | 10 | protected abstract ColorMapping getMapping(); 11 | 12 | protected abstract T getFallback(); 13 | 14 | protected abstract boolean ignoreAlpha(); 15 | 16 | @Override 17 | public ColorConverter get() { 18 | return new ExactColorConverter(getMapping().get(), getFallback(), ignoreAlpha()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/converter/ColorConverter.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.converter; 2 | 3 | public interface ColorConverter { 4 | 5 | T apply(int color); 6 | 7 | Iterable getEntries(); 8 | } 9 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/converter/mapping/ColorMapping.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.converter.mapping; 2 | 3 | import java.util.Map; 4 | import java.util.function.Supplier; 5 | 6 | 7 | public interface ColorMapping extends Supplier> { 8 | } 9 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/image/BufferedImageWrapper.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.image; 2 | 3 | import java.awt.image.BufferedImage; 4 | 5 | 6 | public class BufferedImageWrapper implements Image { 7 | 8 | private final BufferedImage image; 9 | 10 | public BufferedImageWrapper(BufferedImage image) { 11 | this.image = image; 12 | } 13 | 14 | @Override 15 | public int getRGB(int x, int y) { 16 | return image.getRGB(x, y); 17 | } 18 | 19 | @Override 20 | public int getWidth() { 21 | return image.getWidth(); 22 | } 23 | 24 | @Override 25 | public int getHeight() { 26 | return image.getHeight(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/image/Image.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.image; 2 | 3 | public interface Image { 4 | int getRGB(int x, int y); 5 | 6 | int getWidth(); 7 | 8 | int getHeight(); 9 | } 10 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/image/SuppliedImage.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.image; 2 | 3 | import java.util.function.Supplier; 4 | 5 | 6 | public class SuppliedImage implements Image { 7 | 8 | private final Supplier imageSupplier; 9 | 10 | public SuppliedImage(Supplier imageSupplier) { 11 | this.imageSupplier = imageSupplier; 12 | } 13 | 14 | @Override 15 | public int getRGB(int x, int y) { 16 | return imageSupplier.get().getRGB(x, y); 17 | } 18 | 19 | @Override 20 | public int getWidth() { 21 | return imageSupplier.get().getWidth(); 22 | } 23 | 24 | @Override 25 | public int getHeight() { 26 | return imageSupplier.get().getHeight(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/util/MapUtil.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.util; 2 | 3 | import java.util.Map; 4 | import java.util.Map.Entry; 5 | import java.util.function.Function; 6 | import java.util.stream.Collectors; 7 | 8 | 9 | public class MapUtil { 10 | 11 | private MapUtil() { } 12 | 13 | /** 14 | * Utility method for applying transformations on a map's keys. 15 | */ 16 | public static Map mapKeys(Map map, Function mappingFunction) { 17 | return map 18 | .entrySet() 19 | .stream() 20 | .collect(Collectors.toMap( 21 | e -> mappingFunction.apply(e.getKey()), 22 | Entry::getValue 23 | )); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/java/com/dfsek/terra/addons/image/util/MathUtil.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.image.util; 2 | 3 | public class MathUtil { 4 | private MathUtil() { } 5 | 6 | public static double lerp(double x, double x1, double y1, double x2, double y2) { 7 | return (((y1 - y2) * (x - x1)) / (x1 - x2)) + y1; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common/addons/library-image/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: library-image 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.image.ImageLibraryAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | -------------------------------------------------------------------------------- /common/addons/locator-slant-noise-3d/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | compileOnlyApi(project(":common:addons:chunk-generator-noise-3d")) 6 | } 7 | -------------------------------------------------------------------------------- /common/addons/locator-slant-noise-3d/src/main/java/com/dfsek/terra/addon/feature/locator/slant/SlantLocatorTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addon.feature.locator.slant; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 5 | 6 | import java.util.function.DoublePredicate; 7 | 8 | import com.dfsek.terra.api.config.meta.Meta; 9 | import com.dfsek.terra.api.structure.feature.Locator; 10 | 11 | 12 | public class SlantLocatorTemplate implements ObjectTemplate { 13 | 14 | @Value("condition") 15 | private @Meta DoublePredicate predicate; 16 | 17 | @Override 18 | public Locator get() { 19 | return new SlantLocator(predicate); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/addons/locator-slant-noise-3d/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: locator-slant-noise-3d 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addon.feature.locator.slant.SlantLocatorAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | depends: 14 | chunk-generator-noise-3d: "[1.2.0,2.0.0)" -------------------------------------------------------------------------------- /common/addons/manifest-addon-loader/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | api("commons-io", "commons-io", Versions.Libraries.Internal.apacheIO) 5 | implementation("com.dfsek.tectonic", "yaml", Versions.Libraries.tectonic) 6 | } 7 | 8 | tasks.withType { 9 | manifest { 10 | attributes("Terra-Bootstrap-Addon-Entry-Point" to "com.dfsek.terra.addons.manifest.impl.ManifestAddonLoader") 11 | } 12 | } 13 | 14 | project.extra.set("bootstrap", true) -------------------------------------------------------------------------------- /common/addons/manifest-addon-loader/src/main/java/com/dfsek/terra/addons/manifest/api/AddonInitializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.manifest.api; 9 | 10 | 11 | public interface AddonInitializer { 12 | void initialize(); 13 | } 14 | -------------------------------------------------------------------------------- /common/addons/manifest-addon-loader/src/main/java/com/dfsek/terra/addons/manifest/impl/ManifestAddonClassLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.manifest.impl; 9 | 10 | import java.net.URL; 11 | import java.net.URLClassLoader; 12 | 13 | 14 | public class ManifestAddonClassLoader extends URLClassLoader { 15 | static { 16 | ClassLoader.registerAsParallelCapable(); 17 | } 18 | 19 | public ManifestAddonClassLoader(URL[] urls, ClassLoader parent) { 20 | super(urls, parent); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/addons/manifest-addon-loader/src/main/java/com/dfsek/terra/addons/manifest/impl/exception/AddonException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.manifest.impl.exception; 9 | 10 | import java.io.Serial; 11 | 12 | 13 | public class AddonException extends RuntimeException { 14 | @Serial 15 | private static final long serialVersionUID = -4201912399458420090L; 16 | 17 | public AddonException(String message) { 18 | super(message); 19 | } 20 | 21 | public AddonException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/addons/manifest-addon-loader/src/main/java/com/dfsek/terra/addons/manifest/impl/exception/ManifestException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.manifest.impl.exception; 9 | 10 | import java.io.Serial; 11 | 12 | 13 | public class ManifestException extends AddonException { 14 | @Serial 15 | private static final long serialVersionUID = -2458077663176544645L; 16 | 17 | public ManifestException(String message) { 18 | super(message); 19 | } 20 | 21 | public ManifestException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/addons/manifest-addon-loader/src/main/java/com/dfsek/terra/addons/manifest/impl/exception/ManifestNotPresentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.manifest.impl.exception; 9 | 10 | import java.io.Serial; 11 | 12 | 13 | public class ManifestNotPresentException extends ManifestException { 14 | @Serial 15 | private static final long serialVersionUID = -2116663180747013810L; 16 | 17 | public ManifestNotPresentException(String message) { 18 | super(message); 19 | } 20 | 21 | public ManifestNotPresentException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/addons/palette-block-shortcut/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/palette-block-shortcut/src/main/java/com/dfsek/terra/addons/palette/shortcut/block/SingletonPalette.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.palette.shortcut.block; 2 | 3 | import com.dfsek.terra.api.block.state.BlockState; 4 | import com.dfsek.terra.api.world.chunk.generation.util.Palette; 5 | 6 | 7 | public class SingletonPalette implements Palette { 8 | private final BlockState blockState; 9 | 10 | public SingletonPalette(BlockState blockState) { 11 | this.blockState = blockState; 12 | } 13 | 14 | @Override 15 | public BlockState get(int layer, double x, double y, double z, long seed) { 16 | return blockState; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/addons/palette-block-shortcut/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: palette-block-shortcut 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.palette.shortcut.block.PaletteBlockShortcutAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/pipeline-image/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | compileOnlyApi(project(":common:addons:biome-provider-pipeline-v2")) 6 | compileOnlyApi(project(":common:addons:library-image")) 7 | } 8 | -------------------------------------------------------------------------------- /common/addons/pipeline-image/src/main/java/com/dfsek/terra/addons/biome/pipeline/image/config/converter/ClosestPipelineBiomeColorConverterTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.biome.pipeline.image.config.converter; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Value; 4 | 5 | import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome; 6 | import com.dfsek.terra.addons.image.config.converter.ClosestColorConverterTemplate; 7 | import com.dfsek.terra.addons.image.converter.mapping.ColorMapping; 8 | 9 | 10 | public class ClosestPipelineBiomeColorConverterTemplate extends ClosestColorConverterTemplate { 11 | 12 | @Value("match") 13 | private ColorMapping match; 14 | 15 | @Override 16 | protected ColorMapping getMapping() { 17 | return match; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/addons/pipeline-image/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: pipeline-image 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.biome.pipeline.image.PipelineImageAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | depends: 14 | library-image: "1.+" 15 | biome-provider-pipeline-v2: "1.+" 16 | -------------------------------------------------------------------------------- /common/addons/structure-block-shortcut/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/structure-block-shortcut/src/main/java/com/dfsek/terra/addons/palette/shortcut/block/SingletonStructure.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.palette.shortcut.block; 2 | 3 | import java.util.Random; 4 | 5 | import com.dfsek.terra.api.block.state.BlockState; 6 | import com.dfsek.terra.api.structure.Structure; 7 | import com.dfsek.terra.api.util.Rotation; 8 | import com.dfsek.terra.api.util.vector.Vector3Int; 9 | import com.dfsek.terra.api.world.WritableWorld; 10 | 11 | 12 | public class SingletonStructure implements Structure { 13 | private final BlockState blockState; 14 | 15 | public SingletonStructure(BlockState blockState) { 16 | this.blockState = blockState; 17 | } 18 | 19 | @Override 20 | public boolean generate(Vector3Int location, WritableWorld world, Random random, Rotation rotation) { 21 | world.setBlockState(location, blockState); 22 | return true; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/addons/structure-block-shortcut/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: structure-block-shortcut 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.palette.shortcut.block.StructureBlockShortcutAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/structure-mutator/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("0.1.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | } 6 | -------------------------------------------------------------------------------- /common/addons/structure-mutator/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: structure-mutator 5 | version: @VERSION@ 6 | entrypoints: [ ] 7 | website: 8 | issues: https://github.com/PolyhedralDev/Terra/issues 9 | source: https://github.com/PolyhedralDev/Terra 10 | docs: https://terra.polydev.org 11 | license: MIT License -------------------------------------------------------------------------------- /common/addons/structure-sponge-loader/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar 2 | 3 | version = version("1.0.0") 4 | 5 | dependencies { 6 | api("commons-io", "commons-io", Versions.Libraries.Internal.apacheIO) 7 | api("com.github.Querz", "NBT", Versions.Libraries.Internal.nbt) 8 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 9 | } -------------------------------------------------------------------------------- /common/addons/structure-sponge-loader/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: structure-sponge-loader 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.sponge.SpongeSchematicAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/README.md: -------------------------------------------------------------------------------- 1 | # structure-terrascript-loader 2 | 3 | Implements the TerraScript structure scripting language, and loads all `*.tesf` 4 | files into the Structure registry. -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar 2 | 3 | version = version("1.2.0") 4 | 5 | dependencies { 6 | api("commons-io", "commons-io", Versions.Libraries.Internal.apacheIO) 7 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 8 | } -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/lang/Executable.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.terrascript.parser.lang; 2 | 3 | 4 | import com.dfsek.terra.addons.terrascript.parser.lang.Scope.ScopeBuilder; 5 | 6 | 7 | public class Executable { 8 | private final Block script; 9 | private final ThreadLocal scope; 10 | 11 | public Executable(Block script, ScopeBuilder scopeBuilder) { 12 | this.script = script; 13 | this.scope = ThreadLocal.withInitial(scopeBuilder::build); 14 | } 15 | 16 | public boolean execute(ImplementationArguments arguments) { 17 | return script.apply(arguments, scope.get()).getLevel() != Block.ReturnLevel.FAIL; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/lang/ImplementationArguments.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.terrascript.parser.lang; 9 | 10 | /** 11 | * Arguments passed to {@link Item}s by the implementation 12 | */ 13 | public interface ImplementationArguments { 14 | } 15 | -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/lang/Keyword.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.terrascript.parser.lang; 9 | 10 | public interface Keyword extends Returnable { 11 | } 12 | -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/lang/Statement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.terrascript.parser.lang; 9 | 10 | public interface Statement extends Item { 11 | } 12 | -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/lang/constants/StringConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.terrascript.parser.lang.constants; 9 | 10 | import com.dfsek.terra.addons.terrascript.parser.lang.Returnable; 11 | import com.dfsek.terra.addons.terrascript.tokenizer.Position; 12 | 13 | 14 | public class StringConstant extends ConstantExpression { 15 | public StringConstant(String constant, Position position) { 16 | super(constant, position); 17 | } 18 | 19 | @Override 20 | public Returnable.ReturnType returnType() { 21 | return Returnable.ReturnType.STRING; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/lang/functions/FunctionBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.terrascript.parser.lang.functions; 9 | 10 | import java.util.List; 11 | 12 | import com.dfsek.terra.addons.terrascript.parser.lang.Returnable; 13 | import com.dfsek.terra.addons.terrascript.tokenizer.Position; 14 | 15 | 16 | public interface FunctionBuilder> { 17 | T build(List> argumentList, Position position); 18 | 19 | int argNumber(); 20 | 21 | Returnable.ReturnType getArgument(int position); 22 | } 23 | -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/lang/variables/Variable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.terrascript.parser.lang.variables; 9 | 10 | import com.dfsek.terra.addons.terrascript.parser.lang.Returnable; 11 | import com.dfsek.terra.addons.terrascript.tokenizer.Position; 12 | 13 | 14 | public interface Variable { 15 | T getValue(); 16 | 17 | void setValue(T value); 18 | 19 | Returnable.ReturnType getType(); 20 | 21 | Position getPosition(); 22 | } 23 | -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/lang/variables/reference/StrVariableReferenceNode.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addons.terrascript.parser.lang.variables.reference; 2 | 3 | import com.dfsek.terra.addons.terrascript.parser.lang.ImplementationArguments; 4 | import com.dfsek.terra.addons.terrascript.parser.lang.Scope; 5 | import com.dfsek.terra.addons.terrascript.tokenizer.Position; 6 | 7 | 8 | public class StrVariableReferenceNode extends VariableReferenceNode { 9 | public StrVariableReferenceNode(Position position, ReturnType type, int index) { 10 | super(position, type, index); 11 | } 12 | 13 | @Override 14 | public String apply(ImplementationArguments implementationArguments, Scope scope) { 15 | return scope.getStr(index); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/tokenizer/Position.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra Core Addons are licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in this module's root directory. 6 | */ 7 | 8 | package com.dfsek.terra.addons.terrascript.tokenizer; 9 | 10 | public class Position { 11 | private final int line; 12 | private final int index; 13 | 14 | public Position(int line, int index) { 15 | this.line = line; 16 | this.index = index; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return (line + 1) + ":" + index; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/addons/structure-terrascript-loader/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: structure-terrascript-loader 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.terrascript.TerraScriptAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License -------------------------------------------------------------------------------- /common/addons/terrascript-function-check-noise-3d/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.1") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | compileOnlyApi(project(":common:addons:chunk-generator-noise-3d")) 6 | compileOnlyApi(project(":common:addons:structure-terrascript-loader")) 7 | } -------------------------------------------------------------------------------- /common/addons/terrascript-function-check-noise-3d/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: structure-function-check-noise-3d 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addon.terrascript.check.TerraScriptCheckFunctionAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | depends: 14 | structure-terrascript-loader: "1.+" 15 | chunk-generator-noise-3d: "1.+" -------------------------------------------------------------------------------- /common/addons/terrascript-function-sampler/build.gradle.kts: -------------------------------------------------------------------------------- 1 | version = version("1.0.0") 2 | 3 | dependencies { 4 | compileOnlyApi(project(":common:addons:manifest-addon-loader")) 5 | compileOnlyApi(project(":common:addons:config-noise-function")) 6 | compileOnlyApi(project(":common:addons:structure-terrascript-loader")) 7 | } 8 | -------------------------------------------------------------------------------- /common/addons/terrascript-function-sampler/src/main/resources/terra.addon.yml: -------------------------------------------------------------------------------- 1 | schema-version: 1 2 | contributors: 3 | - Terra contributors 4 | id: terrascript-function-sampler 5 | version: @VERSION@ 6 | entrypoints: 7 | - "com.dfsek.terra.addons.terrascript.sampler.TerraScriptSamplerFunctionAddon" 8 | website: 9 | issues: https://github.com/PolyhedralDev/Terra/issues 10 | source: https://github.com/PolyhedralDev/Terra 11 | docs: https://terra.polydev.org 12 | license: MIT License 13 | depends: 14 | structure-terrascript-loader: "1.+" 15 | config-noise-function: "1.+" -------------------------------------------------------------------------------- /common/api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api("ca.solo-studios", "strata", Versions.Libraries.strata) 3 | compileOnlyApi("org.slf4j", "slf4j-api", Versions.Libraries.slf4j) 4 | testImplementation("org.slf4j", "slf4j-api", Versions.Libraries.slf4j) 5 | 6 | api("org.incendo", "cloud-core", Versions.Libraries.cloud) 7 | 8 | api("com.dfsek.tectonic", "common", Versions.Libraries.tectonic) 9 | 10 | api("com.github.ben-manes.caffeine", "caffeine", Versions.Libraries.caffeine) 11 | 12 | api("com.dfsek", "paralithic", Versions.Libraries.paralithic) 13 | } -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/Handle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api; 9 | 10 | /** 11 | * An interface that contains a platform delegate. 12 | */ 13 | public interface Handle { 14 | /** 15 | * Gets the delegate object. 16 | * 17 | * @return Delegate 18 | */ 19 | Object getHandle(); 20 | } 21 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/block/entity/BlockEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.block.entity; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | import com.dfsek.terra.api.block.state.BlockState; 12 | import com.dfsek.terra.api.util.vector.Vector3; 13 | 14 | 15 | public interface BlockEntity extends Handle { 16 | boolean update(boolean applyPhysics); 17 | 18 | default void applyState(String state) { 19 | // Do nothing by default. 20 | } 21 | 22 | Vector3 getPosition(); 23 | 24 | int getX(); 25 | 26 | int getY(); 27 | 28 | int getZ(); 29 | 30 | BlockState getBlockState(); 31 | } 32 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/block/entity/Container.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.block.entity; 9 | 10 | import com.dfsek.terra.api.inventory.BlockInventoryHolder; 11 | 12 | 13 | public interface Container extends BlockEntity, BlockInventoryHolder { 14 | } 15 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/block/entity/Sign.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.block.entity; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | 13 | public interface Sign extends BlockEntity { 14 | void setLine(int index, @NotNull String line) throws IndexOutOfBoundsException; 15 | 16 | @NotNull String[] getLines(); 17 | 18 | @NotNull String getLine(int index) throws IndexOutOfBoundsException; 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/block/state/properties/enums/Axis.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.block.state.properties.enums; 9 | 10 | public enum Axis { 11 | X, 12 | Y, 13 | Z 14 | } 15 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/block/state/properties/enums/Half.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.block.state.properties.enums; 9 | 10 | public enum Half { 11 | /** 12 | * The top half of the block, normally with the higher y coordinate. 13 | */ 14 | TOP, 15 | /** 16 | * The bottom half of the block, normally with the lower y coordinate. 17 | */ 18 | BOTTOM, 19 | 20 | /** 21 | * Some blocks, e.g. slabs, can occupy both halves. 22 | */ 23 | DOUBLE 24 | } 25 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/block/state/properties/enums/RailShape.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.block.state.properties.enums; 9 | 10 | public enum RailShape { 11 | ASCENDING_EAST, 12 | ASCENDING_NORTH, 13 | ASCENDING_SOUTH, 14 | ASCENDING_WEST, 15 | EAST_WEST, 16 | NORTH_EAST, 17 | NORTH_SOUTH, 18 | NORTH_WEST, 19 | SOUTH_EAST, 20 | SOUTH_WEST 21 | } 22 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/block/state/properties/enums/RedstoneConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.block.state.properties.enums; 9 | 10 | public enum RedstoneConnection { 11 | NONE, 12 | SIDE, 13 | UP 14 | } 15 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/block/state/properties/enums/WallHeight.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.block.state.properties.enums; 9 | 10 | public enum WallHeight { 11 | LOW, 12 | NONE, 13 | TALL 14 | } 15 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/command/CommandSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.command; 9 | 10 | import java.util.Optional; 11 | 12 | import com.dfsek.terra.api.Handle; 13 | import com.dfsek.terra.api.entity.Entity; 14 | import com.dfsek.terra.api.entity.Player; 15 | 16 | 17 | public interface CommandSender extends Handle { 18 | void sendMessage(String message); 19 | 20 | Optional getEntity(); 21 | 22 | Optional getPlayer(); 23 | } 24 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/config/AbstractableTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.config; 9 | 10 | import com.dfsek.tectonic.api.config.template.ConfigTemplate; 11 | 12 | import com.dfsek.terra.api.registry.key.StringIdentifiable; 13 | 14 | 15 | /** 16 | * An abstractable config template 17 | */ 18 | public interface AbstractableTemplate extends ConfigTemplate, StringIdentifiable { 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/config/ConfigFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.config; 9 | 10 | import com.dfsek.tectonic.api.config.template.ConfigTemplate; 11 | import com.dfsek.tectonic.api.exception.LoadException; 12 | 13 | import com.dfsek.terra.api.Platform; 14 | 15 | 16 | public interface ConfigFactory { 17 | O build(C config, Platform platform) throws LoadException; 18 | } 19 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/config/ConfigType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.config; 9 | 10 | import com.dfsek.terra.api.Platform; 11 | import com.dfsek.terra.api.util.reflection.TypeKey; 12 | 13 | 14 | public interface ConfigType { 15 | T getTemplate(ConfigPack pack, Platform platform); 16 | 17 | ConfigFactory getFactory(); 18 | 19 | TypeKey getTypeKey(); 20 | } 21 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/config/PluginConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.config; 9 | 10 | import com.dfsek.terra.api.Platform; 11 | 12 | 13 | public interface PluginConfig { 14 | void load(Platform platform); 15 | 16 | boolean dumpDefaultConfig(); 17 | 18 | boolean isDebugCommands(); 19 | 20 | boolean isDebugProfiler(); 21 | 22 | boolean isDebugScript(); 23 | 24 | boolean isDebugLog(); 25 | 26 | int getBiomeSearchResolution(); 27 | 28 | int getStructureCache(); 29 | 30 | int getSamplerCache(); 31 | 32 | int getMaxRecursion(); 33 | 34 | int getProviderCache(); 35 | } 36 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/config/meta/Meta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.config.meta; 9 | 10 | import java.lang.annotation.ElementType; 11 | import java.lang.annotation.Retention; 12 | import java.lang.annotation.RetentionPolicy; 13 | import java.lang.annotation.Target; 14 | 15 | 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(ElementType.TYPE_USE) 18 | public @interface Meta { 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/entity/Entity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.entity; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | import com.dfsek.terra.api.util.vector.Vector3; 12 | import com.dfsek.terra.api.world.ServerWorld; 13 | 14 | 15 | public interface Entity extends Handle { 16 | Vector3 position(); 17 | 18 | void position(Vector3 position); 19 | 20 | void world(ServerWorld world); 21 | 22 | ServerWorld world(); 23 | } 24 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/entity/EntityType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.entity; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | 12 | 13 | public interface EntityType extends Handle { 14 | } 15 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/entity/Player.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.entity; 9 | 10 | public interface Player extends Entity { 11 | } 12 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/EventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event; 9 | 10 | import com.dfsek.terra.api.event.events.Event; 11 | 12 | 13 | public interface EventHandler { 14 | void handle(Event event); 15 | } 16 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/EventManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event; 9 | 10 | import com.dfsek.terra.api.event.events.Event; 11 | 12 | 13 | /** 14 | * Manages event registration and triggering. 15 | */ 16 | public interface EventManager { 17 | /** 18 | * Call an event, and return the execution status. 19 | * 20 | * @param event Event to pass to all registered EventListeners. 21 | */ 22 | T callEvent(T event); 23 | 24 | void registerHandler(Class clazz, T handler); 25 | 26 | T getHandler(Class clazz); 27 | } 28 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/events/AbstractCancellable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.events; 9 | 10 | import com.dfsek.terra.api.util.mutable.MutableBoolean; 11 | 12 | 13 | /** 14 | * Abstract class containing basic {@link Cancellable} implementation. 15 | */ 16 | public abstract class AbstractCancellable implements Cancellable { 17 | private final MutableBoolean cancelled = new MutableBoolean(false); 18 | 19 | @Override 20 | public boolean isCancelled() { 21 | return cancelled.get(); 22 | } 23 | 24 | @Override 25 | public void setCancelled(boolean cancelled) { 26 | this.cancelled.set(cancelled); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/events/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.events; 9 | 10 | /** 11 | * An event that addons may listen to. 12 | */ 13 | public interface Event { 14 | } 15 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/events/FailThroughEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.events; 9 | 10 | /** 11 | * An event which (optionally) passes exceptions thrown by listeners to 12 | * the event caller. 13 | */ 14 | public interface FailThroughEvent extends Event { 15 | } 16 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/events/config/pack/ConfigPackPostLoadEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.events.config.pack; 9 | 10 | import com.dfsek.tectonic.api.config.template.ConfigTemplate; 11 | 12 | import com.dfsek.terra.api.config.ConfigPack; 13 | 14 | 15 | /** 16 | * Called when a config pack has finished loading. 17 | */ 18 | public class ConfigPackPostLoadEvent extends ConfigPackLoadEvent { 19 | public ConfigPackPostLoadEvent(ConfigPack pack, ExceptionalConsumer loader) { 20 | super(pack, loader); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/events/config/pack/ConfigPackPreLoadEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.events.config.pack; 9 | 10 | import com.dfsek.tectonic.api.config.template.ConfigTemplate; 11 | 12 | import com.dfsek.terra.api.config.ConfigPack; 13 | 14 | 15 | /** 16 | * Called before a config pack's registries are filled. 17 | */ 18 | public class ConfigPackPreLoadEvent extends ConfigPackLoadEvent { 19 | public ConfigPackPreLoadEvent(ConfigPack pack, ExceptionalConsumer configLoader) { 20 | super(pack, configLoader); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/events/config/type/ConfigTypePostLoadEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.events.config.type; 9 | 10 | import com.dfsek.terra.api.config.ConfigPack; 11 | import com.dfsek.terra.api.config.ConfigType; 12 | import com.dfsek.terra.api.registry.CheckedRegistry; 13 | 14 | 15 | public class ConfigTypePostLoadEvent extends ConfigTypeLoadEvent { 16 | public ConfigTypePostLoadEvent(ConfigType type, CheckedRegistry registry, ConfigPack pack) { 17 | super(type, registry, pack); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/events/config/type/ConfigTypePreLoadEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.events.config.type; 9 | 10 | import com.dfsek.terra.api.config.ConfigPack; 11 | import com.dfsek.terra.api.config.ConfigType; 12 | import com.dfsek.terra.api.registry.CheckedRegistry; 13 | 14 | 15 | public class ConfigTypePreLoadEvent extends ConfigTypeLoadEvent { 16 | public ConfigTypePreLoadEvent(ConfigType type, CheckedRegistry registry, ConfigPack pack) { 17 | super(type, registry, pack); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.event.events.platform; 2 | 3 | import com.dfsek.terra.api.command.CommandSender; 4 | import com.dfsek.terra.api.event.events.Event; 5 | 6 | import org.incendo.cloud.CommandManager; 7 | 8 | 9 | public class CommandRegistrationEvent implements Event { 10 | private final CommandManager commandManager; 11 | 12 | public CommandRegistrationEvent(CommandManager commandManager) { 13 | this.commandManager = commandManager; 14 | } 15 | 16 | public CommandManager getCommandManager() { 17 | return commandManager; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/events/platform/PlatformInitializationEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.events.platform; 9 | 10 | import com.dfsek.terra.api.event.events.Event; 11 | 12 | 13 | /** 14 | * Called when the platform is initialized. 15 | */ 16 | public class PlatformInitializationEvent implements Event { 17 | } 18 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/functional/EventContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.functional; 9 | 10 | import java.util.function.Consumer; 11 | 12 | import com.dfsek.terra.api.event.events.Event; 13 | 14 | 15 | public interface EventContext { 16 | EventContext then(Consumer action); 17 | 18 | EventContext priority(int priority); 19 | 20 | EventContext failThrough(); 21 | 22 | EventContext global(); 23 | } 24 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/event/functional/FunctionalEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.event.functional; 9 | 10 | import com.dfsek.terra.api.addon.BaseAddon; 11 | import com.dfsek.terra.api.event.EventHandler; 12 | import com.dfsek.terra.api.event.events.Event; 13 | import com.dfsek.terra.api.util.reflection.TypeKey; 14 | 15 | 16 | public interface FunctionalEventHandler extends EventHandler { 17 | EventContext register(BaseAddon addon, Class clazz); 18 | 19 | EventContext register(BaseAddon addon, TypeKey clazz); 20 | } 21 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/handle/ItemHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.handle; 9 | 10 | import java.util.Set; 11 | 12 | import com.dfsek.terra.api.inventory.Item; 13 | import com.dfsek.terra.api.inventory.item.Enchantment; 14 | 15 | 16 | public interface ItemHandle { 17 | 18 | Item createItem(String data); 19 | 20 | Enchantment getEnchantment(String id); 21 | 22 | Set getEnchantments(); 23 | } 24 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/handle/WorldHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.handle; 9 | 10 | import org.jetbrains.annotations.Contract; 11 | import org.jetbrains.annotations.NotNull; 12 | 13 | import com.dfsek.terra.api.block.state.BlockState; 14 | import com.dfsek.terra.api.entity.EntityType; 15 | 16 | 17 | /** 18 | * Interface to be implemented for world manipulation. 19 | */ 20 | public interface WorldHandle { 21 | @NotNull 22 | @Contract("_ -> new") 23 | BlockState createBlockState(@NotNull String data); 24 | 25 | @NotNull 26 | @Contract(pure = true) 27 | BlockState air(); 28 | 29 | @NotNull 30 | EntityType getEntity(@NotNull String id); 31 | } 32 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/inject/annotations/Inject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.inject.annotations; 9 | 10 | import java.lang.annotation.ElementType; 11 | import java.lang.annotation.Retention; 12 | import java.lang.annotation.RetentionPolicy; 13 | import java.lang.annotation.Target; 14 | 15 | 16 | /** 17 | * Specifies that a field is a target for dependency injection. 18 | */ 19 | @Retention(RetentionPolicy.RUNTIME) 20 | @Target(ElementType.FIELD) 21 | public @interface Inject { 22 | } 23 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/inventory/BlockInventoryHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.inventory; 9 | 10 | import com.dfsek.terra.api.util.vector.Vector3; 11 | 12 | 13 | public interface BlockInventoryHolder extends InventoryHolder { 14 | Vector3 getPosition(); 15 | } 16 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/inventory/Inventory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.inventory; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | 12 | 13 | public interface Inventory extends Handle { 14 | void setItem(int slot, ItemStack newStack); 15 | 16 | int getSize(); 17 | 18 | ItemStack getItem(int slot); 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/inventory/InventoryHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.inventory; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | 12 | 13 | public interface InventoryHolder extends Handle { 14 | Inventory getInventory(); 15 | } 16 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/inventory/Item.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.inventory; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | 12 | 13 | /** 14 | * An inventory item. 15 | */ 16 | public interface Item extends Handle { 17 | ItemStack newItemStack(int amount); 18 | 19 | double getMaxDurability(); 20 | } 21 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/inventory/ItemStack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.inventory; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | import com.dfsek.terra.api.inventory.item.Damageable; 12 | import com.dfsek.terra.api.inventory.item.ItemMeta; 13 | 14 | 15 | public interface ItemStack extends Handle { 16 | int getAmount(); 17 | 18 | void setAmount(int i); 19 | 20 | Item getType(); 21 | 22 | ItemMeta getItemMeta(); 23 | 24 | void setItemMeta(ItemMeta meta); 25 | 26 | default boolean isDamageable() { 27 | return getItemMeta() instanceof Damageable; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/inventory/item/Damageable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.inventory.item; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | 12 | 13 | public interface Damageable extends Handle { 14 | int getDamage(); 15 | 16 | void setDamage(int damage); 17 | 18 | boolean hasDamage(); 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/inventory/item/Enchantment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.inventory.item; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | import com.dfsek.terra.api.inventory.ItemStack; 12 | 13 | 14 | public interface Enchantment extends Handle { 15 | boolean canEnchantItem(ItemStack itemStack); 16 | 17 | boolean conflictsWith(Enchantment other); 18 | 19 | String getID(); 20 | 21 | int getMaxLevel(); 22 | } 23 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/inventory/item/ItemMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.inventory.item; 9 | 10 | import java.util.Map; 11 | 12 | import com.dfsek.terra.api.Handle; 13 | 14 | 15 | public interface ItemMeta extends Handle { 16 | void addEnchantment(Enchantment enchantment, int level); 17 | 18 | Map getEnchantments(); 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/properties/Properties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.properties; 9 | 10 | public interface Properties { 11 | } 12 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/properties/PropertyHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.properties; 9 | 10 | public interface PropertyHolder { 11 | Context getContext(); 12 | } 13 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/properties/PropertyKey.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.properties; 2 | 3 | public class PropertyKey { 4 | protected final int key; 5 | private final Class clazz; 6 | 7 | protected PropertyKey(int key, Class clazz) { 8 | this.key = key; 9 | this.clazz = clazz; 10 | } 11 | 12 | public Class getTypeClass() { 13 | return clazz; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/properties/annotations/Linked.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.properties.annotations; 9 | 10 | import java.lang.annotation.ElementType; 11 | import java.lang.annotation.Retention; 12 | import java.lang.annotation.RetentionPolicy; 13 | import java.lang.annotation.Target; 14 | 15 | import com.dfsek.terra.api.properties.PropertyHolder; 16 | 17 | 18 | /** 19 | * Specifies that this property holder shares properties 20 | * with the {@link #value()} holder. 21 | */ 22 | @Target(ElementType.TYPE) 23 | @Retention(RetentionPolicy.CLASS) 24 | public @interface Linked { 25 | Class value(); 26 | } 27 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/registry/exception/DuplicateEntryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.registry.exception; 9 | 10 | import java.io.Serial; 11 | 12 | 13 | /** 14 | * Thrown when a duplicate entry is found in a registry. 15 | */ 16 | public class DuplicateEntryException extends RuntimeException { 17 | @Serial 18 | private static final long serialVersionUID = -7199021672428288780L; 19 | 20 | public DuplicateEntryException(String message) { 21 | super(message); 22 | } 23 | 24 | public DuplicateEntryException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/registry/exception/NoSuchEntryException.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.registry.exception; 2 | 3 | public class NoSuchEntryException extends RuntimeException { 4 | public NoSuchEntryException(String message) { 5 | super(message); 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/registry/key/Keyed.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.registry.key; 2 | 3 | @SuppressWarnings("unused") 4 | public interface Keyed> extends Namespaced, StringIdentifiable { 5 | RegistryKey getRegistryKey(); 6 | 7 | @Override 8 | default String getNamespace() { 9 | return getRegistryKey().getNamespace(); 10 | } 11 | 12 | @Override 13 | default String getID() { 14 | return getRegistryKey().getID(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/registry/key/Namespaced.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.registry.key; 2 | 3 | public interface Namespaced { 4 | String getNamespace(); 5 | 6 | default RegistryKey key(String id) { 7 | return RegistryKey.of(getNamespace(), id); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/registry/key/StringIdentifiable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.registry.key; 9 | 10 | public interface StringIdentifiable { 11 | String getID(); 12 | } 13 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/registry/meta/CheckedRegistryHolder.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.registry.meta; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import com.dfsek.terra.api.registry.CheckedRegistry; 6 | import com.dfsek.terra.api.util.reflection.TypeKey; 7 | 8 | 9 | public interface CheckedRegistryHolder extends RegistryHolder { 10 | default CheckedRegistry getCheckedRegistry(Class clazz) throws IllegalStateException { 11 | return getCheckedRegistry((Type) clazz); 12 | } 13 | 14 | default CheckedRegistry getCheckedRegistry(TypeKey type) throws IllegalStateException { 15 | return getCheckedRegistry(type.getType()); 16 | } 17 | 18 | CheckedRegistry getCheckedRegistry(Type type); 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/registry/meta/RegistryHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.registry.meta; 9 | 10 | import java.lang.reflect.Type; 11 | 12 | import com.dfsek.terra.api.registry.Registry; 13 | import com.dfsek.terra.api.util.reflection.TypeKey; 14 | 15 | 16 | public interface RegistryHolder { 17 | default Registry getRegistry(Class clazz) { 18 | return getRegistry((Type) clazz); 19 | } 20 | 21 | default Registry getRegistry(TypeKey type) { 22 | return getRegistry(type.getType()); 23 | } 24 | 25 | Registry getRegistry(Type type); 26 | } 27 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/registry/meta/RegistryProvider.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.registry.meta; 2 | 3 | import com.dfsek.terra.api.registry.CheckedRegistry; 4 | import com.dfsek.terra.api.util.reflection.TypeKey; 5 | 6 | 7 | public interface RegistryProvider { 8 | default CheckedRegistry getOrCreateRegistry(Class clazz) { 9 | return getOrCreateRegistry(TypeKey.of(clazz)); 10 | } 11 | 12 | CheckedRegistry getOrCreateRegistry(TypeKey type); 13 | } 14 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/structure/Structure.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.structure; 9 | 10 | import java.util.Random; 11 | 12 | import com.dfsek.terra.api.util.Rotation; 13 | import com.dfsek.terra.api.util.vector.Vector3Int; 14 | import com.dfsek.terra.api.world.WritableWorld; 15 | 16 | 17 | public interface Structure { 18 | boolean generate(Vector3Int location, WritableWorld world, Random random, Rotation rotation); 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/structure/StructureSpawn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.structure; 9 | 10 | import org.jetbrains.annotations.ApiStatus.Experimental; 11 | 12 | import com.dfsek.terra.api.util.vector.Vector3; 13 | 14 | 15 | @Experimental 16 | public interface StructureSpawn { 17 | /** 18 | * Get nearest spawn point 19 | * 20 | * @param x X coordinate 21 | * @param z Z coordinate 22 | * @param seed Seed for RNG 23 | * 24 | * @return Vector representing nearest spawnpoint 25 | */ 26 | Vector3 getNearestSpawn(int x, int z, long seed); 27 | } 28 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/structure/feature/Feature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.structure.feature; 9 | 10 | import com.dfsek.terra.api.registry.key.StringIdentifiable; 11 | import com.dfsek.terra.api.structure.Structure; 12 | import com.dfsek.terra.api.world.WritableWorld; 13 | 14 | 15 | public interface Feature extends StringIdentifiable { 16 | Structure getStructure(WritableWorld world, int x, int y, int z); 17 | 18 | Distributor getDistributor(); 19 | 20 | Locator getLocator(); 21 | } 22 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/tectonic/LoaderRegistrar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.tectonic; 9 | 10 | import com.dfsek.tectonic.api.TypeRegistry; 11 | 12 | 13 | public interface LoaderRegistrar { 14 | void register(TypeRegistry registry); 15 | } 16 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/tectonic/ShortcutLoader.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.tectonic; 2 | 3 | import com.dfsek.tectonic.api.depth.DepthTracker; 4 | import com.dfsek.tectonic.api.loader.ConfigLoader; 5 | 6 | 7 | public interface ShortcutLoader { 8 | T load(ConfigLoader configLoader, String input, DepthTracker tracker); 9 | } 10 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/transform/Transform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.transform; 9 | 10 | import com.dfsek.terra.api.transform.exception.TransformException; 11 | 12 | 13 | /** 14 | * Interface to transform data from one type to another. 15 | */ 16 | @FunctionalInterface 17 | public interface Transform { 18 | T transform(F input) throws TransformException; 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/transform/Transformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.transform; 9 | 10 | public interface Transformer { 11 | /** 12 | * Translate data from {@code from} type to {@code to} type. 13 | * 14 | * @param from Data to translate 15 | * 16 | * @return Result 17 | */ 18 | T translate(F from); 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/transform/Validator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.transform; 9 | 10 | 11 | import java.util.Objects; 12 | 13 | import com.dfsek.terra.api.transform.exception.TransformException; 14 | 15 | 16 | public interface Validator { 17 | static Validator notNull() { 18 | return Objects::nonNull; 19 | } 20 | 21 | boolean validate(T value) throws TransformException; 22 | } 23 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/util/StringUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.util; 9 | 10 | import java.io.File; 11 | 12 | 13 | public class StringUtil { 14 | public static String fileName(String path) { 15 | if(path.contains(File.separator)) { 16 | return path.substring(path.lastIndexOf(File.separatorChar) + 1, path.lastIndexOf('.')); 17 | } else if(path.contains("/")) { 18 | return path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf('.')); 19 | } else if(path.contains(".")) { 20 | return path.substring(0, path.lastIndexOf('.')); 21 | } else { 22 | return path; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/util/cache/CacheUtils.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.util.cache; 2 | 3 | import java.util.concurrent.Executor; 4 | import java.util.concurrent.Executors; 5 | 6 | 7 | public class CacheUtils { 8 | public static final Executor CACHE_EXECUTOR = Executors.newSingleThreadExecutor(); 9 | } 10 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/util/function/IntIntObjConsumer.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.util.function; 2 | 3 | @FunctionalInterface 4 | public interface IntIntObjConsumer { 5 | void accept(int i, int j, T obj); 6 | } 7 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/util/function/IntObjConsumer.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.util.function; 2 | 3 | @FunctionalInterface 4 | public interface IntObjConsumer { 5 | void accept(int i, T obj); 6 | } 7 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/util/function/IntToBooleanFunction.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.util.function; 2 | 3 | @FunctionalInterface 4 | public interface IntToBooleanFunction { 5 | boolean apply(int value); 6 | } 7 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/util/generic/Construct.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.util.generic; 9 | 10 | import java.util.function.Supplier; 11 | 12 | 13 | public final class Construct { 14 | public static T construct(Supplier in) { 15 | return in.get(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/util/mutable/MutablePrimitive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.util.mutable; 9 | 10 | public interface MutablePrimitive extends Comparable { 11 | T get(); 12 | 13 | void set(T value); 14 | } 15 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/util/mutable/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | /** 9 | * Mutable objects containing primitive types. 10 | */ 11 | 12 | package com.dfsek.terra.api.util.mutable; -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/ServerWorld.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world; 9 | 10 | import com.dfsek.terra.api.util.vector.Vector3; 11 | import com.dfsek.terra.api.world.chunk.Chunk; 12 | 13 | 14 | public interface ServerWorld extends WritableWorld { 15 | Chunk getChunkAt(int x, int z); 16 | 17 | default Chunk getChunkAt(Vector3 location) { 18 | return getChunkAt(location.getBlockX() >> 4, location.getBlockZ() >> 4); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/biome/PaletteSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.biome; 9 | 10 | import com.dfsek.terra.api.world.chunk.generation.util.Palette; 11 | 12 | 13 | public interface PaletteSettings { 14 | Palette getPalette(int y); 15 | } 16 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/biome/PlatformBiome.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.biome; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | 12 | 13 | public interface PlatformBiome extends Handle { 14 | } 15 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/chunk/Chunk.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.chunk; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | import com.dfsek.terra.api.block.state.BlockState; 13 | import com.dfsek.terra.api.world.ServerWorld; 14 | 15 | 16 | public interface Chunk extends ChunkAccess { 17 | void setBlock(int x, int y, int z, BlockState data, boolean physics); 18 | 19 | default void setBlock(int x, int y, int z, @NotNull BlockState data) { 20 | setBlock(x, y, z, data, false); 21 | } 22 | 23 | @NotNull BlockState getBlock(int x, int y, int z); 24 | 25 | int getX(); 26 | 27 | int getZ(); 28 | 29 | ServerWorld getWorld(); 30 | } 31 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/chunk/generation/ProtoChunk.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.chunk.generation; 9 | 10 | 11 | import com.dfsek.terra.api.world.chunk.ChunkAccess; 12 | 13 | 14 | public interface ProtoChunk extends ChunkAccess { 15 | /** 16 | * Get the maximum height for the chunk. 17 | *

18 | * Setting blocks at or above this height will do nothing. 19 | * 20 | * @return the maximum height 21 | */ 22 | int getMaxHeight(); 23 | } 24 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/chunk/generation/ProtoWorld.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.world.chunk.generation; 2 | 3 | import com.dfsek.terra.api.world.ServerWorld; 4 | import com.dfsek.terra.api.world.WritableWorld; 5 | 6 | 7 | public interface ProtoWorld extends WritableWorld { 8 | int centerChunkX(); 9 | 10 | int centerChunkZ(); 11 | 12 | /** 13 | * Get the world object this ProtoWorld represents 14 | * 15 | * Do not read from/write to this world! 16 | * 17 | * @return The world 18 | */ 19 | ServerWorld getWorld(); 20 | } 21 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/chunk/generation/stage/Chunkified.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.chunk.generation.stage; 9 | 10 | /** 11 | * Marker interface that marks a feature as "chunkified" (only modifying one chunk at a time) 12 | */ 13 | public interface Chunkified { 14 | } 15 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/chunk/generation/stage/GenerationStage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.chunk.generation.stage; 9 | 10 | import com.dfsek.terra.api.world.chunk.generation.ProtoWorld; 11 | 12 | 13 | public interface GenerationStage { 14 | void populate(ProtoWorld world); 15 | } 16 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/chunk/generation/util/GeneratorWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.chunk.generation.util; 9 | 10 | import com.dfsek.terra.api.Handle; 11 | import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator; 12 | 13 | 14 | public interface GeneratorWrapper extends Handle { 15 | @Override 16 | ChunkGenerator getHandle(); 17 | } 18 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/chunk/generation/util/Palette.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.chunk.generation.util; 9 | 10 | import com.dfsek.terra.api.block.state.BlockState; 11 | 12 | 13 | public interface Palette { 14 | /** 15 | * Fetches a material from the palette, at a given layer. 16 | * 17 | * @param layer - The layer at which to fetch the material. 18 | * 19 | * @return BlockData - The material fetched. 20 | */ 21 | BlockState get(int layer, double x, double y, double z, long seed); 22 | } 23 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/chunk/generation/util/provider/ChunkGeneratorProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.chunk.generation.util.provider; 9 | 10 | import com.dfsek.terra.api.config.ConfigPack; 11 | import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator; 12 | 13 | 14 | public interface ChunkGeneratorProvider { 15 | ChunkGenerator newInstance(ConfigPack pack); 16 | } 17 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/chunk/generation/util/provider/GenerationStageProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2025 Polyhedral Development 3 | * 4 | * The Terra API is licensed under the terms of the MIT License. For more details, 5 | * reference the LICENSE file in the common/api directory. 6 | */ 7 | 8 | package com.dfsek.terra.api.world.chunk.generation.util.provider; 9 | 10 | import com.dfsek.terra.api.config.ConfigPack; 11 | import com.dfsek.terra.api.world.chunk.generation.stage.GenerationStage; 12 | 13 | 14 | public interface GenerationStageProvider { 15 | GenerationStage newInstance(ConfigPack pack); 16 | } 17 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/info/WorldProperties.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.world.info; 2 | 3 | import com.dfsek.terra.api.Handle; 4 | 5 | 6 | public interface WorldProperties extends Handle { 7 | long getSeed(); 8 | 9 | int getMaxHeight(); 10 | 11 | int getMinHeight(); 12 | } 13 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/util/Interceptors.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.world.util; 2 | 3 | public final class Interceptors { 4 | private static final ReadInterceptor READ_THROUGH = ((x, y, z, world) -> world.getBlockState(x, y, z)); 5 | private static final WriteInterceptor WRITE_THROUGH = ((x, y, z, block, world, physics) -> world.setBlockState(x, y, z, block, 6 | physics)); 7 | 8 | private Interceptors() { 9 | 10 | } 11 | 12 | public static ReadInterceptor readThrough() { 13 | return READ_THROUGH; 14 | } 15 | 16 | public static WriteInterceptor writeThrough() { 17 | return WRITE_THROUGH; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/util/ReadInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.world.util; 2 | 3 | import com.dfsek.terra.api.block.state.BlockState; 4 | import com.dfsek.terra.api.world.ReadableWorld; 5 | 6 | 7 | public interface ReadInterceptor { 8 | BlockState read(int x, int y, int z, ReadableWorld world); 9 | } 10 | -------------------------------------------------------------------------------- /common/api/src/main/java/com/dfsek/terra/api/world/util/WriteInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.api.world.util; 2 | 3 | import com.dfsek.terra.api.block.state.BlockState; 4 | import com.dfsek.terra.api.world.WritableWorld; 5 | 6 | 7 | public interface WriteInterceptor { 8 | default void write(int x, int y, int z, BlockState block, WritableWorld world) { 9 | write(x, y, z, block, world, false); 10 | } 11 | 12 | void write(int x, int y, int z, BlockState block, WritableWorld world, boolean physics); 13 | } 14 | -------------------------------------------------------------------------------- /common/implementation/base/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api(project(":common:api")) 3 | api(project(":common:implementation:bootstrap-addon-loader")) 4 | 5 | testImplementation("org.slf4j", "slf4j-api", Versions.Libraries.slf4j) 6 | 7 | implementation("commons-io", "commons-io", Versions.Libraries.Internal.apacheIO) 8 | 9 | implementation("org.apache.commons", "commons-text", Versions.Libraries.Internal.apacheText) 10 | implementation("com.dfsek.tectonic", "yaml", Versions.Libraries.tectonic) 11 | 12 | 13 | 14 | implementation("com.dfsek", "paralithic", Versions.Libraries.paralithic) 15 | } 16 | -------------------------------------------------------------------------------- /common/implementation/base/src/main/java/com/dfsek/terra/addon/EphemeralAddon.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.addon; 2 | 3 | import ca.solostudios.strata.version.Version; 4 | 5 | import com.dfsek.terra.api.addon.BaseAddon; 6 | 7 | 8 | public class EphemeralAddon implements BaseAddon { 9 | private final Version version; 10 | private final String id; 11 | 12 | public EphemeralAddon(Version version, String id) { 13 | this.version = version; 14 | this.id = id; 15 | } 16 | 17 | @Override 18 | public Version getVersion() { 19 | return version; 20 | } 21 | 22 | @Override 23 | public String getID() { 24 | return id; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /common/implementation/base/src/main/java/com/dfsek/terra/config/loaders/ExpressionParserOptionsTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.config.loaders; 2 | 3 | import com.dfsek.paralithic.eval.parser.Parser.ParseOptions; 4 | import com.dfsek.tectonic.api.config.template.annotations.Default; 5 | import com.dfsek.tectonic.api.config.template.annotations.Value; 6 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 7 | 8 | 9 | public class ExpressionParserOptionsTemplate implements ObjectTemplate { 10 | 11 | private static final ParseOptions DEFAULT_PARSE_OPTIONS = new ParseOptions(); 12 | 13 | @Value("use-let-expressions") 14 | @Default 15 | private boolean useLetExpressions = DEFAULT_PARSE_OPTIONS.useLetExpressions(); 16 | 17 | @Override 18 | public ParseOptions get() { 19 | return new ParseOptions(useLetExpressions); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/implementation/base/src/main/java/com/dfsek/terra/config/pack/ConfigPackExpressionOptionsTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.config.pack; 2 | 3 | import com.dfsek.paralithic.eval.parser.Parser.ParseOptions; 4 | import com.dfsek.tectonic.api.config.template.ConfigTemplate; 5 | import com.dfsek.tectonic.api.config.template.annotations.Default; 6 | import com.dfsek.tectonic.api.config.template.annotations.Value; 7 | 8 | 9 | public class ConfigPackExpressionOptionsTemplate implements ConfigTemplate { 10 | @Value("expressions.options") 11 | @Default 12 | private ParseOptions parseOptions = new ParseOptions(); 13 | 14 | public ParseOptions getParseOptions() { 15 | return parseOptions; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/implementation/base/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | # This file contains core configuration options for Terra 2 | # 3 | # As you can see, there is not that much to configure here. 4 | # For advanced configuration, use config packs. Config 5 | # packs are loaded from the packs directory. Check the 6 | # wiki for information regarding config pack development. 7 | 8 | debug: 9 | commands: false 10 | log: false 11 | profiler: false 12 | script: false 13 | dump-default: true 14 | biome-search-resolution: 4 15 | cache: 16 | structure: 32 17 | sampler: 128 18 | biome-provider: 32 19 | script: 20 | max-recursion: 1000 -------------------------------------------------------------------------------- /common/implementation/base/src/test/resources/config.yml: -------------------------------------------------------------------------------- 1 | dimensions: 2 2 | type: Cellular 3 | frequency: 0.01 4 | cellular: 5 | return: Distance3Div 6 | normalize: 7 | type: LINEAR 8 | linear: 9 | min: -1 10 | max: 0 -------------------------------------------------------------------------------- /common/implementation/base/src/test/resources/map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PolyhedralDev/Terra/d90a4200fef34e58c85db81971be537110ea58da/common/implementation/base/src/test/resources/map.jpg -------------------------------------------------------------------------------- /common/implementation/base/src/test/resources/meta.yml: -------------------------------------------------------------------------------- 1 | list: 2 | - ONE 3 | - "<< metaTarget.yml:list" 4 | - FOUR 5 | - FIVE 6 | - SIX 7 | - "<< metaTarget.yml:list2" 8 | - NINE 9 | - TEN 10 | map: 11 | "<<": 12 | - metaTarget.yml:map1 13 | - metaTarget.yml:map2 14 | one: ONE 15 | two: TWO 16 | string: "one-${metaTarget.yml:string.two}-${metaTarget.yml:string.three}-four-five-${metaTarget.yml:string.six}" 17 | int: 2 + 4 18 | double: ${metaTarget.yml:double} + 5.6 -------------------------------------------------------------------------------- /common/implementation/base/src/test/resources/metaTarget.yml: -------------------------------------------------------------------------------- 1 | list: 2 | - TWO 3 | - THREE 4 | list2: 5 | - SEVEN 6 | - EIGHT 7 | map1: 8 | three: THREE 9 | four: FOUR 10 | five: FIVE 11 | map2: 12 | six: SIX 13 | string: 14 | two: two 15 | three: three 16 | six: six 17 | double: 1 -------------------------------------------------------------------------------- /common/implementation/bootstrap-addon-loader/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compileOnlyApi(project(":common:api")) 3 | } 4 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project information 2 | terra.description=A modern voxel world generation modding platform 3 | terra.source=https://github.com/PolyhedralDev/Terra 4 | terra.issues=https://github.com/PolyhedralDev/Terra/issues 5 | terra.wiki=https://github.com/PolyhedralDev/Terra/wiki 6 | terra.license=MIT 7 | # Gradle options 8 | org.gradle.jvmargs=-Xmx4096M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 9 | org.gradle.warning.mode=all 10 | 11 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PolyhedralDev/Terra/d90a4200fef34e58c85db81971be537110ea58da/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=845952a9d6afa783db70bb3b0effaae45ae5542ca2bb7929619e8af49cb634cf 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip 5 | networkTimeout=10000 6 | validateDistributionUrl=true 7 | zipStoreBase=GRADLE_USER_HOME 8 | zipStorePath=wrapper/dists 9 | -------------------------------------------------------------------------------- /platforms/allay/README.md: -------------------------------------------------------------------------------- 1 | # Allay platform 2 | 3 | ## Resource files 4 | 5 | Current mapping version: je 1.21.4 to be 1.21.50 6 | 7 | - `mapping/biomes.json` and `mapping/items.json` obtain from [GeyserMC/mappings](https://github.com/GeyserMC/mappings). 8 | - `mapping/blocks.json` generated by using [GeyserMC/mappings-generator](https://github.com/GeyserMC/mappings-generator), and it's origin name is `generator_blocks.json`. 9 | - `je_block_default_states.json` converted from [Block state values](https://zh.minecraft.wiki/w/Module:Block_state_values). 10 | -------------------------------------------------------------------------------- /platforms/allay/src/main/java/com/dfsek/terra/allay/delegate/AllayBiome.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.allay.delegate; 2 | 3 | import org.allaymc.api.world.biome.BiomeType; 4 | 5 | import com.dfsek.terra.api.world.biome.PlatformBiome; 6 | 7 | /** 8 | * @author daoge_cmd 9 | */ 10 | public record AllayBiome(BiomeType allayBiome) implements PlatformBiome { 11 | @Override 12 | public BiomeType getHandle() { 13 | return allayBiome; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /platforms/allay/src/main/resources/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "entrance": "com.dfsek.terra.allay.TerraAllayPlugin", 3 | "name": "Terra", 4 | "authors": [ 5 | "daoge_cmd", 6 | "IWareQ", 7 | "dfsek", 8 | "duplexsystem", 9 | "Astrash", 10 | "solonovamax", 11 | "Sancires", 12 | "Aureus", 13 | "RogueShade" 14 | ], 15 | "version": "@VERSION@", 16 | "description": "@DESCRIPTION@", 17 | "website": "@WIKI@" 18 | } -------------------------------------------------------------------------------- /platforms/bukkit/common/build.gradle.kts: -------------------------------------------------------------------------------- 1 | repositories { 2 | 3 | } 4 | 5 | dependencies { 6 | shadedApi(project(":common:implementation:base")) 7 | 8 | compileOnly("io.papermc.paper", "paper-api", Versions.Bukkit.paper) 9 | 10 | shadedApi("io.papermc", "paperlib", Versions.Bukkit.paperLib) 11 | 12 | shadedApi("com.google.guava", "guava", Versions.Libraries.Internal.guava) 13 | 14 | shadedApi("org.incendo", "cloud-paper", Versions.Bukkit.cloud) 15 | } 16 | -------------------------------------------------------------------------------- /platforms/bukkit/common/src/main/resources/plugin.yml: -------------------------------------------------------------------------------- 1 | name: "Terra" 2 | main: "com.dfsek.terra.bukkit.TerraBukkitPlugin" 3 | version: "@VERSION@" 4 | load: "STARTUP" 5 | authors: [ "dfsek", "duplexsystem", "Astrash", "solonovamax", "Sancires", "Aureus", "RogueShade", "OakLoaf" ] 6 | website: "@WIKI@" 7 | api-version: "1.21.1" 8 | description: "@DESCRIPTION@" 9 | folia-supported: true 10 | -------------------------------------------------------------------------------- /platforms/bukkit/nms/v1_21_5/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("io.papermc.paperweight.userdev") 3 | } 4 | 5 | dependencies { 6 | api(project(":platforms:bukkit:common")) 7 | paperweight.paperDevBundle(Versions.Bukkit.paperDevBundle) 8 | implementation("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) 9 | } 10 | 11 | tasks { 12 | assemble { 13 | dependsOn("reobfJar") 14 | } 15 | } -------------------------------------------------------------------------------- /platforms/bukkit/nms/v1_21_5/src/main/java/com/dfsek/terra/bukkit/nms/v1_21_5/NMSBiomeInfo.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.bukkit.nms.v1_21_5; 2 | 3 | import net.minecraft.resources.ResourceKey; 4 | import net.minecraft.world.level.biome.Biome; 5 | 6 | import com.dfsek.terra.api.properties.Properties; 7 | 8 | 9 | public record NMSBiomeInfo(ResourceKey biomeKey) implements Properties { 10 | } 11 | -------------------------------------------------------------------------------- /platforms/bukkit/nms/v1_21_5/src/main/java/com/dfsek/terra/bukkit/nms/v1_21_5/NMSInitializer.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.bukkit.nms.v1_21_5; 2 | 3 | import com.dfsek.terra.bukkit.BukkitAddon; 4 | 5 | import org.bukkit.Bukkit; 6 | 7 | import com.dfsek.terra.bukkit.PlatformImpl; 8 | import com.dfsek.terra.bukkit.nms.Initializer; 9 | 10 | 11 | public class NMSInitializer implements Initializer { 12 | @Override 13 | public void initialize(PlatformImpl platform) { 14 | AwfulBukkitHacks.registerBiomes(platform.getRawConfigRegistry()); 15 | Bukkit.getPluginManager().registerEvents(new NMSInjectListener(), platform.getPlugin()); 16 | } 17 | 18 | @Override 19 | public BukkitAddon getNMSAddon(PlatformImpl plugin) { 20 | return new NMSAddon(plugin); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /platforms/bukkit/nms/v1_21_5/src/main/java/com/dfsek/terra/bukkit/nms/v1_21_5/config/EntityTypeTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.bukkit.nms.v1_21_5.config; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Default; 4 | import com.dfsek.tectonic.api.config.template.annotations.Value; 5 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 6 | import net.minecraft.core.registries.BuiltInRegistries; 7 | import net.minecraft.resources.ResourceLocation; 8 | import net.minecraft.world.entity.EntityType; 9 | 10 | 11 | public class EntityTypeTemplate implements ObjectTemplate> { 12 | @Value("id") 13 | @Default 14 | private ResourceLocation id = null; 15 | 16 | @Override 17 | public EntityType get() { 18 | return BuiltInRegistries.ENTITY_TYPE.get(id).orElseThrow().value(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /platforms/bukkit/nms/v1_21_5/src/main/java/com/dfsek/terra/bukkit/nms/v1_21_5/config/VillagerTypeTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.bukkit.nms.v1_21_5.config; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Default; 4 | import com.dfsek.tectonic.api.config.template.annotations.Value; 5 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 6 | import net.minecraft.core.registries.BuiltInRegistries; 7 | import net.minecraft.resources.ResourceLocation; 8 | import net.minecraft.world.entity.npc.VillagerType; 9 | 10 | 11 | public class VillagerTypeTemplate implements ObjectTemplate { 12 | @Value("id") 13 | @Default 14 | private ResourceLocation id = null; 15 | 16 | @Override 17 | public VillagerType get() { 18 | return BuiltInRegistries.VILLAGER_TYPE.get(id).orElseThrow().value(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /platforms/cli/src/main/java/com/dfsek/terra/cli/NBTSerializable.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.cli; 2 | 3 | public interface NBTSerializable { 4 | T serialize(); 5 | } 6 | -------------------------------------------------------------------------------- /platforms/cli/src/main/java/com/dfsek/terra/cli/handle/CLIItemHandle.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.cli.handle; 2 | 3 | import java.util.Set; 4 | 5 | import com.dfsek.terra.api.handle.ItemHandle; 6 | import com.dfsek.terra.api.inventory.Item; 7 | import com.dfsek.terra.api.inventory.item.Enchantment; 8 | 9 | 10 | public class CLIItemHandle implements ItemHandle { 11 | @Override 12 | public Item createItem(String data) { 13 | return null; 14 | } 15 | 16 | @Override 17 | public Enchantment getEnchantment(String id) { 18 | return null; 19 | } 20 | 21 | @Override 22 | public Set getEnchantments() { 23 | return null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /platforms/fabric/gradle.properties: -------------------------------------------------------------------------------- 1 | loom.platform=fabric -------------------------------------------------------------------------------- /platforms/fabric/src/main/java/com/dfsek/terra/fabric/FabricAddon.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.fabric; 2 | 3 | import com.dfsek.terra.mod.MinecraftAddon; 4 | import com.dfsek.terra.mod.ModPlatform; 5 | 6 | 7 | public class FabricAddon extends MinecraftAddon { 8 | 9 | public FabricAddon(ModPlatform modPlatform) { 10 | super(modPlatform); 11 | } 12 | 13 | @Override 14 | public String getID() { 15 | return "terra-fabric"; 16 | } 17 | } -------------------------------------------------------------------------------- /platforms/fabric/src/main/resources/assets/terra/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PolyhedralDev/Terra/d90a4200fef34e58c85db81971be537110ea58da/platforms/fabric/src/main/resources/assets/terra/icon.png -------------------------------------------------------------------------------- /platforms/fabric/src/main/resources/assets/terra/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator.terra": "Terra" 3 | } 4 | 5 | -------------------------------------------------------------------------------- /platforms/fabric/src/main/resources/terra.fabric.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "com.dfsek.terra.fabric.mixin", 5 | "compatibilityLevel": "JAVA_21", 6 | "mixins": [ 7 | ], 8 | "client": [ 9 | ], 10 | "server": [ 11 | ], 12 | "injectors": { 13 | "defaultRequire": 1 14 | } 15 | } -------------------------------------------------------------------------------- /platforms/forge/gradle.properties: -------------------------------------------------------------------------------- 1 | loom.platform=forge 2 | -------------------------------------------------------------------------------- /platforms/forge/src/main/java/com/dfsek/terra/forge/ForgeAddon.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.forge; 2 | 3 | import com.dfsek.terra.mod.MinecraftAddon; 4 | import com.dfsek.terra.mod.ModPlatform; 5 | 6 | 7 | public class ForgeAddon extends MinecraftAddon { 8 | 9 | public ForgeAddon(ModPlatform modPlatform) { 10 | super(modPlatform); 11 | } 12 | 13 | @Override 14 | public String getID() { 15 | return "terra-forge"; 16 | } 17 | } -------------------------------------------------------------------------------- /platforms/forge/src/main/resources/META-INF/mods.toml: -------------------------------------------------------------------------------- 1 | modLoader = "javafml" 2 | loaderVersion = "[41,)" 3 | license = "GNU General Public License, v3.0" 4 | issueTrackerURL = "https://github.com/PolyhedralDev/Terra/issues" 5 | 6 | [[mods]] 7 | modId = "terra" 8 | version = "@VERSION@" 9 | displayName = "Terra" 10 | description = "@DESCRIPTION@" 11 | 12 | [[dependencies.terra]] 13 | modId = "forge" 14 | mandatory = true 15 | versionRange = "[41,)" 16 | ordering = "NONE" 17 | side = "BOTH" 18 | 19 | [[dependencies.terra]] 20 | modId = "minecraft" 21 | mandatory = true 22 | versionRange = "[1.19,)" 23 | ordering = "NONE" 24 | side = "BOTH" -------------------------------------------------------------------------------- /platforms/forge/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "Terra Resources", 4 | "pack_format": 9 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /platforms/forge/src/main/resources/terra.forge.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "com.dfsek.terra.forge.mixin", 5 | "compatibilityLevel": "JAVA_21", 6 | "mixins": [ 7 | "lifecycle.NoiseConfigMixin" 8 | ], 9 | "client": [ 10 | ], 11 | "server": [ 12 | ], 13 | "injectors": { 14 | "defaultRequire": 1 15 | } 16 | } -------------------------------------------------------------------------------- /platforms/minestom/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | shadedApi(project(":common:implementation:base")) 3 | shadedApi("com.github.ben-manes.caffeine", "caffeine", Versions.Libraries.caffeine) 4 | shadedImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava) 5 | 6 | compileOnly("net.minestom", "minestom-snapshots", Versions.Minestom.minestom) 7 | } 8 | 9 | tasks.named("jar") { 10 | finalizedBy("installAddonsIntoDefaultJar") 11 | } 12 | -------------------------------------------------------------------------------- /platforms/minestom/example/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | application 3 | } 4 | 5 | val javaMainClass = "com.dfsek.terra.minestom.TerraMinestomExample" 6 | 7 | dependencies { 8 | shadedApi(project(":platforms:minestom")) 9 | 10 | implementation("net.minestom", "minestom-snapshots", Versions.Minestom.minestom) 11 | implementation("org.slf4j", "slf4j-simple", Versions.Libraries.slf4j) 12 | } 13 | 14 | tasks.withType { 15 | entryCompression = ZipEntryCompression.STORED 16 | manifest { 17 | attributes( 18 | "Main-Class" to javaMainClass, 19 | ) 20 | } 21 | } 22 | 23 | application { 24 | mainClass.set(javaMainClass) 25 | } 26 | 27 | tasks.getByName("run").setProperty("workingDir", file("./run")) 28 | addonDir(project.file("./run/terra/addons"), tasks.named("run").get()) 29 | -------------------------------------------------------------------------------- /platforms/minestom/src/main/java/com/dfsek/terra/minestom/MinestomAdapter.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.minestom; 2 | 3 | import com.dfsek.terra.api.util.vector.Vector3; 4 | 5 | import net.minestom.server.coordinate.Point; 6 | import net.minestom.server.coordinate.Pos; 7 | 8 | 9 | public class MinestomAdapter { 10 | public static Vector3 adapt(Point point) { 11 | return Vector3.of(point.x(), point.y(), point.z()); 12 | } 13 | 14 | public static Pos adapt(Vector3 vector) { 15 | return new Pos(vector.getX(), vector.getY(), vector.getZ()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /platforms/minestom/src/main/java/com/dfsek/terra/minestom/api/BlockEntityFactory.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.minestom.api; 2 | 3 | import com.dfsek.terra.api.block.entity.BlockEntity; 4 | 5 | import net.minestom.server.coordinate.BlockVec; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | 9 | /** 10 | * Represents a factory interface for creating instances of BlockEntity 11 | * at a specified BlockVec position. This is not implemented directly because 12 | * Minestom does not define a way to build block entities out of the box. 13 | */ 14 | public interface BlockEntityFactory { 15 | @Nullable BlockEntity createBlockEntity(BlockVec position); 16 | } 17 | -------------------------------------------------------------------------------- /platforms/minestom/src/main/java/com/dfsek/terra/minestom/api/EntityFactory.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.minestom.api; 2 | 3 | 4 | import net.minestom.server.entity.Entity; 5 | import net.minestom.server.entity.EntityType; 6 | 7 | 8 | /** 9 | * Allows adding AI to generated entities using custom entity types 10 | */ 11 | public interface EntityFactory { 12 | Entity createEntity(EntityType type); 13 | } 14 | -------------------------------------------------------------------------------- /platforms/minestom/src/main/java/com/dfsek/terra/minestom/biome/MinestomBiome.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.minestom.biome; 2 | 3 | import com.dfsek.terra.api.world.biome.PlatformBiome; 4 | 5 | import net.minestom.server.world.biome.Biome; 6 | 7 | 8 | public class MinestomBiome implements PlatformBiome { 9 | private final Biome biome; 10 | 11 | public MinestomBiome(Biome biome) { this.biome = biome; } 12 | 13 | @Override 14 | public Biome getHandle() { 15 | return biome; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /platforms/minestom/src/main/java/com/dfsek/terra/minestom/block/DefaultBlockEntityFactory.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.minestom.block; 2 | 3 | import com.dfsek.terra.api.block.entity.BlockEntity; 4 | import com.dfsek.terra.minestom.api.BlockEntityFactory; 5 | 6 | import net.minestom.server.coordinate.BlockVec; 7 | 8 | 9 | public class DefaultBlockEntityFactory implements BlockEntityFactory { 10 | @Override 11 | public BlockEntity createBlockEntity(BlockVec position) { 12 | return null; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /platforms/minestom/src/main/java/com/dfsek/terra/minestom/entity/DefaultEntityFactory.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.minestom.entity; 2 | 3 | import com.dfsek.terra.minestom.api.EntityFactory; 4 | 5 | import net.minestom.server.entity.Entity; 6 | import net.minestom.server.entity.EntityType; 7 | 8 | 9 | public class DefaultEntityFactory implements EntityFactory { 10 | @Override 11 | public Entity createEntity(EntityType type) { 12 | return new Entity(type); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /platforms/minestom/src/main/java/com/dfsek/terra/minestom/entity/MinestomEntityType.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.minestom.entity; 2 | 3 | 4 | import net.minestom.server.entity.EntityType; 5 | 6 | 7 | public class MinestomEntityType implements com.dfsek.terra.api.entity.EntityType { 8 | private final EntityType delegate; 9 | 10 | public MinestomEntityType(String id) { 11 | delegate = EntityType.fromNamespaceId(id); 12 | } 13 | 14 | @Override 15 | public EntityType getHandle() { 16 | return delegate; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /platforms/mixin-common/README.md: -------------------------------------------------------------------------------- 1 | # mixin-common 2 | 3 | This project contains mixins shared between Forge, Fabric, and formerly Quilt, as 4 | well as glue code. -------------------------------------------------------------------------------- /platforms/mixin-common/src/main/java/com/dfsek/terra/mod/CommonPlatform.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.mod; 2 | 3 | import java.util.concurrent.atomic.AtomicReference; 4 | 5 | 6 | public final class CommonPlatform { 7 | private static final AtomicReference platform = new AtomicReference<>(); 8 | 9 | public static ModPlatform get() { 10 | ModPlatform modPlatform = platform.get(); 11 | 12 | if(modPlatform == null) { 13 | throw new IllegalStateException("Platform is not yet initialised!"); 14 | } 15 | 16 | return modPlatform; 17 | } 18 | 19 | public static void initialize(ModPlatform modPlatform) { 20 | if(!platform.compareAndSet(null, modPlatform)) { 21 | throw new IllegalStateException("Platform has already been initialized to " + platform.get()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/EntityTypeTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.mod.config; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Default; 4 | import com.dfsek.tectonic.api.config.template.annotations.Value; 5 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 6 | import net.minecraft.entity.EntityType; 7 | import net.minecraft.registry.Registries; 8 | import net.minecraft.util.Identifier; 9 | 10 | 11 | public class EntityTypeTemplate implements ObjectTemplate> { 12 | @Value("id") 13 | @Default 14 | private Identifier id = null; 15 | 16 | @Override 17 | public EntityType get() { 18 | return Registries.ENTITY_TYPE.getEntry(id).orElseThrow().value(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/VillagerTypeTemplate.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.mod.config; 2 | 3 | import com.dfsek.tectonic.api.config.template.annotations.Default; 4 | import com.dfsek.tectonic.api.config.template.annotations.Value; 5 | import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; 6 | import net.minecraft.registry.Registries; 7 | import net.minecraft.registry.RegistryKey; 8 | import net.minecraft.registry.RegistryKeys; 9 | import net.minecraft.util.Identifier; 10 | import net.minecraft.village.VillagerType; 11 | 12 | 13 | public class VillagerTypeTemplate implements ObjectTemplate> { 14 | @Value("id") 15 | @Default 16 | private String id = null; 17 | 18 | @Override 19 | public RegistryKey get() { 20 | return RegistryKey.of(RegistryKeys.VILLAGER_TYPE, Identifier.ofVanilla(id)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/access/BiomeAccessor.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.mod.mixin.access; 2 | 3 | import net.minecraft.world.biome.Biome; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | 8 | @Mixin(Biome.class) 9 | public interface BiomeAccessor { 10 | @Accessor("weather") 11 | Biome.Weather getWeather(); 12 | } 13 | -------------------------------------------------------------------------------- /platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/access/VillagerTypeAccessor.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.mod.mixin.access; 2 | 3 | import net.minecraft.registry.RegistryKey; 4 | import net.minecraft.village.VillagerType; 5 | import net.minecraft.world.biome.Biome; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.Map; 10 | 11 | 12 | @Mixin(VillagerType.class) 13 | public interface VillagerTypeAccessor { 14 | @Accessor("BIOME_TO_TYPE") 15 | static Map, RegistryKey> getBiomeTypeToIdMap() { 16 | throw new AssertionError("Untransformed Accessor!"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/BiomeInvoker.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.mod.mixin.invoke; 2 | 3 | import net.minecraft.world.biome.Biome; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Invoker; 6 | 7 | 8 | @Mixin(Biome.class) 9 | public interface BiomeInvoker { 10 | @Invoker("getDefaultGrassColor") 11 | int invokeGetDefaultGrassColor(); 12 | } 13 | -------------------------------------------------------------------------------- /platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.mod.mixin.invoke; 2 | 3 | import net.minecraft.block.BlockState; 4 | import net.minecraft.block.FluidBlock; 5 | import net.minecraft.fluid.FluidState; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Invoker; 8 | 9 | 10 | @Mixin(FluidBlock.class) 11 | public interface FluidBlockInvoker { 12 | @Invoker("getFluidState") 13 | FluidState invokeGetFluidState(BlockState state); 14 | } 15 | -------------------------------------------------------------------------------- /platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin_ifaces/FloraFeatureHolder.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.mod.mixin_ifaces; 2 | 3 | import net.minecraft.world.gen.feature.ConfiguredFeature; 4 | 5 | import java.util.List; 6 | 7 | 8 | public interface FloraFeatureHolder { 9 | void setFloraFeatures(List> features); 10 | } 11 | -------------------------------------------------------------------------------- /platforms/mixin-common/src/main/resources/terra.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v1 named 2 | accessible class net/minecraft/world/biome/Biome$Weather 3 | accessible class net/minecraft/world/gen/WorldPresets$Registrar 4 | accessible class net/minecraft/registry/RegistryLoader$Loader -------------------------------------------------------------------------------- /platforms/mixin-lifecycle/README.md: -------------------------------------------------------------------------------- 1 | # mixin-lifecycle 2 | 3 | This project contains lifecycle mixins shared between Fabric, and formerly Quilt. -------------------------------------------------------------------------------- /platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/RegistryEntryReferenceInvoker.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.lifecycle.mixin; 2 | 3 | 4 | import net.minecraft.registry.entry.RegistryEntry.Reference; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | 9 | @Mixin(Reference.class) 10 | public interface RegistryEntryReferenceInvoker { 11 | @Invoker("setValue") 12 | void invokeSetValue(T value); 13 | } 14 | -------------------------------------------------------------------------------- /platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/RegistryMixin.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.lifecycle.mixin; 2 | 3 | import net.minecraft.registry.Registries; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | 9 | import com.dfsek.terra.lifecycle.util.RegistryUtil; 10 | 11 | 12 | @Mixin(Registries.class) 13 | public class RegistryMixin { 14 | @Inject(method = "", at = @At("RETURN")) 15 | private static void registerTerraGenerators(CallbackInfo ci) { 16 | RegistryUtil.register(); 17 | } 18 | } -------------------------------------------------------------------------------- /platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/RegistryHack.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.lifecycle.util; 2 | 3 | public interface RegistryHack { 4 | void terra_bind(); 5 | } 6 | -------------------------------------------------------------------------------- /platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/RegistryUtil.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.lifecycle.util; 2 | 3 | import net.minecraft.registry.Registries; 4 | import net.minecraft.registry.Registry; 5 | import net.minecraft.util.Identifier; 6 | 7 | import com.dfsek.terra.mod.data.Codecs; 8 | 9 | 10 | public final class RegistryUtil { 11 | private RegistryUtil() { 12 | 13 | } 14 | 15 | public static void register() { 16 | Registry.register(Registries.CHUNK_GENERATOR, Identifier.of("terra:terra"), Codecs.MINECRAFT_CHUNK_GENERATOR_WRAPPER); 17 | Registry.register(Registries.BIOME_SOURCE, Identifier.of("terra:terra"), Codecs.TERRA_BIOME_SOURCE); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /platforms/mixin-lifecycle/src/main/resources/terra.lifecycle.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "com.dfsek.terra.lifecycle.mixin", 5 | "compatibilityLevel": "JAVA_21", 6 | "mixins": [ 7 | "NoiseConfigMixin", 8 | "RegistryEntryReferenceInvoker", 9 | "RegistryMixin", 10 | "SimpleRegistryMixin", 11 | "lifecycle.MinecraftServerMixin", 12 | "lifecycle.RegistryLoaderMixin", 13 | "lifecycle.SaveLoadingMixin" 14 | ], 15 | "client": [ 16 | "lifecycle.CreateWorldScreenMixin" 17 | ], 18 | "server": [ 19 | ], 20 | "injectors": { 21 | "defaultRequire": 1 22 | }, 23 | "refmap": "terra.lifecycle.refmap.json" 24 | } -------------------------------------------------------------------------------- /platforms/quilt/gradle.properties: -------------------------------------------------------------------------------- 1 | loom.platform=quilt -------------------------------------------------------------------------------- /platforms/quilt/src/main/java/com/dfsek/terra/quilt/QuiltAddon.java: -------------------------------------------------------------------------------- 1 | package com.dfsek.terra.quilt; 2 | 3 | import com.dfsek.terra.mod.MinecraftAddon; 4 | import com.dfsek.terra.mod.ModPlatform; 5 | 6 | 7 | public class QuiltAddon extends MinecraftAddon { 8 | 9 | public QuiltAddon(ModPlatform modPlatform) { 10 | super(modPlatform); 11 | } 12 | 13 | @Override 14 | public String getID() { 15 | return "terra-quilt"; 16 | } 17 | } -------------------------------------------------------------------------------- /platforms/quilt/src/main/resources/assets/terra/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PolyhedralDev/Terra/d90a4200fef34e58c85db81971be537110ea58da/platforms/quilt/src/main/resources/assets/terra/icon.png -------------------------------------------------------------------------------- /platforms/quilt/src/main/resources/assets/terra/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator.terra": "Terra" 3 | } 4 | 5 | -------------------------------------------------------------------------------- /platforms/quilt/src/main/resources/terra.quilt.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "com.dfsek.terra.quilt.mixin", 5 | "compatibilityLevel": "JAVA_21", 6 | "mixins": [ 7 | ], 8 | "client": [ 9 | ], 10 | "server": [ 11 | ], 12 | "injectors": { 13 | "defaultRequire": 1 14 | } 15 | } -------------------------------------------------------------------------------- /platforms/sponge/src/main/resources/META-INF/plugins.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | { 4 | "loader": "java_plain", 5 | "id": "terra", 6 | "name": "Terra", 7 | "version": "@VERSION@", 8 | "main-class": "com.dfsek.terra.sponge.TerraSpongePlugin", 9 | "description": "@DESCRIPTION@", 10 | "links": { 11 | "source": "@SOURCE@", 12 | "issues": "@ISSUES@" 13 | }, 14 | "contributors": [ 15 | ], 16 | "dependencies": [ 17 | { 18 | "id": "spongeapi", 19 | "version": "9.0.0" 20 | } 21 | ] 22 | } 23 | ] 24 | } --------------------------------------------------------------------------------