├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── gradle-wrapper-validation.yml ├── .gitignore ├── .idea ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── copyright │ ├── Orbis_GPL.xml │ └── profiles_settings.xml ├── discord.xml ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml └── vcs.xml ├── GPL3.md ├── LICENSE.md ├── README.md ├── build.gradle.kts ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── orbis-cli ├── build.gradle.kts └── src │ └── main │ └── java │ └── com │ └── azortis │ └── orbis │ └── cli │ ├── CLIPlatform.java │ └── OrbisCLI.java ├── orbis-core ├── build.gradle.kts └── src │ ├── generated │ └── java │ │ └── com │ │ └── azortis │ │ └── orbis │ │ └── block │ │ ├── Blocks.java │ │ └── property │ │ └── Properties.java │ ├── main │ └── java │ │ └── com │ │ └── azortis │ │ └── orbis │ │ ├── Orbis.java │ │ ├── Platform.java │ │ ├── Registry.java │ │ ├── Settings.java │ │ ├── block │ │ ├── Block.java │ │ ├── BlockRegistry.java │ │ ├── BlockState.java │ │ ├── ConfiguredBlock.java │ │ ├── PlatformBlockRegistry.java │ │ ├── entity │ │ │ ├── BlockEntity.java │ │ │ ├── CampfireEntity.java │ │ │ └── MobSpawnerEntity.java │ │ ├── package-info.java │ │ └── property │ │ │ ├── AttachFace.java │ │ │ ├── BambooLeaves.java │ │ │ ├── BedPart.java │ │ │ ├── BellAttachType.java │ │ │ ├── BooleanProperty.java │ │ │ ├── ChestType.java │ │ │ ├── ComparatorMode.java │ │ │ ├── DoorHingeSide.java │ │ │ ├── DoubleBlockHalf.java │ │ │ ├── DripstoneThickness.java │ │ │ ├── EnumProperty.java │ │ │ ├── Half.java │ │ │ ├── IntegerProperty.java │ │ │ ├── NoteBlockInstrument.java │ │ │ ├── Orientation.java │ │ │ ├── PistonType.java │ │ │ ├── Property.java │ │ │ ├── PropertyRegistry.java │ │ │ ├── RailShape.java │ │ │ ├── RedstoneSide.java │ │ │ ├── SculkSensorPhase.java │ │ │ ├── SlabType.java │ │ │ ├── StairsShape.java │ │ │ ├── StructureMode.java │ │ │ ├── Tilt.java │ │ │ └── WallSide.java │ │ ├── command │ │ ├── BaseCommands.java │ │ ├── CommandSender.java │ │ ├── ConsoleSender.java │ │ ├── ProjectCommands.java │ │ └── StudioCommands.java │ │ ├── entity │ │ └── Player.java │ │ ├── exception │ │ ├── CoordsOutOfBoundsException.java │ │ └── SectionCoordsOutOfBoundsException.java │ │ ├── generator │ │ ├── Dimension.java │ │ ├── biome │ │ │ ├── Biome.java │ │ │ ├── BiomeLayout.java │ │ │ ├── BiomeSection.java │ │ │ ├── Distributor.java │ │ │ ├── SingleDistributor.java │ │ │ ├── complex │ │ │ │ ├── ComplexAccess.java │ │ │ │ ├── ComplexDistributor.java │ │ │ │ ├── Region.java │ │ │ │ ├── layer │ │ │ │ │ ├── BiomeLayer.java │ │ │ │ │ ├── Layer.java │ │ │ │ │ ├── NoiseLayer.java │ │ │ │ │ ├── RegionLayer.java │ │ │ │ │ └── StrengthLayer.java │ │ │ │ ├── modifier │ │ │ │ │ ├── Modifier.java │ │ │ │ │ └── RangedLinearModifier.java │ │ │ │ └── requirement │ │ │ │ │ ├── MaxStrength.java │ │ │ │ │ ├── MinStrength.java │ │ │ │ │ ├── NoiseRanges.java │ │ │ │ │ └── Requirement.java │ │ │ └── package-info.java │ │ ├── framework │ │ │ ├── ChunkSnapshot.java │ │ │ ├── ChunkStage.java │ │ │ ├── Engine.java │ │ │ ├── WorldSnapshot.java │ │ │ ├── WorldStage.java │ │ │ ├── biome │ │ │ │ └── BiomeSurfaceStage.java │ │ │ └── object │ │ │ │ └── package-info.java │ │ ├── interpolation │ │ │ ├── HeightProvider.java │ │ │ └── Interpolator.java │ │ ├── noise │ │ │ ├── FastNoise.java │ │ │ ├── Noise.java │ │ │ ├── OpenSimplex2.java │ │ │ └── OpenSimplex2S.java │ │ ├── point │ │ │ ├── ChunkPointGatherer.java │ │ │ ├── GatheredPoint.java │ │ │ └── PointGatherer.java │ │ └── surface │ │ │ ├── Surface.java │ │ │ └── defaults │ │ │ ├── ConfigSurface.java │ │ │ └── PlainsSurface.java │ │ ├── inventory │ │ ├── Enchantment.java │ │ ├── Inventory.java │ │ ├── InventoryFactory.java │ │ ├── Item.java │ │ └── ItemFlag.java │ │ ├── pack │ │ ├── Inject.java │ │ ├── Invoke.java │ │ ├── Pack.java │ │ ├── PackLoader.java │ │ ├── PackManager.java │ │ ├── Validate.java │ │ ├── adapter │ │ │ ├── BlockAdapter.java │ │ │ ├── KeyAdapter.java │ │ │ ├── LocationAdapter.java │ │ │ └── TypeAdapter.java │ │ ├── data │ │ │ ├── Component.java │ │ │ ├── ComponentAccess.java │ │ │ ├── DataAccess.java │ │ │ └── DirectoryDataAccess.java │ │ └── studio │ │ │ ├── Project.java │ │ │ ├── ProjectManager.java │ │ │ ├── ProjectWatcher.java │ │ │ ├── StudioDataAccess.java │ │ │ ├── StudioWorld.java │ │ │ ├── WorkspaceConfig.java │ │ │ ├── annotations │ │ │ ├── ArrayType.java │ │ │ ├── Description.java │ │ │ ├── Entries.java │ │ │ ├── GlobalDefinition.java │ │ │ ├── Ignore.java │ │ │ ├── InheritFields.java │ │ │ ├── Max.java │ │ │ ├── MaxItems.java │ │ │ ├── Min.java │ │ │ ├── MinItems.java │ │ │ ├── Required.java │ │ │ ├── SupportAnonymous.java │ │ │ ├── Typed.java │ │ │ ├── Unique.java │ │ │ └── package-info.java │ │ │ └── schema │ │ │ ├── BlockBuilder.java │ │ │ ├── ClassBuilder.java │ │ │ ├── EntriesBuilder.java │ │ │ ├── SchemaBuilder.java │ │ │ └── SchemaManager.java │ │ ├── structure │ │ └── StructureObject.java │ │ ├── util │ │ ├── Axis.java │ │ ├── BlockPos.java │ │ ├── BoundingBox.java │ │ ├── Direction.java │ │ ├── Location.java │ │ ├── Nameable.java │ │ ├── Rotation.java │ │ ├── Scheduler.java │ │ ├── annotations │ │ │ ├── AbsoluteCoords.java │ │ │ ├── ChunkCoords.java │ │ │ ├── RelativeCoords.java │ │ │ └── SectionCoords.java │ │ ├── math │ │ │ ├── Point2i.java │ │ │ └── Point3i.java │ │ └── maven │ │ │ ├── AccessLoader.java │ │ │ ├── Dependencies.java │ │ │ ├── Dependency.java │ │ │ ├── DependencyLoader.java │ │ │ └── Repository.java │ │ └── world │ │ ├── ChunkAccess.java │ │ ├── Heightmap.java │ │ ├── RegionAccess.java │ │ ├── World.java │ │ ├── WorldAccess.java │ │ └── WorldInfo.java │ └── test │ └── java │ └── com │ └── azortis │ └── orbis │ ├── BlocksTest.java │ └── MockPlatform.java ├── orbis-generators ├── build.gradle.kts └── src │ └── main │ └── java │ └── com │ └── azortis │ └── orbis │ └── codegen │ ├── Generators.java │ ├── OrbisCodeGenerator.java │ ├── block │ ├── BlocksGenerator.java │ └── PropertiesGenerator.java │ └── item │ ├── EnchantmentsGenerator.java │ └── ItemsGenerator.java ├── orbis-paper ├── build.gradle.kts └── src │ └── main │ ├── java │ └── com │ │ └── azortis │ │ └── orbis │ │ └── paper │ │ ├── OrbisBootstrap.java │ │ ├── OrbisPlugin.java │ │ ├── PaperPlatform.java │ │ ├── PaperSettings.java │ │ ├── block │ │ ├── PaperBlock.java │ │ ├── PaperBlockRegistry.java │ │ ├── PaperBlockState.java │ │ └── entity │ │ │ ├── PaperBlockEntity.java │ │ │ ├── PaperCampfireEntity.java │ │ │ └── PaperMobSpawnerEntity.java │ │ ├── entity │ │ └── PaperPlayer.java │ │ ├── generator │ │ ├── PaperBiomeProvider.java │ │ ├── PaperChunkGenerator.java │ │ ├── PaperChunkSnapshot.java │ │ └── PaperWorldSnapshot.java │ │ ├── studio │ │ ├── PaperStudioBiomeProvider.java │ │ ├── PaperStudioChunkGenerator.java │ │ └── PaperStudioWorld.java │ │ ├── util │ │ ├── ConversionUtils.java │ │ └── PaperScheduler.java │ │ └── world │ │ ├── PaperChunkAccess.java │ │ ├── PaperNativeHeightMap.java │ │ ├── PaperRegionAccess.java │ │ ├── PaperWorld.java │ │ └── PaperWorldAccess.java │ └── resources │ ├── paper-plugin.yml │ └── plugin.yml └── settings.gradle.kts /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.sh text eol=lf 4 | gradlew text eol=lf 5 | *.bat text eol=crlf 6 | 7 | *.jar binary 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: 'Bug' 6 | assignees: '' 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **Expected behavior** 13 | A clear and concise description of what you expected to happen. 14 | 15 | **Server logs:** 16 | Send the **full** `latest.log` server log here. We will not look at crash-log files. 17 | 18 | **To Reproduce** 19 | Steps to reproduce the behavior: 20 | 1. Make a Paper/Minestom server 21 | 2. Install Orbis 22 | 3. Add Orbis to the `bukkit.yml` config file 23 | 4. ... 24 | 25 | **Screenshots** 26 | If applicable, add screenshots to help explain your problem. 27 | 28 | **Server Information:** 29 | - Installed plugins: 30 | - Installed Orbis version: 31 | - Server version (E.g. PaperSpigot 1.16.5 #574): 32 | - Operating system (optional, e.g. Windows 10 64x): 33 | 34 | **Additional context** 35 | Add any other context about the problem here. 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: 'Enhancement' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/gradle-wrapper-validation.yml: -------------------------------------------------------------------------------- 1 | name: "Validate Gradle Wrapper" 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | validation: 6 | name: "Validation" 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - uses: gradle/wrapper-validation-action@v1 11 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/copyright/Orbis_GPL.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/discord.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Orbis 2 | A work-in-progress open-source minecraft world generator for Minestom 3 | 4 | ## Discord 5 | If you're interested in the project, then join our [discord](https://discord.gg/dCKkwnH)! We provide frequent updates there, and are just excited to receive 6 | new members who are interested in the project. This way we can get good feedback and provide support. 7 | 8 | ## Development screenshots 9 | ![](https://media.discordapp.net/attachments/802256785389387776/826079529901883432/unknown.png?width=1618&height=910) 10 | ![](https://media.discordapp.net/attachments/802256785389387776/826076335662694421/unknown.png?width=1618&height=910) 11 | ![](https://media.discordapp.net/attachments/802256785389387776/826080035441999893/unknown.png?width=1618&height=910) 12 | 13 | **Note** These are screenshots from very early alpha build tests, don't take them at face value of what the generator will end up looking like. 14 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | /* 20 | * This file was generated by the Gradle 'init' task. 21 | */ 22 | 23 | group = "com.azortis" 24 | version = "0.3-ALPHA" 25 | description = "Orbis" -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AzortisCode/Orbis/a52cdd0826d54bbd80d1b64fc40eb4ee7c62ceb0/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AzortisCode/Orbis/a52cdd0826d54bbd80d1b64fc40eb4ee7c62ceb0/gradlew -------------------------------------------------------------------------------- /orbis-cli/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | plugins { 20 | java 21 | application 22 | id("com.github.johnrengelman.shadow") version "7.1.2" 23 | } 24 | 25 | group = "com.azortis" 26 | version = project(":orbis-core").version; 27 | 28 | application { 29 | mainClass.set("com.azortis.orbis.cli.OrbisCLI") 30 | } 31 | 32 | repositories { 33 | mavenCentral() 34 | } 35 | 36 | dependencies { 37 | implementation(project(":orbis-core")) 38 | 39 | testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") 40 | testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") 41 | } 42 | 43 | java { 44 | toolchain.languageVersion.set(JavaLanguageVersion.of(17)) 45 | } -------------------------------------------------------------------------------- /orbis-cli/src/main/java/com/azortis/orbis/cli/OrbisCLI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.cli; 20 | 21 | public final class OrbisCLI { 22 | 23 | public static void main(String[] args) { 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/PlatformBlockRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block; 20 | 21 | import com.google.common.collect.ImmutableSet; 22 | import net.kyori.adventure.key.Key; 23 | import org.apiguardian.api.API; 24 | import org.jetbrains.annotations.Contract; 25 | import org.jetbrains.annotations.NotNull; 26 | 27 | @API(status = API.Status.INTERNAL, since = "0.3-Alpha", consumers = {"com.azortis.orbis.block", 28 | "com.azortis.orbis.paper.block"}) 29 | public interface PlatformBlockRegistry { 30 | 31 | /** 32 | * Returns an immutable set of all the possible block {@link Key}'s. 33 | * 34 | * @return Immutable set of block keys. 35 | * @since 0.3-Alpha 36 | */ 37 | @Contract(pure = true) 38 | @NotNull 39 | ImmutableSet blockKeys(); 40 | 41 | /** 42 | * Returns an immutable set view of all the {@link Block} on the platform. 43 | * 44 | * @return Immutable set view of all the blocks. 45 | * @since 0.3-Alpha 46 | */ 47 | @Contract(" -> new") 48 | @NotNull 49 | ImmutableSet blocks(); 50 | 51 | /** 52 | * Returns an immutable set view of all the {@link BlockState} on the platform. 53 | * 54 | * @return Immutable set view of all the blockStates. 55 | * @since 0.3-Alpha 56 | */ 57 | @Contract(" -> new") 58 | @NotNull 59 | ImmutableSet states(); 60 | 61 | @Contract(pure = true) 62 | boolean containsKey(@NotNull Key key); 63 | 64 | @Contract(pure = true) 65 | @NotNull 66 | Block fromKey(@NotNull Key key); 67 | 68 | @Contract(pure = true) 69 | @NotNull 70 | Block fromId(final int id); 71 | 72 | @Contract(pure = true) 73 | @NotNull 74 | BlockState fromStateId(final int stateId); 75 | 76 | } 77 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/entity/BlockEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.entity; 20 | 21 | import com.azortis.orbis.util.BlockPos; 22 | import net.kyori.adventure.key.Keyed; 23 | import net.kyori.adventure.nbt.CompoundBinaryTag; 24 | import org.jetbrains.annotations.NotNull; 25 | 26 | public interface BlockEntity extends Keyed { 27 | 28 | int x(); 29 | 30 | int y(); 31 | 32 | int z(); 33 | 34 | @NotNull 35 | BlockPos blockPos(); 36 | 37 | @NotNull 38 | CompoundBinaryTag toNBT(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/entity/CampfireEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.entity; 20 | 21 | public interface CampfireEntity extends BlockEntity { 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/entity/MobSpawnerEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.entity; 20 | 21 | public interface MobSpawnerEntity extends BlockEntity { 22 | 23 | int getDelay(); 24 | 25 | void setDelay(int delay); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | /** 20 | *

Everything that has to do with {@link com.azortis.orbis.block.Block} & {@link com.azortis.orbis.block.BlockState}

21 | * 22 | * @author Jake Nijssen 23 | * @since 0.3-Alpha 24 | */ 25 | package com.azortis.orbis.block; -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/AttachFace.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum AttachFace implements Nameable { 25 | FLOOR("floor"), 26 | WALL("wall"), 27 | CEILING("ceiling"); 28 | 29 | private final String name; 30 | 31 | AttachFace(String name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return this.name; 38 | } 39 | 40 | @Override 41 | public @NotNull String serializedName() { 42 | return this.name; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/BambooLeaves.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum BambooLeaves implements Nameable { 25 | NONE("none"), 26 | SMALL("small"), 27 | LARGE("large"); 28 | 29 | private final String name; 30 | 31 | BambooLeaves(@NotNull String name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return this.name; 38 | } 39 | 40 | @Override 41 | public @NotNull String serializedName() { 42 | return this.name; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/BedPart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum BedPart implements Nameable { 25 | HEAD("head"), 26 | FOOT("foot"); 27 | 28 | private final String name; 29 | 30 | BedPart(String name) { 31 | this.name = name; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return this.name; 37 | } 38 | 39 | @Override 40 | public @NotNull String serializedName() { 41 | return this.name; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/BellAttachType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum BellAttachType implements Nameable { 25 | FLOOR("floor"), 26 | CEILING("ceiling"), 27 | SINGLE_WALL("single_wall"), 28 | DOUBLE_WALL("double_wall"); 29 | 30 | private final String name; 31 | 32 | BellAttachType(String name) { 33 | this.name = name; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return this.name; 39 | } 40 | 41 | @Override 42 | public @NotNull String serializedName() { 43 | return this.name; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/BooleanProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import org.apiguardian.api.API; 22 | import org.jetbrains.annotations.Contract; 23 | import org.jetbrains.annotations.NotNull; 24 | 25 | import java.util.Set; 26 | 27 | /** 28 | * A {@link Property} that can be either true or false. 29 | * 30 | * @author Jake Nijssen 31 | * @since 0.3-Alpha 32 | */ 33 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 34 | public final class BooleanProperty extends Property { 35 | 36 | public static final Set VALUES = Set.of(true, false); 37 | 38 | @API(status = API.Status.INTERNAL, since = "0.3-Alpha", consumers = "com.azortis.orbis.block.property") 39 | private BooleanProperty(final @NotNull String key) { 40 | super(key, Boolean.class, VALUES); 41 | } 42 | 43 | @Contract("_ -> new") 44 | @API(status = API.Status.INTERNAL, since = "0.3-Alpha", consumers = "com.azortis.orbis.block.property") 45 | static @NotNull BooleanProperty create(final @NotNull String key) { 46 | return new BooleanProperty(key); 47 | } 48 | 49 | /** 50 | * {@inheritDoc} 51 | */ 52 | @Override 53 | public @NotNull Boolean getValue(@NotNull String value) { 54 | final boolean val = Boolean.parseBoolean(value); 55 | if (!values().contains(val)) { 56 | throw new IllegalArgumentException("Invalid boolean value: " + value + ". Must be in " + values()); 57 | } 58 | return val; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/ChestType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum ChestType implements Nameable { 25 | SINGLE("single"), 26 | LEFT("left"), 27 | RIGHT("right"); 28 | 29 | private final String name; 30 | 31 | ChestType(String name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return this.name; 38 | } 39 | 40 | @Override 41 | public @NotNull String serializedName() { 42 | return this.name; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/ComparatorMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum ComparatorMode implements Nameable { 25 | COMPARE("compare"), 26 | SUBTRACT("subtract"); 27 | 28 | private final String name; 29 | 30 | ComparatorMode(String name) { 31 | this.name = name; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return this.name; 37 | } 38 | 39 | @Override 40 | public @NotNull String serializedName() { 41 | return this.name; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/DoorHingeSide.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum DoorHingeSide implements Nameable { 25 | LEFT("left"), 26 | RIGHT("right"); 27 | 28 | private final String name; 29 | 30 | DoorHingeSide(String name) { 31 | this.name = name; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return this.name; 37 | } 38 | 39 | @Override 40 | public @NotNull String serializedName() { 41 | return this.name; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/DoubleBlockHalf.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum DoubleBlockHalf implements Nameable { 25 | UPPER("upper"), 26 | LOWER("lower"); 27 | 28 | private final String name; 29 | 30 | DoubleBlockHalf(String name) { 31 | this.name = name; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return this.name; 37 | } 38 | 39 | @Override 40 | public @NotNull String serializedName() { 41 | return this.name; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/DripstoneThickness.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum DripstoneThickness implements Nameable { 25 | TIP_MERGE("tip_merge"), 26 | TIP("tip"), 27 | FRUSTUM("frustum"), 28 | MIDDLE("middle"), 29 | BASE("base"); 30 | 31 | private final String name; 32 | 33 | DripstoneThickness(String name) { 34 | this.name = name; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return this.name; 40 | } 41 | 42 | @Override 43 | public @NotNull String serializedName() { 44 | return this.name; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/Half.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum Half implements Nameable { 25 | TOP("top"), 26 | BOTTOM("bottom"); 27 | 28 | private final String name; 29 | 30 | Half(String name) { 31 | this.name = name; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return this.name; 37 | } 38 | 39 | @Override 40 | public @NotNull String serializedName() { 41 | return this.name; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/NoteBlockInstrument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum NoteBlockInstrument implements Nameable { 25 | HARP("harp"), 26 | BASEDRUM("basedrum"), 27 | SNARE("snare"), 28 | HAT("hat"), 29 | BASS("bass"), 30 | FLUTE("flute"), 31 | BELL("bell"), 32 | GUITAR("guitar"), 33 | CHIME("chime"), 34 | XYLOPHONE("xylophone"), 35 | IRON_XYLOPHONE("iron_xylophone"), 36 | COW_BELL("cow_bell"), 37 | DIDGERIDOO("didgeridoo"), 38 | BIT("bit"), 39 | BANJO("banjo"), 40 | PLING("pling"), 41 | ZOMBIE("zombie"), 42 | SKELETON("skeleton"), 43 | CREEPER("creeper"), 44 | DRAGON("dragon"), 45 | WITHER_SKELETON("wither_skeleton"), 46 | PIGLIN("piglin"), 47 | CUSTOM_HEAD("custom_head"); 48 | 49 | private final String name; 50 | 51 | NoteBlockInstrument(String name) { 52 | this.name = name; 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | return this.name; 58 | } 59 | 60 | @Override 61 | public @NotNull String serializedName() { 62 | return this.name; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/Orientation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum Orientation implements Nameable { 25 | UP_NORTH("up_north"), 26 | UP_EAST("up_east"), 27 | UP_SOUTH("up_south"), 28 | UP_WEST("up_west"), 29 | DOWN_NORTH("down_north"), 30 | DOWN_EAST("down_east"), 31 | DOWN_SOUTH("down_south"), 32 | DOWN_WEST("down_west"), 33 | NORTH_UP("north_up"), 34 | EAST_UP("east_up"), 35 | SOUTH_UP("south_up"), 36 | WEST_UP("west_up"); 37 | 38 | private final String name; 39 | 40 | Orientation(final String name) { 41 | this.name = name; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return this.name; 47 | } 48 | 49 | @Override 50 | public @NotNull String serializedName() { 51 | return this.name; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/PistonType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum PistonType implements Nameable { 25 | NORMAL("normal"), 26 | STICKY("sticky"); 27 | 28 | private final String name; 29 | 30 | PistonType(String name) { 31 | this.name = name; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return this.name; 37 | } 38 | 39 | @Override 40 | public @NotNull String serializedName() { 41 | return this.name; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/RailShape.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum RailShape implements Nameable { 25 | NORTH_SOUTH("north_south"), 26 | EAST_WEST("east_west"), 27 | ASCENDING_EAST("ascending_east"), 28 | ASCENDING_WEST("ascending_west"), 29 | ASCENDING_NORTH("ascending_north"), 30 | ASCENDING_SOUTH("ascending_south"), 31 | SOUTH_EAST("south_east"), 32 | SOUTH_WEST("south_west"), 33 | NORTH_WEST("north_west"), 34 | NORTH_EAST("north_east"); 35 | 36 | private final String name; 37 | 38 | RailShape(String name) { 39 | this.name = name; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return this.name; 45 | } 46 | 47 | @Override 48 | public @NotNull String serializedName() { 49 | return this.name; 50 | } 51 | 52 | public boolean isAscending() { 53 | return this == ASCENDING_NORTH || this == ASCENDING_EAST || this == ASCENDING_SOUTH || this == ASCENDING_WEST; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/RedstoneSide.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum RedstoneSide implements Nameable { 25 | UP("up"), 26 | SIDE("side"), 27 | NONE("none"); 28 | 29 | private final String name; 30 | 31 | RedstoneSide(String name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return this.serializedName(); 38 | } 39 | 40 | @Override 41 | public @NotNull String serializedName() { 42 | return this.name; 43 | } 44 | 45 | public boolean isConnected() { 46 | return this != NONE; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/SculkSensorPhase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum SculkSensorPhase implements Nameable { 25 | INACTIVE("inactive"), 26 | ACTIVE("active"), 27 | COOLDOWN("cooldown"); 28 | 29 | private final String name; 30 | 31 | SculkSensorPhase(String name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return this.name; 38 | } 39 | 40 | @Override 41 | public @NotNull String serializedName() { 42 | return this.name; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/SlabType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum SlabType implements Nameable { 25 | TOP("top"), 26 | BOTTOM("bottom"), 27 | DOUBLE("double"); 28 | 29 | private final String name; 30 | 31 | SlabType(String name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return this.name; 38 | } 39 | 40 | @Override 41 | public @NotNull String serializedName() { 42 | return this.name; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/StairsShape.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum StairsShape implements Nameable { 25 | STRAIGHT("straight"), 26 | INNER_LEFT("inner_left"), 27 | INNER_RIGHT("inner_right"), 28 | OUTER_LEFT("outer_left"), 29 | OUTER_RIGHT("outer_right"); 30 | 31 | private final String name; 32 | 33 | StairsShape(String name) { 34 | this.name = name; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return this.name; 40 | } 41 | 42 | @Override 43 | public @NotNull String serializedName() { 44 | return this.name; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/StructureMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum StructureMode implements Nameable { 25 | SAVE("save"), 26 | LOAD("load"), 27 | CORNER("corner"), 28 | DATA("data"); 29 | 30 | private final String name; 31 | 32 | StructureMode(String name) { 33 | this.name = name; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return this.name; 39 | } 40 | 41 | @Override 42 | public @NotNull String serializedName() { 43 | return this.name; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/Tilt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum Tilt implements Nameable { 25 | NONE("none", true), 26 | UNSTABLE("unstable", false), 27 | PARTIAL("partial", true), 28 | FULL("full", true); 29 | 30 | private final String name; 31 | private final boolean causesVibration; 32 | 33 | Tilt(String name, boolean stable) { 34 | this.name = name; 35 | this.causesVibration = stable; 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | return this.name; 41 | } 42 | 43 | @Override 44 | public @NotNull String serializedName() { 45 | return this.name; 46 | } 47 | 48 | public boolean causesVibration() { 49 | return this.causesVibration; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/block/property/WallSide.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.block.property; 20 | 21 | import com.azortis.orbis.util.Nameable; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public enum WallSide implements Nameable { 25 | NONE("none"), 26 | LOW("low"), 27 | TALL("tall"); 28 | 29 | private final String name; 30 | 31 | WallSide(String name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return this.name; 38 | } 39 | 40 | @Override 41 | public @NotNull String serializedName() { 42 | return this.name; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/command/BaseCommands.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.command; 20 | 21 | import cloud.commandframework.annotations.CommandMethod; 22 | import cloud.commandframework.annotations.CommandPermission; 23 | import cloud.commandframework.annotations.processing.CommandContainer; 24 | import com.azortis.orbis.Orbis; 25 | 26 | @SuppressWarnings("unused") 27 | @CommandContainer 28 | @CommandPermission("orbis.admin") 29 | @CommandMethod(value = "orbis|o", requiredSender = CommandSender.class) 30 | public final class BaseCommands { 31 | 32 | @CommandMethod("info") 33 | public void info(CommandSender sender) { 34 | sender.sendMessage(Orbis.getMiniMessage().deserialize(" Running Orbis version: " 35 | + Orbis.VERSION + ".")); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/command/CommandSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.command; 20 | 21 | import net.kyori.adventure.audience.ForwardingAudience; 22 | 23 | public interface CommandSender extends ForwardingAudience.Single { 24 | } 25 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/command/ConsoleSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.command; 20 | 21 | @FunctionalInterface 22 | public interface ConsoleSender extends CommandSender { 23 | } 24 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/exception/SectionCoordsOutOfBoundsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.exception; 20 | 21 | import com.azortis.orbis.generator.framework.ChunkSnapshot; 22 | import com.azortis.orbis.util.annotations.SectionCoords; 23 | import org.jetbrains.annotations.NotNull; 24 | 25 | public class SectionCoordsOutOfBoundsException extends RuntimeException { 26 | 27 | public SectionCoordsOutOfBoundsException() { 28 | super(); 29 | } 30 | 31 | public SectionCoordsOutOfBoundsException(String message) { 32 | super(message); 33 | } 34 | 35 | @SectionCoords 36 | public SectionCoordsOutOfBoundsException(int x, int z, @NotNull ChunkSnapshot snapshot) { 37 | super(String.format("Section Coordinate [%s,%s] is not within the bounds of chunk [%s,%s]", 38 | x, z, snapshot.chunkX(), snapshot.chunkZ())); 39 | } 40 | 41 | @SectionCoords 42 | public SectionCoordsOutOfBoundsException(int x, int y, int z, @NotNull ChunkSnapshot snapshot) { 43 | super(String.format("Section Coordinate [%s,%s,%s] is not within the bounds of chunk [%s,%s]", 44 | x, y, z, snapshot.chunkX(), snapshot.chunkZ())); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/Biome.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome; 20 | 21 | import com.azortis.orbis.block.ConfiguredBlock; 22 | import com.azortis.orbis.generator.surface.Surface; 23 | import com.azortis.orbis.pack.Inject; 24 | import com.google.gson.annotations.SerializedName; 25 | import net.kyori.adventure.key.Key; 26 | 27 | @Inject 28 | public final class Biome { 29 | 30 | private final String name; 31 | private final Key derivative; 32 | 33 | @SerializedName("surface") 34 | private final String surfaceName; 35 | private final int baseHeight; 36 | private final ConfiguredBlock surfaceBlock; 37 | private final ConfiguredBlock belowSurfaceBlock; 38 | @Inject(fieldName = "terrainName") 39 | private transient Surface surface; 40 | 41 | public Biome(String name, Key derivative, String surfaceName, int baseHeight, ConfiguredBlock surfaceBlock, 42 | ConfiguredBlock belowSurfaceBlock) { 43 | this.name = name; 44 | this.derivative = derivative; 45 | this.surfaceName = surfaceName; 46 | this.baseHeight = baseHeight; 47 | this.surfaceBlock = surfaceBlock; 48 | this.belowSurfaceBlock = belowSurfaceBlock; 49 | } 50 | 51 | public String name() { 52 | return this.name; 53 | } 54 | 55 | public Key derivative() { 56 | return this.derivative; 57 | } 58 | 59 | public String surfaceName() { 60 | return this.surfaceName; 61 | } 62 | 63 | public int baseHeight() { 64 | return this.baseHeight; 65 | } 66 | 67 | public ConfiguredBlock surfaceBlock() { 68 | return this.surfaceBlock; 69 | } 70 | 71 | public ConfiguredBlock belowSurfaceBlock() { 72 | return this.belowSurfaceBlock; 73 | } 74 | 75 | public Surface surface() { 76 | return this.surface; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/BiomeLayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | /** 24 | * An enum that defines a biome layout of the dimension. 25 | * 26 | * @author Jake Nijssen 27 | * @since 0.3-Alpha 28 | */ 29 | @API(status = API.Status.EXPERIMENTAL, since = "0.3-Alpha") 30 | public enum BiomeLayout { 31 | 32 | /** 33 | * A biome layout, where there only exists a surface, meaning that y-coordinates are not considered. 34 | * Just like the pre-1.18 overworld. 35 | */ 36 | SURFACE, 37 | 38 | /** 39 | * A biome layout, where there is a primary surface, but biomes below or above the surface 40 | * may be different. For example cave or sky biomes. Just like the vanilla overworld. 41 | */ 42 | HYBRID, 43 | 44 | /** 45 | * A biome layout, which doesn't have a surface and the y-coordinate is crucial for generation. 46 | * Just like the vanilla nether dimension. 47 | */ 48 | FULL; 49 | 50 | /** 51 | * If the layout has a 2d biome map. 52 | * 53 | * @return If the layout is {@link BiomeLayout#SURFACE} or {@link BiomeLayout#HYBRID}. 54 | * @since 0.3-Alpha 55 | */ 56 | public boolean hasBiomeMap() { 57 | return this == SURFACE || this == HYBRID; 58 | } 59 | 60 | /** 61 | * If the layout has a 3d biome sections. 62 | * 63 | * @return If the layout is {@link BiomeLayout#HYBRID} or {@link BiomeLayout#FULL}. 64 | * @since 0.3-Alpha 65 | */ 66 | public boolean hasFullBiomes() { 67 | return this == HYBRID || this == FULL; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/BiomeSection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome; 20 | 21 | import org.jetbrains.annotations.NotNull; 22 | import org.jetbrains.annotations.Unmodifiable; 23 | 24 | import java.util.Map; 25 | 26 | public record BiomeSection(@NotNull Biome biome, double biomeStrength, 27 | @Unmodifiable @NotNull Map biomeStrengths, 28 | @Unmodifiable @NotNull Map strengthMap) { 29 | 30 | public BiomeSection(@NotNull Biome biome, double biomeStrength, 31 | @NotNull Map biomeStrengths, @NotNull Map strengthMap) { 32 | this.biome = biome; 33 | this.biomeStrength = biomeStrength; 34 | this.biomeStrengths = Map.copyOf(biomeStrengths); 35 | this.strengthMap = Map.copyOf(strengthMap); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/SingleDistributor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome; 20 | 21 | import com.azortis.orbis.pack.studio.annotations.Description; 22 | import net.kyori.adventure.key.Key; 23 | import org.jetbrains.annotations.NotNull; 24 | 25 | import java.util.Collections; 26 | import java.util.Map; 27 | 28 | @Description("Distributor that only distributes one biome.") 29 | public final class SingleDistributor extends Distributor { 30 | 31 | private SingleDistributor(@NotNull String name, @NotNull Key providerKey) { 32 | super(name, providerKey); 33 | } 34 | 35 | @Override 36 | protected @NotNull BiomeSection sample(int x, int z) { 37 | return new BiomeSection(biomes().iterator().next(), 1.0D, 38 | Map.of(biomes().iterator().next(), 1.0D), Collections.emptyMap()); 39 | } 40 | 41 | @Override 42 | protected @NotNull BiomeSection sample(int x, int y, int z) { 43 | throw new UnsupportedOperationException("This distributor only supports 2d biomes"); 44 | } 45 | 46 | @Override 47 | public @NotNull BiomeLayout layout() { 48 | return BiomeLayout.SURFACE; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/ComplexAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex; 20 | 21 | import com.azortis.orbis.generator.biome.Distributor; 22 | import com.azortis.orbis.generator.biome.complex.modifier.Modifier; 23 | import com.azortis.orbis.generator.biome.complex.requirement.Requirement; 24 | import com.azortis.orbis.pack.adapter.TypeAdapter; 25 | import com.azortis.orbis.pack.data.ComponentAccess; 26 | import com.azortis.orbis.pack.data.DataAccess; 27 | import com.google.common.collect.ImmutableMap; 28 | import com.google.common.collect.ImmutableSet; 29 | import com.google.gson.JsonDeserializer; 30 | import org.jetbrains.annotations.NotNull; 31 | 32 | public final class ComplexAccess extends ComponentAccess { 33 | 34 | public static final String REGION_FOLDER = "/**"; 35 | 36 | public ComplexAccess(@NotNull String name, @NotNull DataAccess dataAccess) { 37 | super(name, Distributor.class, dataAccess); 38 | } 39 | 40 | @Override 41 | protected @NotNull String getTypeDataPath(@NotNull Class type) throws IllegalArgumentException { 42 | if (type == Region.class) return REGION_FOLDER; 43 | throw new IllegalArgumentException("Unsupported data type " + type); 44 | } 45 | 46 | @Override 47 | public @NotNull ImmutableSet> dataTypes() { 48 | return ImmutableSet.of(Region.class); 49 | } 50 | 51 | @Override 52 | public @NotNull ImmutableMap, JsonDeserializer> adapters() { 53 | return ImmutableMap.of( 54 | Requirement.class, new TypeAdapter<>(Requirement.class), 55 | Modifier.class, new TypeAdapter<>(Modifier.class) 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/Region.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex; 20 | 21 | import com.azortis.orbis.generator.biome.complex.layer.BiomeLayer; 22 | import com.azortis.orbis.generator.biome.complex.layer.NoiseLayer; 23 | import com.azortis.orbis.generator.biome.complex.layer.RegionLayer; 24 | import com.azortis.orbis.pack.studio.annotations.ArrayType; 25 | import com.azortis.orbis.pack.studio.annotations.Required; 26 | 27 | import java.util.Set; 28 | 29 | public final class Region { 30 | 31 | @Required 32 | private String name; 33 | 34 | @ArrayType(NoiseLayer.class) 35 | private Set noiseLayers; 36 | 37 | @ArrayType(RegionLayer.class) 38 | private Set regions; 39 | 40 | @ArrayType(BiomeLayer.class) 41 | private Set biomes; 42 | private RegionLayer fallbackRegion; 43 | private BiomeLayer fallbackBiome; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/layer/BiomeLayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.layer; 20 | 21 | import com.azortis.orbis.generator.Dimension; 22 | import com.azortis.orbis.generator.biome.Biome; 23 | import com.azortis.orbis.generator.biome.complex.modifier.Modifier; 24 | import com.azortis.orbis.generator.biome.complex.requirement.Requirement; 25 | import com.azortis.orbis.pack.Inject; 26 | import com.azortis.orbis.pack.Invoke; 27 | import com.azortis.orbis.pack.studio.annotations.Entries; 28 | import com.google.gson.annotations.SerializedName; 29 | 30 | import java.util.Set; 31 | 32 | @Inject 33 | public final class BiomeLayer extends Layer { 34 | 35 | @Entries(Biome.class) 36 | @SerializedName("biome") 37 | private final String biomeName; 38 | private transient Biome biome; 39 | 40 | @Inject 41 | private transient Dimension dimension; 42 | 43 | public BiomeLayer(Set requirements, boolean useDefaultModifier, Set modifiers, String biomeName) { 44 | super(requirements, useDefaultModifier, modifiers); 45 | this.biomeName = biomeName; 46 | } 47 | 48 | @Invoke(when = Invoke.Order.MID_INJECTION) 49 | private void loadBiome() { 50 | this.biome = dimension.distributor().getBiome(biomeName); 51 | } 52 | 53 | @Override 54 | public Class getType() { 55 | return Biome.class; 56 | } 57 | 58 | @Override 59 | public Biome getObject() { 60 | return biome; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/layer/Layer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.layer; 20 | 21 | import com.azortis.orbis.generator.biome.complex.modifier.Modifier; 22 | import com.azortis.orbis.generator.biome.complex.requirement.Requirement; 23 | import com.azortis.orbis.pack.studio.annotations.ArrayType; 24 | import com.azortis.orbis.pack.studio.annotations.InheritFields; 25 | 26 | import java.util.Set; 27 | 28 | @InheritFields 29 | public sealed abstract class Layer permits RegionLayer, BiomeLayer { 30 | 31 | @ArrayType(Requirement.class) 32 | private final Set requirements; 33 | private final boolean useDefaultModifier; 34 | 35 | @ArrayType(Modifier.class) 36 | private final Set modifiers; 37 | 38 | public Layer(Set requirements, boolean useDefaultModifier, Set modifiers) { 39 | this.requirements = requirements; 40 | this.useDefaultModifier = useDefaultModifier; 41 | this.modifiers = modifiers; 42 | } 43 | 44 | 45 | public abstract Class getType(); 46 | 47 | public abstract T getObject(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/layer/NoiseLayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.layer; 20 | 21 | import com.azortis.orbis.generator.noise.Noise; 22 | import com.azortis.orbis.pack.studio.annotations.Min; 23 | import com.azortis.orbis.pack.studio.annotations.Required; 24 | 25 | public record NoiseLayer(@Required String tag, @Required Noise noise, @Required @Min(1) int precision) { 26 | 27 | public double sample(double x, double z) { 28 | return (double) Math.round(precision * noise.noise(x, z)) / precision; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/layer/RegionLayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.layer; 20 | 21 | import com.azortis.orbis.generator.biome.complex.Region; 22 | import com.azortis.orbis.generator.biome.complex.modifier.Modifier; 23 | import com.azortis.orbis.generator.biome.complex.requirement.Requirement; 24 | import com.azortis.orbis.pack.Inject; 25 | import com.azortis.orbis.pack.studio.annotations.Entries; 26 | import com.google.gson.annotations.SerializedName; 27 | 28 | import java.util.Set; 29 | 30 | @Inject 31 | public final class RegionLayer extends Layer { 32 | 33 | @Entries(Region.class) 34 | @SerializedName("region") 35 | private final String regionName; 36 | 37 | @Inject(fieldName = "regionName") 38 | private transient Region region; 39 | 40 | public RegionLayer(String regionName, Set requirements, boolean useDefaultModifier, Set modifiers) { 41 | super(requirements, useDefaultModifier, modifiers); 42 | this.regionName = regionName; 43 | } 44 | 45 | @Override 46 | public Class getType() { 47 | return Region.class; 48 | } 49 | 50 | @Override 51 | public Region getObject() { 52 | return region; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/layer/StrengthLayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.layer; 20 | 21 | import com.azortis.orbis.generator.biome.complex.modifier.Modifier; 22 | import com.azortis.orbis.pack.studio.annotations.ArrayType; 23 | import com.azortis.orbis.pack.studio.annotations.Min; 24 | import com.azortis.orbis.pack.studio.annotations.Required; 25 | 26 | import java.util.Map; 27 | import java.util.Set; 28 | 29 | public record StrengthLayer(@Required String tag, @ArrayType(Modifier.class) Set modifiers, 30 | @Required @Min(1) int precision) { 31 | 32 | public double calculate(Map noiseContext, Map strengthContext) { 33 | double strength = 1.0d; 34 | for (Modifier modifier : modifiers) { 35 | strength = modifier.modify(strength, noiseContext, strengthContext); 36 | } 37 | return (double) Math.round(precision * strength) / precision; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/modifier/Modifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.modifier; 20 | 21 | import com.azortis.orbis.pack.studio.annotations.GlobalDefinition; 22 | import com.azortis.orbis.pack.studio.annotations.Typed; 23 | import net.kyori.adventure.key.Key; 24 | 25 | import java.util.Map; 26 | 27 | @Typed 28 | @GlobalDefinition("complex-distributor-modifier") 29 | public abstract class Modifier { 30 | 31 | protected final Key type; 32 | 33 | protected Modifier(Key type) { 34 | this.type = type; 35 | } 36 | 37 | public abstract double modify(double currentStrength, Map noiseContext, Map strengthContext); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/requirement/MaxStrength.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.requirement; 20 | 21 | import net.kyori.adventure.key.Key; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | import java.util.Map; 25 | 26 | public final class MaxStrength extends Requirement { 27 | 28 | private final String tag; 29 | private final double max; 30 | 31 | public MaxStrength(Key type, String tag, double max) { 32 | super(type); 33 | this.tag = tag; 34 | this.max = max; 35 | } 36 | 37 | @Override 38 | public boolean isAchieved(Map context) { 39 | if (context.containsKey(tag)) { 40 | return context.get(tag) <= max; 41 | } else { 42 | throw new IllegalStateException("Tag " + tag + " wasn't found in context!"); 43 | } 44 | } 45 | 46 | @Override 47 | public @NotNull Type getType() { 48 | return Type.STRENGTH; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/requirement/MinStrength.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.requirement; 20 | 21 | import net.kyori.adventure.key.Key; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | import java.util.Map; 25 | 26 | public final class MinStrength extends Requirement { 27 | 28 | private final String tag; 29 | private final double min; 30 | 31 | public MinStrength(Key type, String tag, double min) { 32 | super(type); 33 | this.tag = tag; 34 | this.min = min; 35 | } 36 | 37 | @Override 38 | public boolean isAchieved(Map context) { 39 | if (context.containsKey(tag)) { 40 | return context.get(tag) >= min; 41 | } else { 42 | throw new IllegalStateException("Tag " + tag + " wasn't found in context!"); 43 | } 44 | } 45 | 46 | @Override 47 | public @NotNull Type getType() { 48 | return Type.STRENGTH; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/requirement/NoiseRanges.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.requirement; 20 | 21 | import net.kyori.adventure.key.Key; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | import java.util.Map; 25 | import java.util.Set; 26 | 27 | public final class NoiseRanges extends Requirement { 28 | 29 | private final String tag; 30 | private final Set ranges; 31 | 32 | private NoiseRanges(Key type, String tag, Set ranges) { 33 | super(type); 34 | this.tag = tag; 35 | this.ranges = ranges; 36 | } 37 | 38 | @Override 39 | public boolean isAchieved(Map context) { 40 | if (context.containsKey(tag)) { 41 | double noiseValue = context.get(tag); 42 | for (Range range : ranges) { 43 | if (range.min <= noiseValue && range.max >= noiseValue) return true; 44 | } 45 | } else { 46 | throw new IllegalStateException("Tag " + tag + " wasn't found in context!"); 47 | } 48 | return false; 49 | } 50 | 51 | @Override 52 | public @NotNull Type getType() { 53 | return Type.NOISE; 54 | } 55 | 56 | public record Range(double min, double max) { 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/complex/requirement/Requirement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.biome.complex.requirement; 20 | 21 | import com.azortis.orbis.Registry; 22 | import com.azortis.orbis.pack.studio.annotations.Description; 23 | import com.azortis.orbis.pack.studio.annotations.GlobalDefinition; 24 | import com.azortis.orbis.pack.studio.annotations.Required; 25 | import com.azortis.orbis.pack.studio.annotations.Typed; 26 | import net.kyori.adventure.key.Key; 27 | import org.jetbrains.annotations.NotNull; 28 | 29 | import java.util.Map; 30 | 31 | @Typed 32 | @Description("An object that specifies a requirement for the layer.") 33 | @GlobalDefinition("complex-distributor-requirement") 34 | public abstract class Requirement { 35 | 36 | public static final Registry REGISTRY = new Registry<>(Requirement.class, Map.of( 37 | Key.key("complex:max-strength"), MaxStrength.class, 38 | Key.key("complex:min-strength"), MinStrength.class, 39 | Key.key("complex:noise-ranges"), NoiseRanges.class 40 | )); 41 | 42 | static { 43 | Registry.addRegistry(Requirement.class, REGISTRY); 44 | } 45 | 46 | @Required 47 | @Description("The type of requirement.") 48 | protected final Key type; 49 | 50 | protected Requirement(Key type) { 51 | this.type = type; 52 | } 53 | 54 | public abstract boolean isAchieved(Map context); 55 | 56 | public abstract @NotNull Type getType(); 57 | 58 | public enum Type { 59 | NOISE, 60 | STRENGTH 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/biome/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | /** 20 | * Every piece of the generation pipeline responsible for the distribution and definition of biomes. 21 | */ 22 | package com.azortis.orbis.generator.biome; -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/framework/ChunkStage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.framework; 20 | 21 | import com.azortis.orbis.pack.studio.annotations.Required; 22 | import com.azortis.orbis.pack.studio.annotations.Typed; 23 | import net.kyori.adventure.key.Key; 24 | import org.jetbrains.annotations.NotNull; 25 | 26 | import java.util.random.RandomGenerator; 27 | 28 | @Typed 29 | public abstract class ChunkStage { 30 | 31 | @Required 32 | private final Key type; 33 | 34 | public ChunkStage(@NotNull Key type) { 35 | this.type = type; 36 | } 37 | 38 | public abstract void apply(@NotNull ChunkSnapshot snapshot, @NotNull RandomGenerator random); 39 | 40 | public @NotNull Key type() { 41 | return type; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/framework/WorldStage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.framework; 20 | 21 | import com.azortis.orbis.pack.studio.annotations.Required; 22 | import com.azortis.orbis.pack.studio.annotations.Typed; 23 | import net.kyori.adventure.key.Key; 24 | import org.jetbrains.annotations.NotNull; 25 | 26 | import java.util.random.RandomGenerator; 27 | 28 | @Typed 29 | public abstract class WorldStage { 30 | 31 | @Required 32 | private final Key type; 33 | 34 | public WorldStage(@NotNull Key type) { 35 | this.type = type; 36 | } 37 | 38 | public abstract void apply(@NotNull ChunkSnapshot context, @NotNull WorldSnapshot snapshot, 39 | @NotNull RandomGenerator random); 40 | 41 | public @NotNull Key type() { 42 | return type; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/framework/biome/BiomeSurfaceStage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.framework.biome; 20 | 21 | import com.azortis.orbis.generator.framework.ChunkSnapshot; 22 | import com.azortis.orbis.generator.framework.ChunkStage; 23 | import net.kyori.adventure.key.Key; 24 | import org.jetbrains.annotations.NotNull; 25 | 26 | import java.util.random.RandomGenerator; 27 | 28 | public final class BiomeSurfaceStage extends ChunkStage { 29 | 30 | public BiomeSurfaceStage(@NotNull Key type) { 31 | super(type); 32 | } 33 | 34 | @Override 35 | public void apply(@NotNull ChunkSnapshot snapshot, @NotNull RandomGenerator random) { 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/framework/object/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | /** 20 | * A collection of utilities that assist with generating objects/features/structures. 21 | * Primarily focused on the concept that each platform does not or have limited support 22 | * for cross chunk object generation. 23 | */ 24 | package com.azortis.orbis.generator.framework.object; -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/interpolation/HeightProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.interpolation; 20 | 21 | @FunctionalInterface 22 | public interface HeightProvider { 23 | double getHeight(double x, double z); 24 | } 25 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/noise/OpenSimplex2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.noise; 20 | 21 | import com.azortis.orbis.pack.Invoke; 22 | import net.kyori.adventure.key.Key; 23 | import org.jetbrains.annotations.Nullable; 24 | 25 | public final class OpenSimplex2 extends Noise { 26 | 27 | private transient FastNoise noise; 28 | 29 | public OpenSimplex2(@Nullable String name, Key type, long seed, double frequency) { 30 | super(name, type, seed, frequency); 31 | } 32 | 33 | @Invoke 34 | @SuppressWarnings("unused") 35 | private void setupNoise() { 36 | noise = new FastNoise(); 37 | noise.setNoiseType(FastNoise.NoiseType.OpenSimplex2); 38 | noise.setSeed(getNoiseSeed()); 39 | noise.setFrequency(frequency); 40 | } 41 | 42 | @Override 43 | public double noise(double x) { 44 | return noise.getNoise(x, 0); 45 | } 46 | 47 | @Override 48 | public double noise(double x, double z) { 49 | return noise.getNoise(x, z); 50 | } 51 | 52 | @Override 53 | public double noise(double x, double y, double z) { 54 | return noise.getNoise(x, y, z); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/noise/OpenSimplex2S.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.noise; 20 | 21 | import com.azortis.orbis.pack.Invoke; 22 | import net.kyori.adventure.key.Key; 23 | import org.jetbrains.annotations.Nullable; 24 | 25 | public final class OpenSimplex2S extends Noise { 26 | 27 | private transient FastNoise noise; 28 | 29 | public OpenSimplex2S(@Nullable String name, Key type, long seed, double frequency) { 30 | super(name, type, seed, frequency); 31 | } 32 | 33 | @Invoke 34 | @SuppressWarnings("unused") 35 | private void setupNoise() { 36 | noise = new FastNoise(); 37 | noise.setNoiseType(FastNoise.NoiseType.OpenSimplex2S); 38 | noise.setSeed(getNoiseSeed()); 39 | noise.setFrequency(frequency); 40 | } 41 | 42 | @Override 43 | public double noise(double x) { 44 | return noise.getNoise(x, 0); 45 | } 46 | 47 | @Override 48 | public double noise(double x, double z) { 49 | return noise.getNoise(x, z); 50 | } 51 | 52 | @Override 53 | public double noise(double x, double y, double z) { 54 | return noise.getNoise(x, y, z); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/point/GatheredPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.point; 20 | 21 | import lombok.Getter; 22 | import lombok.Setter; 23 | 24 | /** 25 | * Credits to k.jpg from FastNoise for making this class. 26 | * 27 | * @param The type tag of the point gatherer. 28 | */ 29 | @Getter 30 | public class GatheredPoint { 31 | private final double x, z; 32 | private final int hash; 33 | @Setter 34 | private TTag tag; 35 | 36 | public GatheredPoint(double x, double z, int hash) { 37 | this.x = x; 38 | this.z = z; 39 | this.hash = hash; 40 | } 41 | } -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/surface/Surface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.surface; 20 | 21 | import com.azortis.orbis.generator.biome.Biome; 22 | import com.azortis.orbis.generator.framework.ChunkSnapshot; 23 | import com.azortis.orbis.pack.Inject; 24 | import com.azortis.orbis.pack.studio.annotations.Typed; 25 | import com.azortis.orbis.world.World; 26 | import lombok.Getter; 27 | import net.kyori.adventure.key.Key; 28 | import org.jetbrains.annotations.NotNull; 29 | 30 | @Getter 31 | @Typed 32 | @Inject 33 | public abstract class Surface { 34 | 35 | protected final String name; 36 | protected final Key type; 37 | 38 | @Inject 39 | private transient World world; 40 | @Inject(isChild = true) 41 | private transient Biome biome; 42 | 43 | protected Surface(@NotNull String name, @NotNull Key type) { 44 | this.name = name; 45 | this.type = type; 46 | } 47 | 48 | public abstract double getSurfaceHeight(final int x, final int z, @NotNull ChunkSnapshot snapshot); 49 | 50 | public String name() { 51 | return name; 52 | } 53 | 54 | public Key type() { 55 | return type; 56 | } 57 | 58 | public World world() { 59 | return world; 60 | } 61 | 62 | public Biome biome() { 63 | return biome; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/surface/defaults/ConfigSurface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.surface.defaults; 20 | 21 | import com.azortis.orbis.generator.framework.ChunkSnapshot; 22 | import com.azortis.orbis.generator.noise.Noise; 23 | import com.azortis.orbis.generator.surface.Surface; 24 | import com.azortis.orbis.pack.Inject; 25 | import com.google.gson.annotations.SerializedName; 26 | import net.kyori.adventure.key.Key; 27 | import org.jetbrains.annotations.NotNull; 28 | 29 | import java.util.List; 30 | 31 | public class ConfigSurface extends Surface { 32 | 33 | @SerializedName("noise") 34 | private final String noiseName; 35 | private final List layers; 36 | @Inject(fieldName = "noiseName") 37 | private transient Noise noise; 38 | 39 | private ConfigSurface(@NotNull String name, @NotNull Key type, 40 | @NotNull String noiseName, @NotNull List layers) { 41 | super(name, type); 42 | this.noiseName = noiseName; 43 | this.layers = layers; 44 | } 45 | 46 | @Override 47 | public double getSurfaceHeight(int x, int z, @NotNull ChunkSnapshot snapshot) { 48 | double height = 0; 49 | for (NoiseLayer layer : layers) { 50 | height += (noise.noise(x / layer.zoom, z / layer.zoom) * layer.coefficient); 51 | } 52 | return super.getBiome().baseHeight() + height; 53 | } 54 | 55 | private static class NoiseLayer { 56 | double coefficient; 57 | double zoom; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/generator/surface/defaults/PlainsSurface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.generator.surface.defaults; 20 | 21 | import com.azortis.orbis.generator.framework.ChunkSnapshot; 22 | import com.azortis.orbis.generator.noise.Noise; 23 | import com.azortis.orbis.generator.surface.Surface; 24 | import com.azortis.orbis.pack.Inject; 25 | import com.google.gson.annotations.SerializedName; 26 | import net.kyori.adventure.key.Key; 27 | import org.jetbrains.annotations.NotNull; 28 | 29 | public class PlainsSurface extends Surface { 30 | 31 | @SerializedName("noise") 32 | private final String noiseName; 33 | 34 | @Inject(fieldName = "noiseName") 35 | private transient Noise noise; 36 | 37 | private PlainsSurface(String name, Key type, String noiseName) { 38 | super(name, type); 39 | this.noiseName = noiseName; 40 | } 41 | 42 | @Override 43 | public double getSurfaceHeight(int x, int z, @NotNull ChunkSnapshot snapshot) { 44 | double height = noise.noise(x / 400f, z / 400f) * 30; 45 | height += noise.noise(x / 50f, z / 50f) * 3; 46 | height += Math.abs(noise.noise(x / 12f, z / 12f) * 1); 47 | return super.getBiome().baseHeight() + height; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/inventory/Enchantment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.inventory; 20 | 21 | import net.kyori.adventure.key.Key; 22 | import net.kyori.adventure.key.Keyed; 23 | import org.jetbrains.annotations.Contract; 24 | import org.jetbrains.annotations.NotNull; 25 | 26 | public interface Enchantment extends Keyed { 27 | 28 | @Contract(pure = true) 29 | static @NotNull Enchantment fromKey(@NotNull Key key) { 30 | return null; 31 | } 32 | 33 | static @NotNull Enchantment fromKey(@NotNull String key) { 34 | return null; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/inventory/Inventory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.inventory; 20 | 21 | public interface Inventory { 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/inventory/InventoryFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.inventory; 20 | 21 | public interface InventoryFactory { 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/inventory/Item.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.inventory; 20 | 21 | public interface Item { 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/inventory/ItemFlag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.inventory; 20 | 21 | public enum ItemFlag { 22 | HIDE_ENCHANTS, 23 | HIDE_ATTRIBUTES, 24 | HIDE_UNBREAKABLE, 25 | HIDE_CAN_DESTROY, 26 | HIDE_CAN_PLACE, 27 | HIDE_MISCELLANEOUS, 28 | HIDE_DYE 29 | } 30 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/Invoke.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * Used to annotate a method in a {@link Class} that has been annotated with {@link Inject} 28 | * this method will be called before depending on {@link Order} 29 | * 30 | * @author Jake Nijssen 31 | * @since 0.3-Alpha 32 | */ 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target(ElementType.METHOD) 35 | public @interface Invoke { 36 | /** 37 | * When the method should be invoked, see {@link Order} 38 | * 39 | * @since 0.3-Alpha 40 | */ 41 | Order when() default Order.POST_CLASS_INJECTION; 42 | 43 | /** 44 | * Defines when the method invocation should happen during pack loading. 45 | * 46 | * @author Jake Nijssen 47 | * @since 0.3-Alpha 48 | */ 49 | enum Order { 50 | /** 51 | * Before any injection of the class takes place 52 | */ 53 | PRE_INJECTION, 54 | 55 | /** 56 | * After the fields annotated with {@link Inject} have been injected in the {@link Class} 57 | * but before any of the field objects itself have been injected 58 | */ 59 | MID_INJECTION, 60 | 61 | /** 62 | * After all the injection of this class and its subsequent children have taken place 63 | */ 64 | POST_CLASS_INJECTION, 65 | 66 | /** 67 | * After all the injection has taken place 68 | */ 69 | POST_INJECTION 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/Validate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack; 20 | 21 | import java.lang.annotation.*; 22 | 23 | /** 24 | * Invokes the annotated {@link java.lang.reflect.Method} once the entire {@link com.azortis.orbis.generator.Dimension} 25 | * object tree is loaded. Used for validating code compatibility. 26 | * 27 | * @author Jake Nijssen 28 | * @since 0.3-Alpha 29 | */ 30 | @Documented 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target(ElementType.METHOD) 33 | public @interface Validate { 34 | } 35 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/adapter/KeyAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.adapter; 20 | 21 | import com.google.gson.*; 22 | import net.kyori.adventure.key.Key; 23 | 24 | import java.lang.reflect.Type; 25 | 26 | public final class KeyAdapter implements JsonSerializer, JsonDeserializer { 27 | 28 | @Override 29 | public JsonElement serialize(Key key, Type type, JsonSerializationContext context) { 30 | return context.serialize(key.asString(), String.class); 31 | } 32 | 33 | @SuppressWarnings("PatternValidation") 34 | @Override 35 | public Key deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { 36 | return Key.key(context.deserialize(json, String.class)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/adapter/TypeAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.adapter; 20 | 21 | import com.azortis.orbis.Registry; 22 | import com.google.gson.*; 23 | import net.kyori.adventure.key.Key; 24 | 25 | import java.lang.reflect.Type; 26 | 27 | public final class TypeAdapter implements JsonDeserializer { 28 | 29 | private final Class clazz; 30 | 31 | public TypeAdapter(Class clazz) { 32 | this.clazz = clazz; 33 | } 34 | 35 | @Override 36 | public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 37 | final JsonPrimitive object = json.getAsJsonObject().getAsJsonPrimitive("type"); 38 | final Key key = context.deserialize(object, Key.class); 39 | final Class type = Registry.getRegistry(clazz).getType(key); 40 | return context.deserialize(json, type); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/data/Component.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.data; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * Used to annotate classes that provide their own {@link ComponentAccess}. 28 | * If the injector comes across a component annotated with this, it will construct the 29 | * {@link ComponentAccess} instance and add it to the corresponding {@link DataAccess}. 30 | * Only works on classes that are implementations of specified types defined in {@link DataAccess#GENERATOR_TYPES}. 31 | *

32 | * It will also be used when looking for types to create a json schema for. 33 | * 34 | * @author Jake Nijssen 35 | * @since 0.3-Alpha 36 | */ 37 | @Retention(RetentionPolicy.RUNTIME) 38 | @Target(ElementType.TYPE) 39 | public @interface Component { 40 | 41 | /** 42 | * The type of the {@link ComponentAccess} implementation. 43 | * 44 | * @return The type of the {@link ComponentAccess} implementation. 45 | */ 46 | Class value(); 47 | } 48 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/ArrayType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * The {@link Class} in the {@link java.util.Collection} of the {@link java.lang.reflect.Field} annotated 27 | * by this method, this is used to evaluate which schema to use by the generator. 28 | * This is required due to java type erasure. 29 | * 30 | * @author Jake Nijssen 31 | * @see Java type erasure 32 | * @since 0.3-Alpha 33 | */ 34 | @Documented 35 | @Retention(RetentionPolicy.RUNTIME) 36 | @Target(ElementType.FIELD) 37 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 38 | public @interface ArrayType { 39 | 40 | /** 41 | * The class inside the annotated {@link java.util.Collection}. 42 | * 43 | * @return The parameterized class type. 44 | */ 45 | Class value(); 46 | } 47 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/Description.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * A mandatory annotation on all {@link java.lang.reflect.Field}'s and {@link Class}es that are part 27 | * of the generator. The value inside of this annotation will be shown to the user when hovering over that element. 28 | * 29 | * @author Jake Nijssen 30 | * @since 0.3-Alpha 31 | */ 32 | @Documented 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target({ElementType.FIELD, ElementType.TYPE}) 35 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 36 | public @interface Description { 37 | 38 | /** 39 | * The description text to show when hovering. 40 | * 41 | * @return A description about the type/field. 42 | */ 43 | String value(); 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/Entries.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Forces the {@link String} value of a field or inside a {@link java.util.Collection} to be a reference 27 | * to a datafile of the specified type. 28 | * The names for these files are by {@link com.azortis.orbis.pack.data.DataAccess#getDataEntries(Class)}, 29 | * if the specified type is a component type, then it will only produce entries inside a component instance. 30 | * 31 | * @author Jake Nijssen 32 | * @since 0.3-Alpha 33 | */ 34 | @Documented 35 | @Retention(RetentionPolicy.RUNTIME) 36 | @Target(ElementType.FIELD) 37 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 38 | public @interface Entries { 39 | 40 | /** 41 | * The type to validate the data file names against. 42 | * 43 | * @return The entries datatype. 44 | */ 45 | Class value(); 46 | } 47 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/GlobalDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Mark classes of which its schema definitions are reused. 27 | * This will tell the schema generator to create a global schema definition file for this {@link Class} type. 28 | *

29 | * Classes annotated with this cannot access component {@link Entries} for any of its fields, as it is unknown 30 | * at schema generation if a global definition is used in a {@link com.azortis.orbis.pack.data.Component} environment or not. 31 | * 32 | * @author Jake Nijssen 33 | * @since 0.3-Alpha 34 | */ 35 | @Inherited 36 | @Documented 37 | @Retention(RetentionPolicy.RUNTIME) 38 | @Target(ElementType.TYPE) 39 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 40 | public @interface GlobalDefinition { 41 | /** 42 | * The name of the definitions file, i.e. "Vec3i" will produce "Vec3i.json" 43 | * The name should be unique and cannot clash with other definitions, so use truly unique names. 44 | * 45 | * @return The name of the definitions file. 46 | * @since 0.3-Alpha 47 | */ 48 | String value(); 49 | } 50 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/Ignore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Marks non-transient/static fields to be excluded from the generated json schema. 27 | * 28 | * @author Jake Nijssen 29 | * @since 0.3-Alpha 30 | */ 31 | @Documented 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.FIELD) 34 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 35 | public @interface Ignore { 36 | } 37 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/InheritFields.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | 22 | import org.apiguardian.api.API; 23 | 24 | import java.lang.annotation.*; 25 | 26 | /** 27 | *

Used to mark a {@link Class} whose fields should be seen as a property 28 | * in the {@link Class} that is extending the annotated {@link Class}.

29 | * 30 | *

Note do not use on abstract classes in combination with {@link Typed} this will 31 | * otherwise lead to duplicate properties in the schema.

32 | * 33 | * @author Jake Nijssen 34 | * @since 0.3-Alpha 35 | */ 36 | @Documented 37 | @Retention(RetentionPolicy.RUNTIME) 38 | @Target(ElementType.TYPE) 39 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 40 | public @interface InheritFields { 41 | } 42 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/Max.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Sets the maximum value an {@link Number} can be of a {@link java.lang.reflect.Field} 27 | * or {@link java.util.Collection} entry. 28 | * 29 | * @author Jake Nijssen 30 | * @since 0.3-Alpha 31 | */ 32 | @Documented 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target(ElementType.FIELD) 35 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 36 | public @interface Max { 37 | 38 | /** 39 | * The maximum value if the annotated type is an integer. 40 | * 41 | * @return The minimum integer value for the field/entry. 42 | */ 43 | long value() default Long.MAX_VALUE; 44 | 45 | /** 46 | * The maximum value if the annotated type is a floating point number. 47 | * 48 | * @return The minimum floating point value for the field/entry. 49 | */ 50 | double floating() default Double.MAX_VALUE; 51 | } 52 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/MaxItems.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Sets the maximum amount of entries allowed on the annotated {@link java.util.Collection}. 27 | * 28 | * @author Jake Nijssen 29 | * @since 0.3-Alpha 30 | */ 31 | @Documented 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.FIELD) 34 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 35 | public @interface MaxItems { 36 | 37 | /** 38 | * @return The maximum amount of entries required. 39 | */ 40 | long value() default Long.MAX_VALUE; 41 | } 42 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/Min.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Sets the minimum value an {@link Number} can be of a {@link java.lang.reflect.Field} 27 | * or {@link java.util.Collection} entry. 28 | * 29 | * @author Jake Nijssen 30 | * @since 0.3-Alpha 31 | */ 32 | @Documented 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target(ElementType.FIELD) 35 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 36 | public @interface Min { 37 | 38 | /** 39 | * The minimum value if the annotated type is an integer. 40 | * 41 | * @return The minimum integer value for the field/entry. 42 | */ 43 | long value() default Long.MIN_VALUE; 44 | 45 | /** 46 | * The minimum value if the annotated type is a floating point number. 47 | * 48 | * @return The minimum floating point value for the field/entry. 49 | */ 50 | double floating() default Double.MIN_VALUE; 51 | } 52 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/MinItems.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Sets the minimum amount of entries required on the annotated {@link java.util.Collection}. 27 | * 28 | * @author Jake Nijssen 29 | * @since 0.3-Alpha 30 | */ 31 | @Documented 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.FIELD) 34 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 35 | public @interface MinItems { 36 | 37 | /** 38 | * @return The minimum amount of entries required. Cannot be lower than 1. 39 | */ 40 | long value() default 1; 41 | } 42 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/Required.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Used to mark a {@link java.lang.reflect.Field} as required in the generated json schema. 27 | * 28 | * @author Jake Nijssen 29 | * @since 0.3-Alpha 30 | */ 31 | @Documented 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.FIELD) 34 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 35 | public @interface Required { 36 | } 37 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/SupportAnonymous.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Used by {@link com.azortis.orbis.pack.data.DataAccess#GENERATOR_TYPES} that can be embedded anonymously 27 | * in other config files, this will override the {@link Required} property on the declared field {@link SupportAnonymous#value()} 28 | * meaning that that field won't be required in embedded environments, but still will be in environments where it is a 29 | * standalone file. 30 | * 31 | * @author Jake Nijssen 32 | * @since 0.3-Alpha 33 | */ 34 | @Documented 35 | @Retention(RetentionPolicy.RUNTIME) 36 | @Target(ElementType.TYPE) 37 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 38 | public @interface SupportAnonymous { 39 | 40 | /** 41 | * The name of the field to overrule the {@link Required} when in an embedded environment, 42 | * defaults to "name". 43 | * 44 | * @return The field name to overrule. 45 | * @since 0.3-Alpha 46 | */ 47 | String value() default "name"; 48 | } 49 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/Typed.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import com.azortis.orbis.Registry; 22 | import org.apiguardian.api.API; 23 | 24 | import java.lang.annotation.*; 25 | 26 | /** 27 | *

Marks a class as typed, meaning it can have different implementations based on the provided 28 | * type {@link net.kyori.adventure.key.Key} field. All classes using this typed based system 29 | * must register a {@link com.azortis.orbis.Registry} for the class using the following method 30 | * {@link com.azortis.orbis.Registry#addRegistry(Class, Registry)}

31 | * 32 | *

Note It is recommended to locate the registry statically in the class, and use a static block to 33 | * register the registry.

34 | * 35 | * @author Jake Nijssen 36 | * @since 0.3-Alpha 37 | */ 38 | @Documented 39 | @Retention(RetentionPolicy.RUNTIME) 40 | @Target(ElementType.TYPE) 41 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 42 | public @interface Typed { 43 | } 44 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/Unique.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.annotations; 20 | 21 | import org.apiguardian.api.API; 22 | 23 | import java.lang.annotation.*; 24 | 25 | /** 26 | * Forces entries inside a {@link java.util.Collection} to be unique. 27 | * 28 | * @author Jake Nijssen 29 | * @since 0.3-Alpha 30 | */ 31 | @Documented 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.FIELD) 34 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 35 | public @interface Unique { 36 | } 37 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/annotations/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | /** 20 | * Annotations used to define metadata of {@link java.lang.reflect.Field}'s and 21 | * {@link java.lang.Class}es to validate the values of these fields and classes against the generated 22 | * json schema's 23 | */ 24 | package com.azortis.orbis.pack.studio.annotations; -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/pack/studio/schema/EntriesBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.pack.studio.schema; 20 | 21 | import com.azortis.orbis.pack.studio.Project; 22 | import com.azortis.orbis.pack.studio.StudioDataAccess; 23 | import com.google.gson.JsonArray; 24 | import com.google.gson.JsonObject; 25 | import org.jetbrains.annotations.NotNull; 26 | import org.jetbrains.annotations.Nullable; 27 | 28 | import java.io.File; 29 | 30 | public final class EntriesBuilder extends SchemaBuilder { 31 | 32 | private final JsonObject schema = new JsonObject(); 33 | private final Class type; 34 | private final String name; 35 | 36 | EntriesBuilder(@NotNull Project project, @NotNull StudioDataAccess data, @NotNull SchemaManager schemaManager, 37 | @NotNull File schemaFile, @NotNull Class type, @Nullable String name) { 38 | super(project, data, schemaManager, schemaFile); 39 | this.type = type; 40 | this.name = name; 41 | 42 | // Create initial schema 43 | schema.addProperty("$schema", "http://json-schema.org/draft-07/schema"); 44 | schema.addProperty("type", "string"); 45 | } 46 | 47 | @Override 48 | protected @NotNull JsonObject generateSchema() { 49 | if (schema.has("enum")) schema.remove("enum"); 50 | JsonArray entries = new JsonArray(); 51 | if (name == null) { 52 | data.getDataEntries(type).forEach(entries::add); 53 | } else { 54 | // For components make sure to append the component name 55 | data.getDataEntries(type, name).forEach(entries::add); 56 | } 57 | if (entries.isEmpty()) entries.add("NONE"); 58 | schema.add("enum", entries); 59 | return schema; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/Axis.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util; 20 | 21 | import org.apiguardian.api.API; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | /** 25 | * An enum that represents an object that is aligned to a certain axis. 26 | * 27 | * @author Jake Nijssen 28 | * @since 0.3-Alpha 29 | */ 30 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 31 | public enum Axis implements Nameable { 32 | /** 33 | * Represents an alignment on the x-axis. 34 | */ 35 | X("x"), 36 | 37 | /** 38 | * Represents an alignment on the y-axis. 39 | */ 40 | Y("y"), 41 | 42 | /** 43 | * Represents an alignment on the z-axis. 44 | */ 45 | Z("z"); 46 | 47 | /** 48 | * The serialized name of the axis. 49 | */ 50 | private final String name; 51 | 52 | Axis(String name) { 53 | this.name = name; 54 | } 55 | 56 | /** 57 | * Get the String representation of this axis. 58 | * 59 | * @return The string representation of this axis. 60 | * @since 0.3-Alpha 61 | */ 62 | @Override 63 | public String toString() { 64 | return this.name; 65 | } 66 | 67 | 68 | /** 69 | * {@inheritDoc} 70 | */ 71 | @Override 72 | public @NotNull String serializedName() { 73 | return this.name; 74 | } 75 | 76 | 77 | /** 78 | * Get the axis when the current one is rotated by specified rotation. 79 | * 80 | * @param rotation The rotation to apply. 81 | * @return The rotated axis, same if the current Axis is Y or when the specified rotation is NONE or FLIP. 82 | * @since 0.3-Alpha 83 | */ 84 | public @NotNull Axis rotate(@NotNull Rotation rotation) { 85 | if (this == Y || rotation == Rotation.NONE || rotation == Rotation.FLIP) return this; 86 | return switch (this) { 87 | case X -> Z; 88 | case Z -> X; 89 | default -> throw new IllegalStateException("This shouldn't happen."); 90 | }; 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/BoundingBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util; 20 | 21 | import org.jetbrains.annotations.NotNull; 22 | 23 | public record BoundingBox(@NotNull BlockPos min, @NotNull BlockPos max) { 24 | 25 | public BoundingBox(@NotNull BlockPos min, @NotNull BlockPos max) { 26 | int minX = Math.min(min.x(), max.x()); 27 | int minY = Math.min(min.y(), max.y()); 28 | int minZ = Math.min(min.z(), max.z()); 29 | this.min = new BlockPos(minX, minY, minZ); 30 | 31 | int maxX = Math.max(min.x(), max.x()); 32 | int maxY = Math.max(min.x(), max.x()); 33 | int maxZ = Math.max(min.x(), max.x()); 34 | this.max = new BlockPos(maxX, maxY, maxZ); 35 | } 36 | 37 | public int minX() { 38 | return min.x(); 39 | } 40 | 41 | public int minY() { 42 | return min.y(); 43 | } 44 | 45 | public int minZ() { 46 | return min.z(); 47 | } 48 | 49 | public int maxX() { 50 | return max.x(); 51 | } 52 | 53 | public int maxY() { 54 | return max.y(); 55 | } 56 | 57 | public int maxZ() { 58 | return max.z(); 59 | } 60 | 61 | public boolean checkBounds(int x, int y, int z) { 62 | return (minX() <= x && x <= maxX()) && (minY() <= y && y <= maxY()) && (minZ() <= z && z <= maxZ()); 63 | } 64 | 65 | public boolean checkBounds(@NotNull BlockPos pos) { 66 | return checkBounds(pos.x(), pos.y(), pos.z()); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/Nameable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util; 20 | 21 | import org.apiguardian.api.API; 22 | import org.jetbrains.annotations.Contract; 23 | import org.jetbrains.annotations.NotNull; 24 | 25 | /** 26 | * An interface that marks an object that has a specific serialized name string. 27 | * 28 | * @author Jake Nijssen 29 | * @since 0.3-Alpha 30 | */ 31 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 32 | public interface Nameable { 33 | 34 | /** 35 | * Get the serialized name for this object. 36 | * 37 | * @return The serialized name of the object. 38 | * @since 0.3-Alpha 39 | */ 40 | @Contract(pure = true) 41 | @API(status = API.Status.STABLE, since = "0.3-Alpha") 42 | @NotNull 43 | String serializedName(); 44 | } 45 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/annotations/AbsoluteCoords.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util.annotations; 20 | 21 | import java.lang.annotation.*; 22 | 23 | /** 24 | * Marks that the {@link Integer} or {@link Double} parameters of the annotated {@link java.lang.reflect.Constructor}, 25 | * {@link java.lang.reflect.Method} or record parameters should be absolute coordinates in the world. 26 | * 27 | * @author Jake Nijssen 28 | * @since 0.3-Alpha 29 | */ 30 | @Documented 31 | @Retention(RetentionPolicy.SOURCE) 32 | @Target({ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD}) 33 | public @interface AbsoluteCoords { 34 | } 35 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/annotations/ChunkCoords.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util.annotations; 20 | 21 | import java.lang.annotation.*; 22 | 23 | /** 24 | *

Marks that the {@link Integer} parameters of the annotated {@link java.lang.reflect.Constructor}, 25 | * {@link java.lang.reflect.Method} or record parameters should be chunk coordinates.

26 | * 27 | *

To get the chunk coordinate from a block coordinate you do: {@code int chunkCoord = blockCoord >> 4;}

28 | * 29 | * @author Jake Nijssen 30 | * @since 0.3-Alpha 31 | */ 32 | @Documented 33 | @Retention(RetentionPolicy.SOURCE) 34 | @Target({ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD}) 35 | public @interface ChunkCoords { 36 | } 37 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/annotations/RelativeCoords.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util.annotations; 20 | 21 | import java.lang.annotation.*; 22 | 23 | /** 24 | *

Marks that the {@link Integer} parameters of the annotated {@link java.lang.reflect.Constructor}, 25 | * {@link java.lang.reflect.Method} or record parameters should be relative coords of the given object.

26 | * 27 | *

A good example of this are block coordinates inside a {@link com.azortis.orbis.world.ChunkAccess}, 28 | * where block coordinates range from 0-15

29 | * 30 | * @author Jake Nijssen 31 | * @since 0.3-Alpha 32 | */ 33 | @Documented 34 | @Retention(RetentionPolicy.SOURCE) 35 | @Target({ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD}) 36 | public @interface RelativeCoords { 37 | } 38 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/annotations/SectionCoords.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util.annotations; 20 | 21 | import java.lang.annotation.*; 22 | 23 | /** 24 | *

Marks that the {@link Integer} parameters of the annotated {@link java.lang.reflect.Constructor}, 25 | * {@link java.lang.reflect.Method} or record parameters should be section coordinates.

26 | * 27 | *

Section coordinates are basically zoomed out real coordinates. A good example that uses section 28 | * coordinates are BiomeSections, since biomes are saved in 4x4x4 block sections.

29 | * 30 | *

To get the section coord from a block coordinate you do: {@code int sectionCoord = blockCoord >> 2;}

31 | * 32 | * @author Jake Nijssen 33 | * @since 0.3-Alpha 34 | */ 35 | @Documented 36 | @Retention(RetentionPolicy.SOURCE) 37 | @Target({ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD}) 38 | public @interface SectionCoords { 39 | } 40 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/math/Point2i.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util.math; 20 | 21 | import org.jetbrains.annotations.Contract; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public record Point2i(int x, int z) { 25 | 26 | public static final Point2i ZERO = new Point2i(0, 0); 27 | 28 | @Contract("_ -> new") 29 | public @NotNull Point2i setX(final int x) { 30 | return new Point2i(x, z); 31 | } 32 | 33 | @Contract("_ -> new") 34 | public @NotNull Point2i setZ(final int z) { 35 | return new Point2i(x, z); 36 | } 37 | 38 | @Contract(pure = true) 39 | public double distanceSq(@NotNull Point2i point) { 40 | return Math.pow(x - point.x, 2) + Math.pow(z - point.z, 2); 41 | } 42 | 43 | @Contract(pure = true) 44 | public double distance(@NotNull Point2i point) { 45 | return Math.sqrt(distanceSq(point)); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/math/Point3i.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util.math; 20 | 21 | import org.jetbrains.annotations.Contract; 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | public record Point3i(int x, int y, int z) { 25 | 26 | public static final Point3i ZERO = new Point3i(0, 0, 0); 27 | 28 | @Contract("_ -> new") 29 | public @NotNull Point3i setX(final int x) { 30 | return new Point3i(x, y, z); 31 | } 32 | 33 | @Contract("_ -> new") 34 | public @NotNull Point3i setY(final int y) { 35 | return new Point3i(x, y, z); 36 | } 37 | 38 | @Contract("_ -> new") 39 | public @NotNull Point3i setZ(final int z) { 40 | return new Point3i(x, y, z); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/maven/Dependencies.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util.maven; 20 | 21 | import javax.annotation.Nonnull; 22 | import java.lang.annotation.Documented; 23 | import java.lang.annotation.ElementType; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.Target; 26 | 27 | /** 28 | * Annotation containing an array of {@link Dependency} for a plugin. 29 | */ 30 | @Documented 31 | @Target(ElementType.TYPE) 32 | @Retention(java.lang.annotation.RetentionPolicy.RUNTIME) 33 | public @interface Dependencies { 34 | 35 | /** 36 | * The {@link Dependency}s for the plugin. 37 | * 38 | * @return The {@link Dependency}s for the plugin. 39 | */ 40 | @Nonnull 41 | Dependency[] value() default {}; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/maven/Dependency.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util.maven; 20 | 21 | import javax.annotation.Nonnull; 22 | import java.lang.annotation.*; 23 | 24 | /** 25 | * Represents a dependency that a plugin requires to function. 26 | */ 27 | @Documented 28 | @Repeatable(Dependencies.class) 29 | @Target(ElementType.TYPE) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | public @interface Dependency { 32 | /** 33 | * The group ID of the dependency. 34 | * 35 | * @return The group ID of the dependency. 36 | */ 37 | @Nonnull 38 | String group(); 39 | 40 | /** 41 | * The artifact ID of the dependency. 42 | * 43 | * @return The artifact ID of the dependency. 44 | */ 45 | @Nonnull 46 | String artifact(); 47 | 48 | /** 49 | * The version of the dependency. 50 | * 51 | * @return The version of the dependency. 52 | */ 53 | @Nonnull 54 | String version(); 55 | 56 | /** 57 | * The repository of the dependency. 58 | * 59 | * @return The repository of the dependency. 60 | */ 61 | @Nonnull 62 | Repository repository() default @Repository(url = "https://repo.maven.apache.org/maven2/"); 63 | 64 | /** 65 | * The type of dependency. 66 | * 67 | * @return The type of dependency. 68 | */ 69 | @Nonnull 70 | DependencyType type() default DependencyType.REQUIRED; 71 | 72 | /** 73 | * The type of dependency. 74 | */ 75 | enum DependencyType { 76 | /** 77 | * A dependency that is required to function. 78 | */ 79 | REQUIRED, 80 | /** 81 | * A dependency that is optional to function. 82 | */ 83 | OPTIONAL 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/util/maven/Repository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.util.maven; 20 | 21 | import javax.annotation.Nonnull; 22 | import java.lang.annotation.*; 23 | 24 | /** 25 | * Representation of a repository. 26 | */ 27 | @Documented 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target(ElementType.LOCAL_VARIABLE) 30 | public @interface Repository { 31 | 32 | /** 33 | * The url of the repository. 34 | * 35 | * @return url of the repository 36 | */ 37 | @Nonnull 38 | String url(); 39 | } 40 | -------------------------------------------------------------------------------- /orbis-core/src/main/java/com/azortis/orbis/world/WorldAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.world; 20 | 21 | import com.azortis.orbis.entity.Player; 22 | import org.jetbrains.annotations.NotNull; 23 | import org.jetbrains.annotations.Unmodifiable; 24 | 25 | import java.util.Set; 26 | import java.util.concurrent.CompletableFuture; 27 | 28 | /** 29 | * Interface to interact with the platforms world. 30 | */ 31 | public interface WorldAccess { 32 | 33 | @NotNull 34 | String name(); 35 | 36 | boolean isWorldLoaded(); 37 | 38 | int minHeight(); 39 | 40 | int maxHeight(); 41 | 42 | @Unmodifiable @NotNull Set getPlayers(); 43 | 44 | boolean isChunkGenerated(int chunkX, int chunkZ); 45 | 46 | boolean isChunkLoaded(int chunkX, int chunkZ); 47 | 48 | @NotNull @Unmodifiable Set getLoadedChunks(); 49 | 50 | @NotNull ChunkAccess getChunk(int chunkX, int chunkZ); 51 | 52 | default @NotNull CompletableFuture getChunkAsync(int chunkX, int chunkZ) { 53 | return CompletableFuture.supplyAsync(() -> getChunk(chunkX, chunkZ)); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /orbis-core/src/test/java/com/azortis/orbis/BlocksTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis; 20 | 21 | import org.junit.jupiter.api.Test; 22 | 23 | public class BlocksTest { 24 | 25 | @Test 26 | public void testBlocks() { 27 | /*Orbis.initialize(new MockPlatform()); 28 | assertTrue(BlockRegistry.isLoaded()); 29 | assertTrue(ItemRegistry.isLoaded()); 30 | assertNotNull(Blocks.ACACIA_DOOR); 31 | assertSame(Properties.NOTE_BLOCK_INSTRUMENT.getValue("HARP"), NoteBlockInstrument.HARP); 32 | assertSame(Blocks.GRASS_BLOCK.defaultState().setValue(Properties.SNOWY, true), BlockRegistry.fromStateId(8)); 33 | assertSame(Blocks.STONE.item(), Items.STONE);*/ 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /orbis-generators/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | plugins { 20 | java 21 | application 22 | } 23 | 24 | group = "com.azortis" 25 | version = project(":orbis-core").version; 26 | 27 | application { 28 | mainClass.set("com.azortis.orbis.codegen.Generators") 29 | } 30 | 31 | repositories { 32 | mavenCentral() 33 | maven { 34 | url = uri("https://jitpack.io") 35 | } 36 | } 37 | 38 | dependencies { 39 | implementation(project(":orbis-core")) 40 | implementation("com.google.code.gson:gson:2.8.9") 41 | implementation("org.jetbrains:annotations:16.0.1") 42 | implementation("net.kyori:adventure-api:4.9.3") 43 | implementation("com.squareup:javapoet:1.13.0") 44 | implementation("com.google.guava:guava:31.0.1-jre") 45 | implementation("org.apache.logging.log4j:log4j-core:2.14.1") 46 | implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.14.1") 47 | implementation("it.unimi.dsi:fastutil:8.5.6") 48 | } 49 | 50 | java { 51 | toolchain { 52 | languageVersion.set(JavaLanguageVersion.of(17)) 53 | } 54 | } 55 | 56 | tasks { 57 | run { 58 | run.get().setArgsString( 59 | "$" + project.rootProject.childProjects["orbis-core"]!!.projectDir.invariantSeparatorsPath + 60 | "/src/generated/java$" 61 | ) 62 | } 63 | } -------------------------------------------------------------------------------- /orbis-generators/src/main/java/com/azortis/orbis/codegen/Generators.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.codegen; 20 | 21 | import com.azortis.orbis.Orbis; 22 | import com.azortis.orbis.codegen.block.BlocksGenerator; 23 | import com.azortis.orbis.codegen.block.PropertiesGenerator; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | 27 | import java.io.File; 28 | import java.io.IOException; 29 | import java.io.InputStream; 30 | import java.net.URL; 31 | 32 | public final class Generators { 33 | private static final Logger LOGGER = LoggerFactory.getLogger(Generators.class); 34 | private static final String BASE_ARTIC_DATA_URL = "https://raw.githubusercontent.com/Articdive/ArticData/" + 35 | Orbis.MC_VERSION.replace("_", ".") + "/"; 36 | 37 | public static void main(String[] args) { 38 | StringBuilder outputBuilder = new StringBuilder(); 39 | for (String arg : args) { 40 | if (arg.startsWith("$") || arg.endsWith("$")) { 41 | outputBuilder.append(arg.replace("$", "")); 42 | } 43 | outputBuilder.append(" "); 44 | } 45 | final File outputFolder = new File(outputBuilder.toString().trim()); 46 | new PropertiesGenerator(getInputStream("block_properties.json"), outputFolder).generate(); 47 | new BlocksGenerator(getInputStream("blocks.json"), outputFolder).generate(); 48 | } 49 | 50 | private static InputStream getInputStream(String fileName) { 51 | try { 52 | return new URL(BASE_ARTIC_DATA_URL + Orbis.MC_VERSION + "_" + fileName).openStream(); 53 | } catch (IOException ex) { 54 | LOGGER.error("Failed to create InputStream for " + fileName); 55 | } 56 | return null; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /orbis-generators/src/main/java/com/azortis/orbis/codegen/OrbisCodeGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.codegen; 20 | 21 | import com.google.gson.Gson; 22 | import com.google.gson.GsonBuilder; 23 | import com.squareup.javapoet.JavaFile; 24 | import org.jetbrains.annotations.NotNull; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.io.File; 29 | import java.io.IOException; 30 | import java.io.InputStream; 31 | import java.util.List; 32 | import java.util.Locale; 33 | 34 | public abstract class OrbisCodeGenerator { 35 | protected static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); 36 | private static final Logger LOGGER = LoggerFactory.getLogger(OrbisCodeGenerator.class); 37 | protected final InputStream inputStream; 38 | protected final File outputFolder; 39 | 40 | public OrbisCodeGenerator(InputStream inputStream, File outputFolder) { 41 | this.inputStream = inputStream; 42 | this.outputFolder = outputFolder; 43 | } 44 | 45 | public abstract void generate(); 46 | 47 | protected void writeFiles(@NotNull List files) { 48 | for (JavaFile javaFile : files) { 49 | try { 50 | javaFile.writeTo(this.outputFolder); 51 | } catch (IOException ex) { 52 | LOGGER.error("An error occurred while trying to write source code to the filesystem."); 53 | } 54 | } 55 | } 56 | 57 | private String toConstant(String namespaceId) { 58 | return namespaceId.replace("minecraft:", "").toUpperCase(Locale.ENGLISH); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /orbis-paper/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | plugins { 20 | java 21 | id("com.github.johnrengelman.shadow") version "7.1.2" 22 | id("io.papermc.paperweight.userdev") version "1.5.9" 23 | } 24 | 25 | group = "com.azortis" 26 | version = project(":orbis-core").version 27 | 28 | repositories { 29 | mavenCentral() 30 | maven { 31 | url = uri("https://papermc.io/repo/repository/maven-public/") 32 | } 33 | maven { 34 | url = uri("https://libraries.minecraft.net") 35 | } 36 | maven { 37 | url = uri("https://jitpack.io") 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation(project(":orbis-core")) 43 | paperweight.paperDevBundle("1.20.2-R0.1-SNAPSHOT") 44 | 45 | // Compile 46 | compileOnly("net.kyori:adventure-nbt:4.14.0") 47 | compileOnly("cloud.commandframework:cloud-paper:1.8.4") 48 | compileOnly("cloud.commandframework:cloud-minecraft-extras:1.8.4") 49 | } 50 | 51 | java { 52 | toolchain.languageVersion.set(JavaLanguageVersion.of(17)) 53 | } 54 | 55 | tasks { 56 | assemble { 57 | dependsOn(reobfJar) 58 | } 59 | compileJava { 60 | options.encoding = Charsets.UTF_8.name() 61 | options.release.set(17) 62 | } 63 | javadoc { 64 | options.encoding = Charsets.UTF_8.name() 65 | } 66 | processResources { 67 | filteringCharset = Charsets.UTF_8.name() 68 | filesMatching("paper-plugin.yml") { 69 | expand(Pair("version", project.version)) 70 | } 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/OrbisBootstrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper; 20 | 21 | import io.papermc.paper.plugin.bootstrap.BootstrapContext; 22 | import io.papermc.paper.plugin.bootstrap.PluginBootstrap; 23 | import io.papermc.paper.plugin.bootstrap.PluginProviderContext; 24 | import org.jetbrains.annotations.NotNull; 25 | 26 | @SuppressWarnings("UnstableApiUsage") 27 | public final class OrbisBootstrap implements PluginBootstrap { 28 | 29 | @Override 30 | public void bootstrap(@NotNull BootstrapContext context) { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/PaperSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper; 20 | 21 | import com.azortis.orbis.Settings; 22 | 23 | public class PaperSettings extends Settings { 24 | 25 | public PaperSettings(Settings settings) { 26 | super(settings); 27 | } 28 | 29 | public static PaperSettings defaultSettings() { 30 | return new PaperSettings(Settings.defaultSettings()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/block/entity/PaperBlockEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper.block.entity; 20 | 21 | import com.azortis.orbis.block.entity.BlockEntity; 22 | import com.azortis.orbis.util.BlockPos; 23 | import net.kyori.adventure.key.Key; 24 | import net.kyori.adventure.nbt.CompoundBinaryTag; 25 | import net.minecraft.world.level.block.entity.BlockEntityType; 26 | import org.jetbrains.annotations.NotNull; 27 | 28 | import java.util.Objects; 29 | 30 | public class PaperBlockEntity implements BlockEntity { 31 | private final net.minecraft.world.level.block.entity.BlockEntity handle; 32 | private final Key key; 33 | private final BlockPos blockPos; 34 | 35 | @SuppressWarnings("PatternValidation") 36 | public PaperBlockEntity(net.minecraft.world.level.block.entity.BlockEntity handle) { 37 | this.handle = handle; 38 | this.key = Key.key(Objects.requireNonNull(BlockEntityType.getKey(handle.getType())).toString()); 39 | this.blockPos = new BlockPos(handle.getBlockPos().getX(), handle.getBlockPos().getY(), handle.getBlockPos().getZ()); 40 | } 41 | 42 | @Override 43 | public final @NotNull Key key() { 44 | return key; 45 | } 46 | 47 | @Override 48 | public final int x() { 49 | return blockPos.x(); 50 | } 51 | 52 | @Override 53 | public final int y() { 54 | return blockPos.y(); 55 | } 56 | 57 | @Override 58 | public final int z() { 59 | return blockPos.z(); 60 | } 61 | 62 | @Override 63 | public final @NotNull BlockPos blockPos() { 64 | return blockPos; 65 | } 66 | 67 | @Override 68 | public @NotNull CompoundBinaryTag toNBT() { 69 | return null; 70 | } 71 | 72 | public net.minecraft.world.level.block.entity.BlockEntity getHandle() { 73 | return handle; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/block/entity/PaperCampfireEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper.block.entity; 20 | 21 | import net.minecraft.world.level.block.entity.CampfireBlockEntity; 22 | 23 | public class PaperCampfireEntity { 24 | private final CampfireBlockEntity handle; 25 | 26 | public PaperCampfireEntity(CampfireBlockEntity handle) { 27 | this.handle = handle; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/block/entity/PaperMobSpawnerEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper.block.entity; 20 | 21 | import com.azortis.orbis.block.entity.MobSpawnerEntity; 22 | import net.minecraft.world.level.BaseSpawner; 23 | import net.minecraft.world.level.block.entity.BlockEntity; 24 | import net.minecraft.world.level.block.entity.SpawnerBlockEntity; 25 | 26 | public class PaperMobSpawnerEntity extends PaperBlockEntity implements MobSpawnerEntity { 27 | private final BaseSpawner spawner; 28 | 29 | public PaperMobSpawnerEntity(BlockEntity handle) { 30 | super(handle); 31 | this.spawner = ((SpawnerBlockEntity) handle).getSpawner(); 32 | } 33 | 34 | @Override 35 | public int getDelay() { 36 | return spawner.spawnDelay; 37 | } 38 | 39 | @Override 40 | public void setDelay(int delay) { 41 | spawner.spawnDelay = delay; 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/generator/PaperBiomeProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper.generator; 20 | 21 | import net.kyori.adventure.key.Key; 22 | import org.bukkit.block.Biome; 23 | import org.bukkit.generator.BiomeProvider; 24 | import org.bukkit.generator.WorldInfo; 25 | import org.jetbrains.annotations.NotNull; 26 | 27 | import java.util.List; 28 | import java.util.Locale; 29 | import java.util.stream.Collectors; 30 | 31 | public final class PaperBiomeProvider extends BiomeProvider { 32 | 33 | private final PaperChunkGenerator chunkGenerator; 34 | 35 | public PaperBiomeProvider(PaperChunkGenerator chunkGenerator) { 36 | this.chunkGenerator = chunkGenerator; 37 | } 38 | 39 | @Override 40 | public @NotNull Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z) { 41 | return null; 42 | } 43 | 44 | @Override 45 | public @NotNull List getBiomes(@NotNull WorldInfo worldInfo) { 46 | return null; 47 | } 48 | 49 | 50 | 51 | /*@Override 52 | public @NotNull Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z) { 53 | if (chunkGenerator.requiresLoading()) chunkGenerator.load(worldInfo); 54 | return Biome.valueOf(chunkGenerator.getWorld().getDimension().distributor() 55 | .getBiome(x, y, z).derivative().value().toUpperCase(Locale.ROOT)); 56 | } 57 | 58 | @Override 59 | public @NotNull List getBiomes(@NotNull WorldInfo worldInfo) { 60 | if (chunkGenerator.requiresLoading()) chunkGenerator.load(worldInfo); 61 | return chunkGenerator.getWorld().getDimension().distributor().biomes() 62 | .stream().map(com.azortis.orbis.generator.biome.Biome::derivative).map(Key::value) 63 | .map(String::toUpperCase).map(Biome::valueOf).collect(Collectors.toList()); 64 | }*/ 65 | } 66 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/generator/PaperWorldSnapshot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper.generator; 20 | 21 | import com.azortis.orbis.generator.Dimension; 22 | import com.azortis.orbis.generator.framework.Engine; 23 | import com.azortis.orbis.generator.framework.WorldSnapshot; 24 | import com.azortis.orbis.world.World; 25 | import org.jetbrains.annotations.NotNull; 26 | 27 | public final class PaperWorldSnapshot extends WorldSnapshot { 28 | 29 | private final org.bukkit.World handle; 30 | 31 | public PaperWorldSnapshot(@NotNull World world, @NotNull Dimension dimension, 32 | @NotNull Engine engine, @NotNull org.bukkit.World handle) { 33 | super(world, dimension, engine); 34 | this.handle = handle; 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/studio/PaperStudioBiomeProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper.studio; 20 | 21 | import com.azortis.orbis.pack.studio.Project; 22 | import net.kyori.adventure.key.Key; 23 | import org.bukkit.block.Biome; 24 | import org.bukkit.generator.BiomeProvider; 25 | import org.bukkit.generator.WorldInfo; 26 | import org.jetbrains.annotations.NotNull; 27 | 28 | import java.util.Collections; 29 | import java.util.List; 30 | import java.util.Locale; 31 | import java.util.stream.Collectors; 32 | 33 | public final class PaperStudioBiomeProvider extends BiomeProvider { 34 | 35 | private final PaperStudioChunkGenerator chunkGenerator; 36 | private final Project project; 37 | 38 | public PaperStudioBiomeProvider(PaperStudioChunkGenerator chunkGenerator, Project project) { 39 | this.chunkGenerator = chunkGenerator; 40 | this.project = project; 41 | } 42 | 43 | @Override 44 | public @NotNull Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z) { 45 | if (chunkGenerator.requiresLoading()) chunkGenerator.load(worldInfo); 46 | if (!project.studioWorld().shouldRender()) return Biome.PLAINS; 47 | return Biome.valueOf(project.studioWorld().getDimension().distributor() 48 | .getBiome(x, y, z).derivative().value().toUpperCase(Locale.ROOT)); 49 | } 50 | 51 | @Override 52 | public @NotNull List getBiomes(@NotNull WorldInfo worldInfo) { 53 | if (chunkGenerator.requiresLoading()) chunkGenerator.load(worldInfo); 54 | if (!project.studioWorld().shouldRender()) return Collections.singletonList(Biome.PLAINS); 55 | return project.studioWorld().getDimension().distributor().biomes() 56 | .stream().map(com.azortis.orbis.generator.biome.Biome::derivative).map(Key::value) 57 | .map(String::toUpperCase).map(Biome::valueOf).collect(Collectors.toList()); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/world/PaperChunkAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper.world; 20 | 21 | public final class PaperChunkAccess { 22 | } 23 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/world/PaperNativeHeightMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper.world; 20 | 21 | import com.azortis.orbis.world.Heightmap; 22 | import net.kyori.adventure.key.Key; 23 | import org.jetbrains.annotations.NotNull; 24 | 25 | public record PaperNativeHeightMap(@NotNull Key type, @NotNull net.minecraft.world.level.levelgen.Heightmap handle, 26 | int chunkX, int chunkZ) implements Heightmap { 27 | 28 | @Override 29 | public boolean isPersistent() { 30 | return false; // These are persisted any way. 31 | } 32 | 33 | @Override 34 | public int getFirstAvailable(int x, int z) { 35 | return handle.getFirstAvailable(x, z); 36 | } 37 | 38 | @Override 39 | public int getHighestTaken(int x, int z) { 40 | return handle.getHighestTaken(x, z); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /orbis-paper/src/main/java/com/azortis/orbis/paper/world/PaperRegionAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2022 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.azortis.orbis.paper.world; 20 | 21 | public final class PaperRegionAccess { 22 | } 23 | -------------------------------------------------------------------------------- /orbis-paper/src/main/resources/paper-plugin.yml: -------------------------------------------------------------------------------- 1 | name: Orbis 2 | version: '${version}' 3 | api-version: '1.19' 4 | author: YourPalJake 5 | description: Data driven world generation that enhances the gameplay of your server. 6 | main: com.azortis.orbis.paper.OrbisPlugin 7 | bootstrapper: com.azortis.orbis.paper.OrbisBootstrap -------------------------------------------------------------------------------- /orbis-paper/src/main/resources/plugin.yml: -------------------------------------------------------------------------------- 1 | name: Orbis 2 | author: YourPalJake 3 | version: ${version} 4 | api-version: 1.19 5 | main: com.azortis.orbis.paper.OrbisPlugin 6 | load: STARTUP -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * A dynamic data-driven world generator plugin/library for Minecraft servers. 3 | * Copyright (C) 2023 Azortis 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | /* 20 | * This file was generated by the Gradle 'init' task. 21 | */ 22 | rootProject.name = "Orbis" 23 | include("orbis-core") 24 | include("orbis-paper") 25 | include("orbis-generators") 26 | include("orbis-cli") 27 | --------------------------------------------------------------------------------