├── .gitattributes ├── .github └── workflows │ ├── build.yml │ ├── codeql.yml │ ├── pr_check.yml │ └── publish.yml ├── .gitignore ├── LICENSE ├── LICENSE_HEADER.txt ├── README.md ├── build.gradle.kts ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle.kts └── src ├── main ├── generated │ └── data │ │ └── galacticraft-api │ │ ├── celestial_body │ │ └── sol.json │ │ ├── celestial_teleporter │ │ └── direct.json │ │ ├── galaxy │ │ └── milky_way.json │ │ ├── rocket_body │ │ └── invalid.json │ │ ├── rocket_booster │ │ └── invalid.json │ │ ├── rocket_bottom │ │ └── invalid.json │ │ ├── rocket_cone │ │ └── invalid.json │ │ ├── rocket_fin │ │ └── invalid.json │ │ ├── rocket_upgrade │ │ └── invalid.json │ │ └── worldgen │ │ └── biome │ │ └── space.json ├── java │ └── dev │ │ └── galacticraft │ │ ├── api │ │ ├── accessor │ │ │ ├── GearInventoryProvider.java │ │ │ ├── LevelOxygenAccessor.java │ │ │ ├── ResearchAccessor.java │ │ │ ├── SatelliteAccessor.java │ │ │ └── ServerResearchAccessor.java │ │ ├── client │ │ │ ├── accessor │ │ │ │ └── ClientSatelliteAccessor.java │ │ │ └── tabs │ │ │ │ └── InventoryTabRegistry.java │ │ ├── entity │ │ │ ├── attribute │ │ │ │ └── GcApiEntityAttributes.java │ │ │ └── rocket │ │ │ │ └── render │ │ │ │ ├── RocketPartRenderer.java │ │ │ │ └── RocketPartRendererRegistry.java │ │ ├── gas │ │ │ ├── Gas.java │ │ │ ├── GasComposition.java │ │ │ ├── GasFluid.java │ │ │ └── Gases.java │ │ ├── item │ │ │ ├── Accessory.java │ │ │ ├── OxygenGear.java │ │ │ ├── OxygenMask.java │ │ │ └── Schematic.java │ │ ├── registry │ │ │ ├── AddonRegistries.java │ │ │ ├── BuiltInAddonRegistries.java │ │ │ ├── BuiltInRocketRegistries.java │ │ │ └── RocketRegistries.java │ │ ├── rocket │ │ │ ├── LaunchStage.java │ │ │ ├── RocketData.java │ │ │ ├── entity │ │ │ │ └── Rocket.java │ │ │ ├── part │ │ │ │ ├── RocketBody.java │ │ │ │ ├── RocketBooster.java │ │ │ │ ├── RocketBottom.java │ │ │ │ ├── RocketCone.java │ │ │ │ ├── RocketFin.java │ │ │ │ ├── RocketPart.java │ │ │ │ ├── RocketUpgrade.java │ │ │ │ ├── config │ │ │ │ │ ├── RocketBodyConfig.java │ │ │ │ │ ├── RocketBoosterConfig.java │ │ │ │ │ ├── RocketBottomConfig.java │ │ │ │ │ ├── RocketConeConfig.java │ │ │ │ │ ├── RocketFinConfig.java │ │ │ │ │ ├── RocketPartConfig.java │ │ │ │ │ └── RocketUpgradeConfig.java │ │ │ │ └── type │ │ │ │ │ ├── RocketBodyType.java │ │ │ │ │ ├── RocketBoosterType.java │ │ │ │ │ ├── RocketBottomType.java │ │ │ │ │ ├── RocketConeType.java │ │ │ │ │ ├── RocketFinType.java │ │ │ │ │ ├── RocketPartType.java │ │ │ │ │ └── RocketUpgradeType.java │ │ │ ├── recipe │ │ │ │ ├── RocketPartRecipe.java │ │ │ │ ├── RocketPartRecipeSlot.java │ │ │ │ ├── config │ │ │ │ │ └── RocketPartRecipeConfig.java │ │ │ │ └── type │ │ │ │ │ └── RocketPartRecipeType.java │ │ │ └── travelpredicate │ │ │ │ ├── ConfiguredTravelPredicate.java │ │ │ │ ├── TravelPredicateConfig.java │ │ │ │ └── TravelPredicateType.java │ │ ├── satellite │ │ │ ├── Satellite.java │ │ │ ├── SatelliteOwnershipData.java │ │ │ └── SatelliteRecipe.java │ │ └── universe │ │ │ ├── celestialbody │ │ │ ├── CelestialBody.java │ │ │ ├── CelestialBodyConfig.java │ │ │ ├── CelestialBodyType.java │ │ │ ├── SurfaceEnvironment.java │ │ │ ├── Tiered.java │ │ │ ├── landable │ │ │ │ ├── Landable.java │ │ │ │ └── teleporter │ │ │ │ │ ├── CelestialTeleporter.java │ │ │ │ │ ├── config │ │ │ │ │ └── CelestialTeleporterConfig.java │ │ │ │ │ └── type │ │ │ │ │ └── CelestialTeleporterType.java │ │ │ ├── satellite │ │ │ │ └── Orbitable.java │ │ │ └── star │ │ │ │ └── Star.java │ │ │ ├── display │ │ │ ├── CelestialDisplay.java │ │ │ ├── CelestialDisplayConfig.java │ │ │ └── CelestialDisplayType.java │ │ │ ├── galaxy │ │ │ └── Galaxy.java │ │ │ └── position │ │ │ ├── CelestialPosition.java │ │ │ ├── CelestialPositionConfig.java │ │ │ └── CelestialPositionType.java │ │ └── impl │ │ ├── Constant.java │ │ ├── accessor │ │ └── SoundSystemAccessor.java │ │ ├── client │ │ ├── accessor │ │ │ └── ClientResearchAccessor.java │ │ └── rocket │ │ │ └── render │ │ │ ├── BakedModelRocketPartRenderer.java │ │ │ ├── EmptyRocketPartRenderer.java │ │ │ └── RocketPartRendererRegistryImpl.java │ │ ├── codec │ │ ├── AlternateDecoderCodec.java │ │ ├── JsonDecoder.java │ │ ├── MapCodec.java │ │ └── MiscCodecs.java │ │ ├── command │ │ └── argument │ │ │ └── RegistryArgumentType.java │ │ ├── data │ │ ├── BootstrapDataProvider.java │ │ └── GeneratingBootstrapContext.java │ │ ├── gas │ │ └── GasCompositionImpl.java │ │ ├── internal │ │ ├── accessor │ │ │ ├── AdvancementRewardsAccessor.java │ │ │ ├── ChunkOxygenAccessor.java │ │ │ ├── ChunkOxygenSyncer.java │ │ │ ├── ChunkSectionOxygenAccessor.java │ │ │ ├── InternalLevelOxygenAccessor.java │ │ │ └── package-info.java │ │ ├── client │ │ │ ├── fabric │ │ │ │ └── GalacticraftAPIClient.java │ │ │ └── tabs │ │ │ │ └── InventoryTabRegistryImpl.java │ │ ├── command │ │ │ └── GCApiCommands.java │ │ ├── fabric │ │ │ ├── GalacticraftAPI.java │ │ │ └── GalacticraftAPIData.java │ │ ├── inventory │ │ │ └── MappedInventory.java │ │ ├── mixin │ │ │ ├── MinecraftServerMixin.java │ │ │ ├── client │ │ │ │ ├── AbstractClientPlayerEntityMixin.java │ │ │ │ ├── AbstractContainerScreenMixin.java │ │ │ │ ├── ClientPlayNetworkHandlerMixin.java │ │ │ │ ├── MinecraftClientMixin.java │ │ │ │ ├── ParticleAccessor.java │ │ │ │ ├── ParticleManagerMixin.java │ │ │ │ ├── SoundEngineMixin.java │ │ │ │ ├── SoundManagerAccessor.java │ │ │ │ └── package-info.java │ │ │ ├── gear │ │ │ │ ├── LivingEntityMixin.java │ │ │ │ ├── PlayerListMixin.java │ │ │ │ └── ServerPlayerMixin.java │ │ │ ├── gravity │ │ │ │ ├── EntityGravityMixin.java │ │ │ │ └── LivingEntityMixin.java │ │ │ ├── oxygen │ │ │ │ ├── ChunkHolderMixin.java │ │ │ │ ├── ChunkSerializerMixin.java │ │ │ │ ├── EmptyLevelChunkMixin.java │ │ │ │ ├── ImposterProtoChunkMixin.java │ │ │ │ ├── LevelChunkMixin.java │ │ │ │ ├── LevelChunkSectionMixin.java │ │ │ │ ├── LevelMixin.java │ │ │ │ └── ProtoChunkMixin.java │ │ │ ├── package-info.java │ │ │ ├── registry │ │ │ │ ├── RegistryDataLoaderMixin.java │ │ │ │ └── RegistrySyncronizationMixin.java │ │ │ └── research │ │ │ │ ├── AdvancementRewardsMixin.java │ │ │ │ └── ServerPlayerMixin.java │ │ ├── package-info.java │ │ └── world │ │ │ └── gen │ │ │ ├── SatelliteChunkGenerator.java │ │ │ └── biome │ │ │ └── GcApiBiomes.java │ │ ├── rocket │ │ ├── RocketDataImpl.java │ │ ├── part │ │ │ ├── RocketBodyImpl.java │ │ │ ├── RocketBoosterImpl.java │ │ │ ├── RocketBottomImpl.java │ │ │ ├── RocketConeImpl.java │ │ │ ├── RocketFinImpl.java │ │ │ ├── RocketUpgradeImpl.java │ │ │ ├── config │ │ │ │ ├── BasicRocketBodyConfig.java │ │ │ │ ├── BasicRocketBoosterConfig.java │ │ │ │ ├── BasicRocketBottomConfig.java │ │ │ │ ├── BasicRocketConeConfig.java │ │ │ │ ├── BasicRocketFinConfig.java │ │ │ │ ├── DefaultRocketBodyConfig.java │ │ │ │ ├── DefaultRocketBoosterConfig.java │ │ │ │ ├── DefaultRocketBottomConfig.java │ │ │ │ ├── DefaultRocketConeConfig.java │ │ │ │ ├── DefaultRocketFinConfig.java │ │ │ │ └── DefaultRocketUpgradeConfig.java │ │ │ └── type │ │ │ │ ├── BasicRocketBodyType.java │ │ │ │ ├── BasicRocketBoosterType.java │ │ │ │ ├── BasicRocketBottomType.java │ │ │ │ ├── BasicRocketConeType.java │ │ │ │ ├── BasicRocketFinType.java │ │ │ │ ├── InvalidRocketBodyType.java │ │ │ │ ├── InvalidRocketBoosterType.java │ │ │ │ ├── InvalidRocketBottomType.java │ │ │ │ ├── InvalidRocketConeType.java │ │ │ │ ├── InvalidRocketFinType.java │ │ │ │ ├── InvalidRocketUpgradeType.java │ │ │ │ └── NoUpgradeRocketUpgradeType.java │ │ ├── recipe │ │ │ ├── RocketPartRecipeImpl.java │ │ │ ├── RocketPartRecipeSlotImpl.java │ │ │ ├── config │ │ │ │ └── PatternedRocketPartRecipeConfig.java │ │ │ └── type │ │ │ │ └── PatternedRocketPartRecipeType.java │ │ └── travelpredicate │ │ │ ├── config │ │ │ ├── AccessWeightTravelPredicateConfig.java │ │ │ ├── AndTravelPredicateConfig.java │ │ │ ├── ConstantTravelPredicateConfig.java │ │ │ ├── DefaultTravelPredicateConfig.java │ │ │ └── OrTravelPredicateConfig.java │ │ │ └── type │ │ │ ├── AccessWeightTravelPredicateType.java │ │ │ ├── AndTravelPredicateType.java │ │ │ ├── ConstantTravelPredicateType.java │ │ │ ├── DefaultTravelPredicateType.java │ │ │ └── OrTravelPredicateType.java │ │ ├── satellite │ │ ├── SatelliteOwnershipDataImpl.java │ │ └── SatelliteRecipeImpl.java │ │ └── universe │ │ ├── BuiltinObjects.java │ │ ├── celestialbody │ │ ├── config │ │ │ ├── DecorativePlanetConfig.java │ │ │ ├── PlanetConfig.java │ │ │ └── StarConfig.java │ │ ├── landable │ │ │ └── teleporter │ │ │ │ ├── config │ │ │ │ ├── DefaultCelestialTeleporterConfig.java │ │ │ │ └── FixedCelestialTeleporterConfig.java │ │ │ │ └── type │ │ │ │ ├── DirectCelestialTeleporterType.java │ │ │ │ └── FixedCelestialTeleporterType.java │ │ └── type │ │ │ ├── DecorativePlanet.java │ │ │ ├── PlanetType.java │ │ │ ├── SatelliteType.java │ │ │ └── StarType.java │ │ ├── display │ │ ├── config │ │ │ ├── EmptyCelestialDisplayConfig.java │ │ │ └── IconCelestialDisplayConfig.java │ │ └── type │ │ │ ├── EmptyCelestialDisplayType.java │ │ │ └── IconCelestialDisplayType.java │ │ ├── galaxy │ │ └── GalaxyImpl.java │ │ └── position │ │ ├── config │ │ ├── OrbitalCelestialPositionConfig.java │ │ ├── SatelliteConfig.java │ │ └── StaticCelestialPositionConfig.java │ │ └── type │ │ ├── OrbitalCelestialPositionType.java │ │ └── StaticCelestialPositionType.java └── resources │ ├── assets │ └── galacticraft-api │ │ ├── icon.png │ │ ├── lang │ │ └── en_us.json │ │ └── textures │ │ ├── body_icons.png │ │ ├── gui │ │ └── player_inventory_switch_tabs.png │ │ └── satellite.png │ ├── fabric.mod.json │ ├── galacticraft-api.accesswidener │ └── galacticraft-api.mixins.json └── test ├── java └── dev │ └── galacticraft │ └── api │ └── gametest │ └── GalacticraftApiTestSuite.java └── resources ├── data └── gc-api-test │ ├── advancements │ └── custom │ │ ├── example_part.json │ │ └── root.json │ ├── celestial_body │ ├── example_planet.json │ └── example_star.json │ └── galaxy │ └── example_galaxy.json └── fabric.mod.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # These are explicitly windows files and should use crlf 5 | *.bat text eol=crlf 6 | 7 | src/main/generated/* linguist-generated=true 8 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | Build: 10 | runs-on: ubuntu-22.04 11 | 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v3 15 | 16 | - name: Validate Gradle wrapper 17 | uses: gradle/wrapper-validation-action@v1 18 | 19 | - name: Setup JDK 17 20 | uses: actions/setup-java@v3 21 | with: 22 | java-version: 17 23 | distribution: temurin 24 | 25 | - uses: actions/cache@v2 26 | with: 27 | path: | 28 | ~/.gradle/caches 29 | ~/.gradle/loom-cache 30 | ~/.gradle/wrapper 31 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }} 32 | restore-keys: ${{ runner.os }}-gradle 33 | 34 | - name: make gradle wrapper executable 35 | run: chmod +x ./gradlew 36 | 37 | - name: License headers 38 | id: license_headers 39 | uses: gradle/gradle-build-action@v2.4.2 40 | with: 41 | arguments: checkLicenses 42 | 43 | - name: Build 44 | id: build 45 | uses: gradle/gradle-build-action@v2.4.2 46 | with: 47 | arguments: build 48 | 49 | # - name: Gametest 50 | # id: gametest 51 | # uses: gradle/gradle-build-action@v2 52 | # with: 53 | # arguments: runGametest 54 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: CodeQL Analysis 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | Analysis: 13 | runs-on: ubuntu-22.04 14 | permissions: 15 | security-events: write 16 | steps: 17 | - name: Checkout repository 18 | uses: actions/checkout@v3 19 | with: 20 | fetch-depth: 0 21 | 22 | - name: Validate Gradle wrapper 23 | uses: gradle/wrapper-validation-action@v1 24 | 25 | - name: Initialize CodeQL 26 | uses: github/codeql-action/init@v2 27 | with: 28 | languages: java 29 | 30 | - name: Setup JDK 17 31 | uses: actions/setup-java@v3 32 | with: 33 | java-version: 17 34 | distribution: temurin 35 | 36 | - uses: actions/cache@v2 37 | with: 38 | path: | 39 | ~/.gradle/caches 40 | ~/.gradle/loom-cache 41 | ~/.gradle/wrapper 42 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }} 43 | restore-keys: ${{ runner.os }}-gradle 44 | 45 | - name: make gradle wrapper executable 46 | run: chmod +x ./gradlew 47 | 48 | - name: Build 49 | uses: gradle/gradle-build-action@v2.4.2 50 | with: 51 | arguments: build 52 | 53 | - name: Perform CodeQL Analysis 54 | uses: github/codeql-action/analyze@v2 55 | -------------------------------------------------------------------------------- /.github/workflows/pr_check.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request Check 2 | 3 | on: 4 | pull_request: 5 | types: [ synchronize, opened ] 6 | branches: 7 | - main 8 | 9 | jobs: 10 | Build: 11 | runs-on: ubuntu-22.04 12 | 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v3 16 | 17 | - name: Validate Gradle wrapper 18 | uses: gradle/wrapper-validation-action@v1 19 | 20 | - name: Setup JDK 17 21 | uses: actions/setup-java@v3 22 | with: 23 | java-version: 17 24 | distribution: temurin 25 | 26 | - uses: actions/cache@v2 27 | with: 28 | path: | 29 | ~/.gradle/caches 30 | ~/.gradle/loom-cache 31 | ~/.gradle/wrapper 32 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }} 33 | restore-keys: ${{ runner.os }}-gradle 34 | 35 | - name: make gradle wrapper executable 36 | run: chmod +x ./gradlew 37 | 38 | - name: License headers 39 | id: license_headers 40 | uses: gradle/gradle-build-action@v2.4.2 41 | with: 42 | arguments: checkLicenses 43 | 44 | - name: Build 45 | id: build 46 | uses: gradle/gradle-build-action@v2.4.2 47 | with: 48 | arguments: build 49 | 50 | - name: Gametest 51 | id: gametest 52 | uses: gradle/gradle-build-action@v2.4.2 53 | with: 54 | arguments: runGametest 55 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Maven Publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | Publish: 10 | runs-on: ubuntu-22.04 11 | 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v3 15 | 16 | - name: Validate Gradle wrapper 17 | uses: gradle/wrapper-validation-action@v1 18 | 19 | - name: Setup JDK 17 20 | uses: actions/setup-java@v3 21 | with: 22 | java-version: 17 23 | distribution: temurin 24 | 25 | - uses: actions/cache@v2 26 | with: 27 | path: | 28 | ~/.gradle/caches 29 | ~/.gradle/loom-cache 30 | ~/.gradle/wrapper 31 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }} 32 | restore-keys: ${{ runner.os }}-gradle 33 | 34 | - name: make gradle wrapper executable 35 | run: chmod +x ./gradlew 36 | 37 | - name: Publish 38 | uses: gradle/gradle-build-action@v2.4.2 39 | with: 40 | arguments: publish 41 | env: 42 | SNAPSHOT: ${{ env.release.prerelease }} 43 | NEXUS_REPOSITORY_URL: ${{ env.release.prerelease == 'true' && secrets.NEXUS_SNAPSHOT_URL || secrets.NEXUS_RELEASE_URL }} 44 | NEXUS_USER: ${{ secrets.NEXUS_USER }} 45 | NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019-2023 Team Galacticraft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE_HEADER.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019-2023 Team Galacticraft 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1G 2 | 3 | # Mod Information 4 | mod.id=galacticraft-api 5 | mod.name=GalacticraftAPI 6 | mod.version=0.4.0-prealpha 7 | mod.group=dev.galacticraft 8 | 9 | # Minecraft and Fabric Loader 10 | minecraft.version=1.20.1 11 | loader.version=0.14.21 12 | 13 | # Mod Dependencies 14 | fabric.version=0.85.0+1.20.1 15 | dynamicdimensions.version=0.6.0-pre+26 16 | badpackets.version=0.4.1 17 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamGalacticraft/GalacticraftAPI/6d3bfc9452ea14d7bc22ead73a647aad482d60dc/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=e111cb9948407e26351227dabce49822fb88c37ee72f1d1582a69c68af2e702f 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip 5 | networkTimeout=10000 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven("https://maven.fabricmc.net/") { 4 | name = "Fabric" 5 | content { 6 | includeGroup("net.fabricmc") 7 | includeGroup("net.fabricmc.fabric-api") 8 | includeGroup("fabric-loom") 9 | } 10 | } 11 | gradlePluginPortal() 12 | } 13 | } 14 | 15 | rootProject.name = "GalacticraftAPI" 16 | -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/celestial_body/sol.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "galacticraft-api:star", 3 | "config": { 4 | "description": "star.galacticraft-api.sol.description", 5 | "display": { 6 | "type": "galacticraft-api:icon", 7 | "config": { 8 | "height": 16, 9 | "scale": 1.5, 10 | "texture": "galacticraft-api:textures/body_icons.png", 11 | "u": 0, 12 | "v": 0, 13 | "width": 16 14 | } 15 | }, 16 | "galaxy": "galacticraft-api:milky_way", 17 | "gravity": 28.0, 18 | "luminance": 1.0, 19 | "name": "star.galacticraft-api.sol.name", 20 | "photospheric_composition": { 21 | "composition": { 22 | "galacticraft-api:helium": 248500.0, 23 | "galacticraft-api:hydrogen": 734600.0, 24 | "galacticraft-api:neon": 1200.0, 25 | "galacticraft-api:nitrogen": 900.0, 26 | "galacticraft-api:oxygen": 7700.0 27 | }, 28 | "pressure": 28.0, 29 | "temperature": 15.0 30 | }, 31 | "position": { 32 | "type": "galacticraft-api:static", 33 | "config": { 34 | "x": 0.0, 35 | "y": 0.0 36 | } 37 | }, 38 | "surface_temperature": 5772 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/celestial_teleporter/direct.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "galacticraft-api:direct", 3 | "config": {} 4 | } -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/galaxy/milky_way.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "galaxy.galacticraft-api.milky_way.description", 3 | "display": { 4 | "type": "galacticraft-api:empty", 5 | "config": {} 6 | }, 7 | "name": "galaxy.galacticraft-api.milky_way.name", 8 | "position": { 9 | "type": "galacticraft-api:static", 10 | "config": { 11 | "x": 0.0, 12 | "y": 0.0 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/rocket_body/invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "galacticraft-api:invalid", 3 | "config": {} 4 | } -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/rocket_booster/invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "galacticraft-api:invalid", 3 | "config": {} 4 | } -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/rocket_bottom/invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "galacticraft-api:invalid", 3 | "config": {} 4 | } -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/rocket_cone/invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "galacticraft-api:invalid", 3 | "config": {} 4 | } -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/rocket_fin/invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "galacticraft-api:invalid", 3 | "config": {} 4 | } -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/rocket_upgrade/invalid.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "galacticraft-api:invalid", 3 | "config": {} 4 | } -------------------------------------------------------------------------------- /src/main/generated/data/galacticraft-api/worldgen/biome/space.json: -------------------------------------------------------------------------------- 1 | { 2 | "carvers": {}, 3 | "downfall": 0.0, 4 | "effects": { 5 | "fog_color": 0, 6 | "sky_color": 0, 7 | "water_color": 4159204, 8 | "water_fog_color": 329011 9 | }, 10 | "features": [], 11 | "has_precipitation": false, 12 | "spawn_costs": {}, 13 | "spawners": { 14 | "ambient": [], 15 | "axolotls": [], 16 | "creature": [], 17 | "misc": [], 18 | "monster": [], 19 | "underground_water_creature": [], 20 | "water_ambient": [], 21 | "water_creature": [] 22 | }, 23 | "temperature": 1.0 24 | } -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/accessor/GearInventoryProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.accessor; 24 | 25 | import net.minecraft.nbt.CompoundTag; 26 | import net.minecraft.world.Container; 27 | 28 | /** 29 | * @author TeamGalacticraft 30 | */ 31 | public interface GearInventoryProvider { 32 | default Container getGearInv() { 33 | throw new RuntimeException("This should be overridden by mixin!"); 34 | } 35 | 36 | default Container getOxygenTanks() { 37 | throw new RuntimeException("This should be overridden by mixin!"); 38 | } 39 | 40 | default Container getThermalArmor() { 41 | throw new RuntimeException("This should be overridden by mixin!"); 42 | } 43 | 44 | default Container getAccessories() { 45 | throw new RuntimeException("This should be overridden by mixin!"); 46 | } 47 | 48 | default void writeGearToNbt(CompoundTag tag) { 49 | throw new RuntimeException("This should be overridden by mixin!"); 50 | } 51 | 52 | default void readGearFromNbt(CompoundTag tag) { 53 | throw new RuntimeException("This should be overridden by mixin!"); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/accessor/ResearchAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.accessor; 24 | 25 | import net.minecraft.resources.ResourceLocation; 26 | 27 | public interface ResearchAccessor { 28 | /** 29 | * Returns whether the supplied rocket part is unlocked for the player 30 | * 31 | * @param id The ID of the rocket part to test for 32 | * @return whether the supplied rocket part is unlocked for the player 33 | */ 34 | boolean hasUnlockedResearch(ResourceLocation id); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/accessor/SatelliteAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.accessor; 24 | 25 | import dev.galacticraft.api.universe.celestialbody.CelestialBody; 26 | import dev.galacticraft.dynamicdimensions.api.event.DynamicDimensionLoadCallback; 27 | import dev.galacticraft.impl.universe.celestialbody.type.SatelliteType; 28 | import dev.galacticraft.impl.universe.position.config.SatelliteConfig; 29 | import net.minecraft.resources.ResourceLocation; 30 | 31 | import java.util.Map; 32 | 33 | public interface SatelliteAccessor { 34 | Map> getSatellites(); 35 | 36 | void addSatellite(ResourceLocation id, CelestialBody satellite); 37 | 38 | void removeSatellite(ResourceLocation id); 39 | 40 | void loadSatellites(DynamicDimensionLoadCallback.DynamicDimensionLoader dynamicDimensionLoader); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/accessor/ServerResearchAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.accessor; 24 | 25 | import net.minecraft.nbt.CompoundTag; 26 | import net.minecraft.network.FriendlyByteBuf; 27 | import net.minecraft.resources.ResourceLocation; 28 | 29 | public interface ServerResearchAccessor extends ResearchAccessor { 30 | void unlockResearch(ResourceLocation id, boolean unlocked); 31 | 32 | boolean isResearchDirty(); 33 | 34 | FriendlyByteBuf writeResearchChanges(FriendlyByteBuf buf); 35 | 36 | CompoundTag writeResearchToNbt(CompoundTag nbt); 37 | 38 | void readResearchFromNbt(CompoundTag nbt); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/client/accessor/ClientSatelliteAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.client.accessor; 24 | 25 | import dev.galacticraft.api.accessor.SatelliteAccessor; 26 | import dev.galacticraft.api.universe.celestialbody.CelestialBody; 27 | import dev.galacticraft.impl.universe.celestialbody.type.SatelliteType; 28 | import dev.galacticraft.impl.universe.position.config.SatelliteConfig; 29 | import net.fabricmc.api.EnvType; 30 | import net.fabricmc.api.Environment; 31 | 32 | @Environment(EnvType.CLIENT) 33 | public interface ClientSatelliteAccessor extends SatelliteAccessor { 34 | void addListener(SatelliteListener listener); 35 | 36 | void removeListener(SatelliteListener listener); 37 | 38 | @FunctionalInterface 39 | interface SatelliteListener { 40 | void onSatelliteUpdated(CelestialBody satellite, boolean added); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/client/tabs/InventoryTabRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.client.tabs; 24 | 25 | import dev.galacticraft.impl.internal.client.tabs.InventoryTabRegistryImpl; 26 | import net.minecraft.world.entity.player.Player; 27 | import net.minecraft.world.inventory.AbstractContainerMenu; 28 | import net.minecraft.world.item.ItemStack; 29 | 30 | import java.util.function.Predicate; 31 | 32 | public interface InventoryTabRegistry { 33 | InventoryTabRegistry INSTANCE = InventoryTabRegistryImpl.INSTANCE; 34 | void register(ItemStack icon, Runnable onClick, Predicate visiablePredicate, Class clazz); 35 | 36 | default void register(ItemStack icon, Runnable onClick, Class clazz) { 37 | register(icon, onClick, player -> true, clazz); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/entity/attribute/GcApiEntityAttributes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.entity.attribute; 24 | 25 | import dev.galacticraft.impl.Constant; 26 | import net.minecraft.core.Registry; 27 | import net.minecraft.core.registries.BuiltInRegistries; 28 | import net.minecraft.resources.ResourceLocation; 29 | import net.minecraft.world.entity.ai.attributes.Attribute; 30 | import net.minecraft.world.entity.ai.attributes.RangedAttribute; 31 | 32 | public final class GcApiEntityAttributes { 33 | public static final Attribute CAN_BREATHE_IN_SPACE = Registry.register(BuiltInRegistries.ATTRIBUTE, new ResourceLocation(Constant.MOD_ID, "can_breathe_in_space"), (new RangedAttribute("galacticraft-api.attribute.name.generic.can_breathe_in_space", 0.0D, 0.0D, 1.0D)).setSyncable(true)); 34 | 35 | public static final Attribute LOCAL_GRAVITY_LEVEL = Registry.register(BuiltInRegistries.ATTRIBUTE, new ResourceLocation(Constant.MOD_ID, "local_gravity_level"), (new RangedAttribute("galacticraft-api.attribute.name.generic.local_gravity_level", 0.0D, 0.0D, 1.0D)).setSyncable(true)); 36 | 37 | private GcApiEntityAttributes() {} 38 | 39 | public static void init() {} 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/entity/rocket/render/RocketPartRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.entity.rocket.render; 24 | 25 | import com.mojang.blaze3d.vertex.PoseStack; 26 | import dev.galacticraft.api.rocket.entity.Rocket; 27 | import net.fabricmc.api.EnvType; 28 | import net.fabricmc.api.Environment; 29 | import net.minecraft.client.gui.GuiGraphics; 30 | import net.minecraft.client.multiplayer.ClientLevel; 31 | import net.minecraft.client.renderer.MultiBufferSource; 32 | 33 | @FunctionalInterface 34 | @Environment(EnvType.CLIENT) 35 | public interface RocketPartRenderer { 36 | /** 37 | * Called when this rocket part is being rendered inside a gui/screen. 38 | * 39 | * @param world the client world of the main player 40 | * @param graphics the gui graphics which has various methods for gui rendering; it also contains the matrix stack 41 | * @param mouseX the x position of the mouse 42 | * @param mouseY the y position of the mouse 43 | * @param delta time in-between ticks 44 | */ 45 | default void renderGUI(ClientLevel world, GuiGraphics graphics, int mouseX, int mouseY, float delta) { 46 | } 47 | 48 | void render(ClientLevel world, PoseStack matrices, Rocket rocket, MultiBufferSource vertices, float delta, int light); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/entity/rocket/render/RocketPartRendererRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.entity.rocket.render; 24 | 25 | import dev.galacticraft.api.rocket.part.RocketPart; 26 | import dev.galacticraft.impl.client.rocket.render.RocketPartRendererRegistryImpl; 27 | import net.fabricmc.api.EnvType; 28 | import net.fabricmc.api.Environment; 29 | import net.minecraft.resources.ResourceKey; 30 | import org.jetbrains.annotations.NotNull; 31 | 32 | @Environment(EnvType.CLIENT) 33 | public interface RocketPartRendererRegistry { 34 | RocketPartRendererRegistry INSTANCE = new RocketPartRendererRegistryImpl(); 35 | 36 | > void register(@NotNull ResourceKey id, @NotNull RocketPartRenderer renderer); 37 | 38 | > @NotNull RocketPartRenderer getRenderer(ResourceKey id); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/gas/Gas.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.gas; 24 | 25 | import net.minecraft.network.chat.Component; 26 | import org.jetbrains.annotations.ApiStatus; 27 | import org.jetbrains.annotations.NotNull; 28 | 29 | /** 30 | * Represents a gas. 31 | * Not yet stable API - use is not recommended. 32 | */ 33 | @ApiStatus.Experimental 34 | @Deprecated // TODO: better gas implementation - typechecking feels like the wrong way to go about this 35 | // may want an external registry or something 36 | public interface Gas { 37 | /** 38 | * The name of the gas 39 | * 40 | * @return the name of the gas 41 | */ 42 | @NotNull Component getName(); 43 | 44 | /** 45 | * The gas' symbol 46 | * 47 | * @return the gas' symbol 48 | */ 49 | @NotNull String getSymbol(); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/item/Accessory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.item; 24 | 25 | import net.minecraft.world.entity.LivingEntity; 26 | 27 | /** 28 | * @author TeamGalacticraft 29 | */ 30 | public interface Accessory { 31 | default boolean enablesHearing() { 32 | return false; 33 | } 34 | 35 | default void tick(LivingEntity entity) { 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/item/OxygenGear.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.item; 24 | 25 | public interface OxygenGear extends Accessory { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/item/OxygenMask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.item; 24 | 25 | public interface OxygenMask extends Accessory { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/item/Schematic.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.item; 24 | 25 | import dev.galacticraft.api.rocket.recipe.RocketPartRecipe; 26 | import net.minecraft.core.Registry; 27 | import net.minecraft.world.item.ItemStack; 28 | import org.jetbrains.annotations.NotNull; 29 | import org.jetbrains.annotations.Nullable; 30 | 31 | /** 32 | * @author TeamGalacticraft 33 | */ 34 | public interface Schematic { 35 | @Nullable RocketPartRecipe getRecipe(Registry> registry, @NotNull ItemStack stack); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/RocketPart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part; 24 | 25 | import dev.galacticraft.api.rocket.entity.Rocket; 26 | import dev.galacticraft.api.rocket.part.config.RocketPartConfig; 27 | import dev.galacticraft.api.rocket.part.type.RocketPartType; 28 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 29 | import org.jetbrains.annotations.NotNull; 30 | 31 | public sealed interface RocketPart> permits RocketBody, RocketBooster, RocketBottom, RocketCone, RocketFin, RocketUpgrade { 32 | @NotNull C config(); 33 | 34 | @NotNull T type(); 35 | 36 | /** 37 | * Called every tick when this part is applied to a placed rocket. 38 | * The rocket may not have launched yet. 39 | * 40 | * @param rocket the rocket that this part is a part of. 41 | */ 42 | default void tick(@NotNull Rocket rocket) { 43 | this.type().tick(rocket, this.config()); 44 | } 45 | 46 | default @NotNull ConfiguredTravelPredicate travelPredicate() { 47 | return this.type().travelPredicate(this.config()); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/config/RocketBodyConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.config; 24 | 25 | public non-sealed interface RocketBodyConfig extends RocketPartConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/config/RocketBoosterConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.config; 24 | 25 | public non-sealed interface RocketBoosterConfig extends RocketPartConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/config/RocketBottomConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.config; 24 | 25 | public non-sealed interface RocketBottomConfig extends RocketPartConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/config/RocketConeConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.config; 24 | 25 | public non-sealed interface RocketConeConfig extends RocketPartConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/config/RocketFinConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.config; 24 | 25 | public non-sealed interface RocketFinConfig extends RocketPartConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/config/RocketPartConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.config; 24 | 25 | public sealed interface RocketPartConfig permits RocketBodyConfig, RocketBoosterConfig, RocketBottomConfig, RocketConeConfig, RocketFinConfig, RocketUpgradeConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/config/RocketUpgradeConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.config; 24 | 25 | public non-sealed interface RocketUpgradeConfig extends RocketPartConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/type/RocketConeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.type; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.RocketCone; 27 | import dev.galacticraft.api.rocket.part.config.RocketConeConfig; 28 | import org.jetbrains.annotations.NotNull; 29 | 30 | /** 31 | * The cone of a rocket. Controls how fast the rocket can accelerate. 32 | */ 33 | public non-sealed abstract class RocketConeType implements RocketPartType { 34 | private final @NotNull Codec>> codec; 35 | 36 | public RocketConeType(@NotNull Codec configCodec) { 37 | this.codec = configCodec.fieldOf("config").xmap(this::configure, RocketCone::config).codec(); 38 | } 39 | 40 | @Override 41 | public @NotNull RocketCone> configure(@NotNull C config) { 42 | return RocketCone.create(config, this); 43 | } 44 | 45 | @Override 46 | public @NotNull Codec>> codec() { 47 | return this.codec; 48 | } 49 | 50 | // todo: lander? 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/type/RocketFinType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.type; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.RocketFin; 27 | import dev.galacticraft.api.rocket.part.config.RocketFinConfig; 28 | import org.jetbrains.annotations.NotNull; 29 | 30 | /** 31 | * The fins of a rocket. Controls how fast the rocket can accelerate. 32 | */ 33 | public non-sealed abstract class RocketFinType implements RocketPartType { 34 | private final @NotNull Codec>> codec; 35 | 36 | protected RocketFinType(@NotNull Codec configCodec) { 37 | this.codec = configCodec.fieldOf("config").xmap(this::configure, RocketFin::config).codec(); 38 | } 39 | 40 | @Override 41 | public @NotNull RocketFin> configure(@NotNull C config) { 42 | return RocketFin.create(config, this); 43 | } 44 | 45 | @Override 46 | public @NotNull Codec>> codec() { 47 | return this.codec; 48 | } 49 | 50 | public abstract boolean canManeuver(@NotNull C config); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/part/type/RocketUpgradeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.part.type; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.RocketUpgrade; 27 | import dev.galacticraft.api.rocket.part.config.RocketUpgradeConfig; 28 | import net.minecraft.world.item.crafting.Ingredient; 29 | import org.jetbrains.annotations.NotNull; 30 | 31 | /** 32 | * An upgrade for a rocket. 33 | */ 34 | public non-sealed abstract class RocketUpgradeType implements RocketPartType { 35 | private final @NotNull Codec>> codec; 36 | 37 | protected RocketUpgradeType(@NotNull Codec configCodec) { 38 | this.codec = configCodec.fieldOf("config").xmap(this::configure, RocketUpgrade::config).codec(); 39 | } 40 | 41 | @Override 42 | public @NotNull RocketUpgrade> configure(@NotNull C config) { 43 | return RocketUpgrade.create(config, this); 44 | } 45 | 46 | public abstract @NotNull Ingredient upgradeRecipe(@NotNull C config); 47 | 48 | @Override 49 | public @NotNull Codec>> codec() { 50 | return this.codec; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/recipe/config/RocketPartRecipeConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.recipe.config; 24 | 25 | public interface RocketPartRecipeConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/rocket/travelpredicate/TravelPredicateConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.rocket.travelpredicate; 24 | 25 | public interface TravelPredicateConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/celestialbody/CelestialBodyConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.celestialbody; 24 | 25 | /** 26 | * Base interface for creating configurations for celestial bodies 27 | */ 28 | public interface CelestialBodyConfig { 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/celestialbody/SurfaceEnvironment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.celestialbody; 24 | 25 | import net.minecraft.core.RegistryAccess; 26 | 27 | public interface SurfaceEnvironment { 28 | /** 29 | * Returns the approximate temperature on this celestial body 30 | * 31 | * @param access the registry access 32 | * @param time the current world time 33 | * @param config the celestial body configuration to be queried 34 | * @return the approximate temperature on this celestial body 35 | */ 36 | int temperature(RegistryAccess access, long time, C config); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/celestialbody/Tiered.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.celestialbody; 24 | 25 | import dev.galacticraft.api.universe.celestialbody.landable.Landable; 26 | import org.jetbrains.annotations.NotNull; 27 | 28 | public interface Tiered extends Landable { 29 | /** 30 | * Returns the access weight required to generically reach this celestial body or a negative value if it cannot be accessed this way. 31 | * For more advanced access requirements see {@link dev.galacticraft.api.rocket.travelpredicate.TravelPredicateType} 32 | * 33 | * @param config the celestial body configuration to be queried 34 | * @return the access weight required to generically reach this celestial body 35 | */ 36 | int accessWeight(@NotNull C config); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/celestialbody/landable/Landable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.celestialbody.landable; 24 | 25 | import dev.galacticraft.api.universe.celestialbody.CelestialBodyConfig; 26 | import dev.galacticraft.api.universe.celestialbody.SurfaceEnvironment; 27 | import dev.galacticraft.api.universe.celestialbody.landable.teleporter.CelestialTeleporter; 28 | import net.minecraft.core.Holder; 29 | import net.minecraft.resources.ResourceKey; 30 | import net.minecraft.world.level.Level; 31 | import org.jetbrains.annotations.NotNull; 32 | 33 | /** 34 | * Represents a {@link dev.galacticraft.api.universe.celestialbody.CelestialBodyType celestial body type} that has a {@link Level} linked to itself. 35 | * 36 | * @param the type of configuration 37 | */ 38 | public interface Landable extends SurfaceEnvironment { 39 | /** 40 | * Returns the registry key of the {@link Level} this celestial body is linked to 41 | * 42 | * @param config the celestial body configuration to be queried 43 | * @return the registry key of the {@link Level} this celestial body is linked to 44 | */ 45 | @NotNull ResourceKey world(C config); 46 | 47 | Holder> teleporter(C config); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/celestialbody/landable/teleporter/config/CelestialTeleporterConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.celestialbody.landable.teleporter.config; 24 | 25 | public interface CelestialTeleporterConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/celestialbody/landable/teleporter/type/CelestialTeleporterType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.celestialbody.landable.teleporter.type; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.universe.celestialbody.CelestialBody; 27 | import dev.galacticraft.api.universe.celestialbody.landable.teleporter.CelestialTeleporter; 28 | import dev.galacticraft.api.universe.celestialbody.landable.teleporter.config.CelestialTeleporterConfig; 29 | import net.minecraft.server.level.ServerLevel; 30 | import net.minecraft.server.level.ServerPlayer; 31 | import org.jetbrains.annotations.NotNull; 32 | 33 | public abstract class CelestialTeleporterType { 34 | private final Codec>> codec; 35 | 36 | public CelestialTeleporterType(Codec codec) { 37 | this.codec = codec.fieldOf("config").xmap((config) -> new CelestialTeleporter<>(this, config), CelestialTeleporter::config).codec(); 38 | } 39 | 40 | public @NotNull Codec>> codec() { 41 | return this.codec; 42 | } 43 | 44 | public abstract void onEnterAtmosphere(ServerLevel level, ServerPlayer player, CelestialBody body, CelestialBody fromBody, C config); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/celestialbody/satellite/Orbitable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.celestialbody.satellite; 24 | 25 | import dev.galacticraft.api.satellite.SatelliteRecipe; 26 | import dev.galacticraft.api.universe.celestialbody.CelestialBodyConfig; 27 | import org.jetbrains.annotations.Nullable; 28 | 29 | /** 30 | * Represents a {@link dev.galacticraft.api.universe.celestialbody.CelestialBodyType celestial body type} that can potentially allow player-made objects to orbit itself. 31 | * 32 | * @param the type of configuration 33 | */ 34 | public interface Orbitable { 35 | /** 36 | * Returns the {@link SatelliteRecipe stellite recipe} of this celestial body, or {@code null} if satellites should not be allowed to be created 37 | * 38 | * @param config the celestial body configuration to be queried 39 | * @return the {@link SatelliteRecipe satellite recipe} of this celestial body 40 | */ 41 | @Nullable SatelliteRecipe satelliteRecipe(C config); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/celestialbody/star/Star.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.celestialbody.star; 24 | 25 | import dev.galacticraft.api.universe.celestialbody.CelestialBodyConfig; 26 | 27 | /** 28 | * Represents a {@link dev.galacticraft.api.universe.celestialbody.CelestialBodyType celestial body type} that is a star. 29 | * 30 | * @param the type of configuration 31 | */ 32 | public interface Star { 33 | /** 34 | * Returns the solar luminosity of this star (1.0 is the Sun's luminance) 35 | * 36 | * @param config the star configuration to be parsed 37 | * @return the solar luminosity of this star 38 | */ 39 | double luminance(C config); 40 | 41 | /** 42 | * Returns the surface temperature of this star in Kelvin 43 | * 44 | * @param config the star configuration to be parsed 45 | * @return the surface temperature of this star 46 | */ 47 | /* positive */ int surfaceTemperature(C config); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/display/CelestialDisplay.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.display; 24 | 25 | import com.mojang.blaze3d.vertex.BufferBuilder; 26 | import com.mojang.blaze3d.vertex.PoseStack; 27 | import com.mojang.serialization.Codec; 28 | import dev.galacticraft.api.registry.BuiltInAddonRegistries; 29 | import net.fabricmc.api.EnvType; 30 | import net.fabricmc.api.Environment; 31 | import net.minecraft.client.renderer.ShaderInstance; 32 | import org.joml.Vector4f; 33 | 34 | import java.util.function.Consumer; 35 | import java.util.function.Supplier; 36 | 37 | public record CelestialDisplay>(T type, C config) { 38 | public static final Codec> CODEC = BuiltInAddonRegistries.CELESTIAL_DISPLAY_TYPE.byNameCodec().dispatch(CelestialDisplay::type, CelestialDisplayType::codec); 39 | 40 | @Environment(EnvType.CLIENT) 41 | public Vector4f render(PoseStack matrices, BufferBuilder buffer, int scale, double mouseX, double mouseY, float delta, Consumer> shaderSetter) { 42 | return this.type().render(matrices, buffer, scale, mouseX, mouseY, delta, shaderSetter, this.config()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/display/CelestialDisplayConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.display; 24 | 25 | public interface CelestialDisplayConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/position/CelestialPosition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.position; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.registry.BuiltInAddonRegistries; 27 | 28 | public record CelestialPosition>(T type, 29 | C config) { 30 | public static final Codec> CODEC = BuiltInAddonRegistries.CELESTIAL_POSITION_TYPE.byNameCodec().dispatch(CelestialPosition::type, CelestialPositionType::codec); 31 | 32 | public double x(long worldTime, float delta) { 33 | return this.type().x(this.config(), worldTime, delta); 34 | } 35 | 36 | public double y(long worldTime, float delta) { 37 | return this.type().y(this.config(), worldTime, delta); 38 | } 39 | 40 | public float lineScale() { 41 | return this.type().lineScale(this.config()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/position/CelestialPositionConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.position; 24 | 25 | public interface CelestialPositionConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/api/universe/position/CelestialPositionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.api.universe.position; 24 | 25 | import com.mojang.serialization.Codec; 26 | 27 | public abstract class CelestialPositionType { 28 | private final Codec>> codec; 29 | 30 | public CelestialPositionType(Codec codec) { 31 | this.codec = codec.fieldOf("config").xmap((config) -> new CelestialPosition<>(this, config), CelestialPosition::config).codec(); 32 | } 33 | 34 | public abstract double x(C config, long worldTime, float delta); 35 | 36 | public abstract double y(C config, long worldTime, float delta); 37 | 38 | public float lineScale(C config) { 39 | return Float.NaN; 40 | } 41 | 42 | public Codec>> codec() { 43 | return this.codec; 44 | } 45 | 46 | public CelestialPosition> configure(C config) { 47 | return new CelestialPosition<>(this, config); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/accessor/SoundSystemAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.accessor; 24 | 25 | import org.jetbrains.annotations.ApiStatus; 26 | 27 | /** 28 | * @author TeamGalacticraft 29 | */ 30 | @ApiStatus.Internal 31 | public interface SoundSystemAccessor { 32 | void updateAtmosphericVolumeMultiplier(float multiplier); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/client/accessor/ClientResearchAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.client.accessor; 24 | 25 | import dev.galacticraft.api.accessor.ResearchAccessor; 26 | import net.fabricmc.api.EnvType; 27 | import net.fabricmc.api.Environment; 28 | import net.minecraft.network.FriendlyByteBuf; 29 | import org.jetbrains.annotations.ApiStatus; 30 | 31 | @Environment(EnvType.CLIENT) 32 | @ApiStatus.Internal 33 | public interface ClientResearchAccessor extends ResearchAccessor { 34 | void readChanges(FriendlyByteBuf buf); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/client/rocket/render/RocketPartRendererRegistryImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.client.rocket.render; 24 | 25 | import dev.galacticraft.api.entity.rocket.render.RocketPartRenderer; 26 | import dev.galacticraft.api.entity.rocket.render.RocketPartRendererRegistry; 27 | import dev.galacticraft.api.rocket.part.RocketPart; 28 | import net.fabricmc.api.EnvType; 29 | import net.fabricmc.api.Environment; 30 | import net.minecraft.resources.ResourceKey; 31 | import org.jetbrains.annotations.NotNull; 32 | 33 | import java.util.HashMap; 34 | import java.util.Map; 35 | 36 | @Environment(EnvType.CLIENT) 37 | public class RocketPartRendererRegistryImpl implements RocketPartRendererRegistry { 38 | private final Map>, RocketPartRenderer> renderers = new HashMap<>(); 39 | 40 | public RocketPartRendererRegistryImpl() {} 41 | 42 | @Override 43 | public > void register(@NotNull ResourceKey id, @NotNull RocketPartRenderer renderer) { 44 | this.renderers.put(id, renderer); 45 | } 46 | 47 | @Override 48 | public > @NotNull RocketPartRenderer getRenderer(ResourceKey part) { 49 | return this.renderers.getOrDefault(part, EmptyRocketPartRenderer.INSTANCE); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/codec/AlternateDecoderCodec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.codec; 24 | 25 | import com.mojang.datafixers.util.Pair; 26 | import com.mojang.serialization.Codec; 27 | import com.mojang.serialization.DataResult; 28 | import com.mojang.serialization.Decoder; 29 | import com.mojang.serialization.DynamicOps; 30 | 31 | public record AlternateDecoderCodec(Decoder alternative, Codec main) implements Codec { 32 | @Override 33 | public DataResult> decode(DynamicOps ops, T input) { 34 | DataResult> decode = this.alternative.decode(ops, input); 35 | if (decode.error().isPresent()) { 36 | return this.main.decode(ops, input); 37 | } else { 38 | return decode; 39 | } 40 | } 41 | 42 | @Override 43 | public DataResult encode(A input, DynamicOps ops, T prefix) { 44 | return this.main.encode(input, ops, prefix); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/codec/JsonDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.codec; 24 | 25 | import com.google.gson.JsonElement; 26 | import com.mojang.datafixers.util.Pair; 27 | import com.mojang.serialization.DataResult; 28 | import com.mojang.serialization.Decoder; 29 | import com.mojang.serialization.DynamicOps; 30 | import com.mojang.serialization.JsonOps; 31 | 32 | @FunctionalInterface 33 | public interface JsonDecoder extends Decoder { 34 | @Override 35 | default DataResult> decode(DynamicOps ops, T input) { 36 | return DataResult.success(new Pair<>(apply(ops, ops.convertTo(JsonOps.INSTANCE, input)), input)); 37 | } 38 | 39 | A apply(DynamicOps ops, JsonElement element); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/codec/MiscCodecs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.codec; 24 | 25 | import com.mojang.serialization.Codec; 26 | import net.minecraft.network.chat.Component; 27 | import net.minecraft.network.chat.MutableComponent; 28 | import net.minecraft.network.chat.contents.TranslatableContents; 29 | 30 | public final class MiscCodecs { 31 | //todo: auto derive name/desc? 32 | public static final Codec TRANSLATABLE_COMPONENT = Codec.STRING.xmap(Component::translatable, c -> c.getContents() instanceof TranslatableContents translatable ? translatable.getKey() : c.getString()); 33 | private MiscCodecs() {} 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/data/GeneratingBootstrapContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.data; 24 | 25 | import com.mojang.serialization.Lifecycle; 26 | import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider; 27 | import net.minecraft.core.Holder; 28 | import net.minecraft.core.HolderGetter; 29 | import net.minecraft.core.HolderLookup; 30 | import net.minecraft.core.Registry; 31 | import net.minecraft.data.worldgen.BootstapContext; 32 | import net.minecraft.resources.ResourceKey; 33 | import org.jetbrains.annotations.NotNull; 34 | 35 | public record GeneratingBootstrapContext(HolderLookup.Provider registries, FabricDynamicRegistryProvider.Entries entries) implements BootstapContext { 36 | @Override 37 | public Holder.Reference register(ResourceKey resourceKey, T object, Lifecycle lifecycle) { 38 | return (Holder.Reference) this.entries.add(resourceKey, object); 39 | } 40 | 41 | @Override 42 | public @NotNull HolderGetter lookup(ResourceKey> resourceKey) { 43 | return this.registries.lookupOrThrow(resourceKey); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/accessor/AdvancementRewardsAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.accessor; 24 | 25 | import net.minecraft.resources.ResourceLocation; 26 | import org.jetbrains.annotations.NotNull; 27 | import org.jetbrains.annotations.Nullable; 28 | 29 | public interface AdvancementRewardsAccessor { 30 | void setRocketPartRewards(@NotNull ResourceLocation @Nullable [] parts); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/accessor/ChunkOxygenAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.accessor; 24 | 25 | public interface ChunkOxygenAccessor { 26 | /** 27 | * Returns whether the supplied position in the chunk is breathable for entities 28 | * 29 | * @param x the position to test on the X-axis, normalized from 0 to 15 30 | * @param y the position to test on the Y-axis, must be within world height 31 | * @param z the position to test on the Z-axis, normalized from 0 to 15 32 | * @return whether the supplied position in the chunk is breathable for entities 33 | */ 34 | boolean galacticraft$isInverted(int x, int y, int z); 35 | 36 | /** 37 | * Sets the breathable state for entities for the supplied position 38 | * 39 | * @param x the position to test on the X-axis, normalized from 0 to 15 40 | * @param y the position to test on the Y-axis, must be within world height 41 | * @param z the position to test on the Z-axis, normalized from 0 to 15 42 | * @param inverted whether the supplied position is breathable 43 | */ 44 | void galacticraft$setInverted(int x, int y, int z, boolean inverted); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/accessor/ChunkOxygenSyncer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.accessor; 24 | 25 | import net.minecraft.network.FriendlyByteBuf; 26 | import org.jetbrains.annotations.NotNull; 27 | import org.jetbrains.annotations.Nullable; 28 | 29 | public interface ChunkOxygenSyncer { 30 | default @Nullable FriendlyByteBuf galacticraft$syncOxygenPacketsToClient() { 31 | return null; 32 | } 33 | 34 | default void galacticraft$readOxygenUpdate(@NotNull FriendlyByteBuf buf) { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/accessor/ChunkSectionOxygenAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.accessor; 24 | 25 | import net.minecraft.network.FriendlyByteBuf; 26 | import org.jetbrains.annotations.ApiStatus; 27 | import org.jetbrains.annotations.NotNull; 28 | import org.jetbrains.annotations.Nullable; 29 | 30 | import java.util.BitSet; 31 | 32 | /** 33 | * @author TeamGalacticraft 34 | */ 35 | @ApiStatus.Internal 36 | public interface ChunkSectionOxygenAccessor { 37 | boolean galacticraft$isInverted(int x, int y, int z); 38 | 39 | void galacticraft$setInverted(int x, int y, int z, boolean inverted); 40 | 41 | @Nullable BitSet galacticraft$inversionBits(); 42 | 43 | void galacticraft$setInversionBits(@Nullable BitSet set); 44 | 45 | short galacticraft$modifiedBlocks(); 46 | 47 | void galacticraft$setModifiedBlocks(short amount); 48 | 49 | void galacticraft$writeOxygenPacket(@NotNull FriendlyByteBuf buf); 50 | 51 | void galacticraft$readOxygenPacket(@NotNull FriendlyByteBuf buf); 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/accessor/InternalLevelOxygenAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.accessor; 24 | 25 | import org.jetbrains.annotations.ApiStatus; 26 | 27 | @ApiStatus.Internal 28 | public interface InternalLevelOxygenAccessor { 29 | boolean getDefaultBreathable(); 30 | 31 | void setDefaultBreathable(boolean breathable); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/accessor/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | @ApiStatus.Internal 24 | package dev.galacticraft.impl.internal.accessor; 25 | 26 | import org.jetbrains.annotations.ApiStatus; -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/mixin/client/ParticleAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.mixin.client; 24 | 25 | import net.minecraft.client.particle.Particle; 26 | import org.spongepowered.asm.mixin.Mixin; 27 | import org.spongepowered.asm.mixin.gen.Accessor; 28 | 29 | @Mixin(Particle.class) 30 | public interface ParticleAccessor { 31 | @Accessor("gravity") 32 | float getGravityStrength(); 33 | 34 | @Accessor("gravity") 35 | void setGravityStrength(float gravityStrength); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/mixin/client/ParticleManagerMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.mixin.client; 24 | 25 | import dev.galacticraft.api.universe.celestialbody.CelestialBody; 26 | import net.fabricmc.api.EnvType; 27 | import net.fabricmc.api.Environment; 28 | import net.minecraft.client.multiplayer.ClientLevel; 29 | import net.minecraft.client.particle.Particle; 30 | import net.minecraft.client.particle.ParticleEngine; 31 | import org.spongepowered.asm.mixin.Mixin; 32 | import org.spongepowered.asm.mixin.Shadow; 33 | import org.spongepowered.asm.mixin.injection.At; 34 | import org.spongepowered.asm.mixin.injection.Inject; 35 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 36 | 37 | @Mixin(ParticleEngine.class) 38 | @Environment(EnvType.CLIENT) 39 | public abstract class ParticleManagerMixin { 40 | @Shadow 41 | protected ClientLevel level; 42 | 43 | @Inject(method = "add(Lnet/minecraft/client/particle/Particle;)V", at = @At("RETURN")) 44 | protected void galacticraft_overrideGravity(Particle particle, CallbackInfo ci) { 45 | CelestialBody.getByDimension(this.level).ifPresent(celestialBodyType -> ((ParticleAccessor) particle).setGravityStrength(((ParticleAccessor) particle).getGravityStrength() * celestialBodyType.gravity())); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/mixin/client/SoundManagerAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.mixin.client; 24 | 25 | import net.fabricmc.api.EnvType; 26 | import net.fabricmc.api.Environment; 27 | import net.minecraft.client.sounds.SoundEngine; 28 | import net.minecraft.client.sounds.SoundManager; 29 | import org.spongepowered.asm.mixin.Mixin; 30 | import org.spongepowered.asm.mixin.gen.Accessor; 31 | 32 | @Mixin(SoundManager.class) 33 | @Environment(EnvType.CLIENT) 34 | public interface SoundManagerAccessor { 35 | @Accessor("soundEngine") 36 | SoundEngine getSoundSystem(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/mixin/client/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | /** 24 | * Mixins for Galacticraft-API 25 | *

26 | * Client-sided mixins for Galacticraft-API 27 | */ 28 | @ApiStatus.Internal 29 | package dev.galacticraft.impl.internal.mixin.client; 30 | 31 | import org.jetbrains.annotations.ApiStatus; -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/mixin/gravity/EntityGravityMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.mixin.gravity; 24 | 25 | import dev.galacticraft.api.universe.celestialbody.CelestialBody; 26 | import net.minecraft.world.entity.Entity; 27 | import net.minecraft.world.entity.item.ItemEntity; 28 | import net.minecraft.world.entity.item.PrimedTnt; 29 | import net.minecraft.world.entity.vehicle.AbstractMinecart; 30 | import org.spongepowered.asm.mixin.Mixin; 31 | import org.spongepowered.asm.mixin.injection.Constant; 32 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 33 | 34 | @Mixin({ItemEntity.class, PrimedTnt.class, AbstractMinecart.class}) 35 | public abstract class EntityGravityMixin { 36 | @ModifyConstant(method = "tick", constant = @Constant(doubleValue = -0.04D)) 37 | private double galacticraft_changeEntityGravity(double defaultValue) { 38 | return CelestialBody.getByDimension(((Entity) (Object) this).level()).map(celestialBody -> celestialBody.gravity() / 1.75D * defaultValue).orElse(defaultValue); 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/mixin/oxygen/EmptyLevelChunkMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.mixin.oxygen; 24 | 25 | import dev.galacticraft.impl.internal.accessor.ChunkOxygenAccessor; 26 | import dev.galacticraft.impl.internal.accessor.ChunkOxygenSyncer; 27 | import net.minecraft.world.level.chunk.EmptyLevelChunk; 28 | import org.spongepowered.asm.mixin.Mixin; 29 | 30 | /** 31 | * @author TeamGalacticraft 32 | */ 33 | @Mixin(EmptyLevelChunk.class) 34 | public abstract class EmptyLevelChunkMixin implements ChunkOxygenSyncer, ChunkOxygenAccessor { 35 | @Override 36 | public boolean galacticraft$isInverted(int x, int y, int z) { 37 | return false; 38 | } 39 | 40 | @Override 41 | public void galacticraft$setInverted(int x, int y, int z, boolean inverted) { 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/mixin/oxygen/ImposterProtoChunkMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.internal.mixin.oxygen; 24 | 25 | import dev.galacticraft.impl.internal.accessor.ChunkOxygenAccessor; 26 | import net.minecraft.world.level.chunk.ImposterProtoChunk; 27 | import net.minecraft.world.level.chunk.LevelChunk; 28 | import org.spongepowered.asm.mixin.Final; 29 | import org.spongepowered.asm.mixin.Mixin; 30 | import org.spongepowered.asm.mixin.Shadow; 31 | 32 | @Mixin(ImposterProtoChunk.class) 33 | public abstract class ImposterProtoChunkMixin implements ChunkOxygenAccessor { 34 | @Shadow @Final private boolean allowWrites; 35 | @Shadow @Final private LevelChunk wrapped; 36 | 37 | @Override 38 | public boolean galacticraft$isInverted(int x, int y, int z) { 39 | return ((ChunkOxygenAccessor)this.wrapped).galacticraft$isInverted(x, y, z); 40 | } 41 | 42 | @Override 43 | public void galacticraft$setInverted(int x, int y, int z, boolean inverted) { 44 | if (this.allowWrites) { 45 | ((ChunkOxygenAccessor)this.wrapped).galacticraft$setInverted(x, y, z, inverted); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/mixin/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | /** 24 | * Mixins for Galacticraft-API 25 | */ 26 | @ApiStatus.Internal 27 | package dev.galacticraft.impl.internal.mixin; 28 | 29 | import org.jetbrains.annotations.ApiStatus; -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/internal/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | /** 24 | * Classes to make the Addon API run as an independent mod. 25 | * Includes ModInitializers and Mixins for the API. 26 | */ 27 | @ApiStatus.Internal 28 | package dev.galacticraft.impl.internal; 29 | 30 | import org.jetbrains.annotations.ApiStatus; -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/RocketBodyImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part; 24 | 25 | import dev.galacticraft.api.rocket.part.RocketBody; 26 | import dev.galacticraft.api.rocket.part.config.RocketBodyConfig; 27 | import dev.galacticraft.api.rocket.part.type.RocketBodyType; 28 | import dev.galacticraft.impl.rocket.part.config.DefaultRocketBodyConfig; 29 | import dev.galacticraft.impl.rocket.part.type.InvalidRocketBodyType; 30 | import dev.galacticraft.impl.universe.BuiltinObjects; 31 | import net.minecraft.data.worldgen.BootstapContext; 32 | import org.jetbrains.annotations.ApiStatus; 33 | import org.jetbrains.annotations.NotNull; 34 | 35 | public record RocketBodyImpl>(@NotNull C config, @NotNull T type) implements RocketBody { 36 | @ApiStatus.Internal 37 | public static void bootstrapRegistries(BootstapContext> context) { 38 | context.register(BuiltinObjects.INVALID_ROCKET_BODY, RocketBody.create(DefaultRocketBodyConfig.INSTANCE, InvalidRocketBodyType.INSTANCE)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/RocketBoosterImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part; 24 | 25 | import dev.galacticraft.api.rocket.part.RocketBooster; 26 | import dev.galacticraft.api.rocket.part.config.RocketBoosterConfig; 27 | import dev.galacticraft.api.rocket.part.type.RocketBoosterType; 28 | import dev.galacticraft.impl.rocket.part.config.DefaultRocketBoosterConfig; 29 | import dev.galacticraft.impl.rocket.part.type.InvalidRocketBoosterType; 30 | import dev.galacticraft.impl.universe.BuiltinObjects; 31 | import net.minecraft.data.worldgen.BootstapContext; 32 | import org.jetbrains.annotations.ApiStatus; 33 | import org.jetbrains.annotations.NotNull; 34 | 35 | public record RocketBoosterImpl>(@NotNull C config, @NotNull T type) implements RocketBooster { 36 | @ApiStatus.Internal 37 | public static void bootstrapRegistries(BootstapContext> context) { 38 | context.register(BuiltinObjects.INVALID_ROCKET_BOOSTER, RocketBooster.create(DefaultRocketBoosterConfig.INSTANCE, InvalidRocketBoosterType.INSTANCE)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/RocketBottomImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part; 24 | 25 | import dev.galacticraft.api.rocket.part.RocketBottom; 26 | import dev.galacticraft.api.rocket.part.config.RocketBottomConfig; 27 | import dev.galacticraft.api.rocket.part.type.RocketBottomType; 28 | import dev.galacticraft.impl.rocket.part.config.DefaultRocketBottomConfig; 29 | import dev.galacticraft.impl.rocket.part.type.InvalidRocketBottomType; 30 | import dev.galacticraft.impl.universe.BuiltinObjects; 31 | import net.minecraft.data.worldgen.BootstapContext; 32 | import org.jetbrains.annotations.ApiStatus; 33 | import org.jetbrains.annotations.NotNull; 34 | 35 | public record RocketBottomImpl>(@NotNull C config, @NotNull T type) implements RocketBottom { 36 | @ApiStatus.Internal 37 | public static void bootstrapRegistries(BootstapContext> context) { 38 | context.register(BuiltinObjects.INVALID_ROCKET_BOTTOM, RocketBottom.create(DefaultRocketBottomConfig.INSTANCE, InvalidRocketBottomType.INSTANCE)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/RocketConeImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part; 24 | 25 | import dev.galacticraft.api.rocket.part.RocketCone; 26 | import dev.galacticraft.api.rocket.part.config.RocketConeConfig; 27 | import dev.galacticraft.api.rocket.part.type.RocketConeType; 28 | import dev.galacticraft.impl.rocket.part.config.DefaultRocketConeConfig; 29 | import dev.galacticraft.impl.rocket.part.type.InvalidRocketConeType; 30 | import dev.galacticraft.impl.universe.BuiltinObjects; 31 | import net.minecraft.data.worldgen.BootstapContext; 32 | import org.jetbrains.annotations.ApiStatus; 33 | import org.jetbrains.annotations.NotNull; 34 | 35 | public record RocketConeImpl>(@NotNull C config, @NotNull T type) implements RocketCone { 36 | @ApiStatus.Internal 37 | public static void bootstrapRegistries(BootstapContext> context) { 38 | context.register(BuiltinObjects.INVALID_ROCKET_CONE, RocketCone.create(DefaultRocketConeConfig.INSTANCE, InvalidRocketConeType.INSTANCE)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/RocketFinImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part; 24 | 25 | import dev.galacticraft.api.rocket.part.RocketFin; 26 | import dev.galacticraft.api.rocket.part.config.RocketFinConfig; 27 | import dev.galacticraft.api.rocket.part.type.RocketFinType; 28 | import dev.galacticraft.impl.rocket.part.config.DefaultRocketFinConfig; 29 | import dev.galacticraft.impl.rocket.part.type.InvalidRocketFinType; 30 | import dev.galacticraft.impl.universe.BuiltinObjects; 31 | import net.minecraft.data.worldgen.BootstapContext; 32 | import org.jetbrains.annotations.ApiStatus; 33 | import org.jetbrains.annotations.NotNull; 34 | 35 | public record RocketFinImpl>(@NotNull C config, @NotNull T type) implements RocketFin { 36 | @ApiStatus.Internal 37 | public static void bootstrapRegistries(BootstapContext> context) { 38 | context.register(BuiltinObjects.INVALID_ROCKET_FIN, RocketFin.create(DefaultRocketFinConfig.INSTANCE, InvalidRocketFinType.INSTANCE)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/RocketUpgradeImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part; 24 | 25 | import dev.galacticraft.api.rocket.part.RocketUpgrade; 26 | import dev.galacticraft.api.rocket.part.config.RocketUpgradeConfig; 27 | import dev.galacticraft.api.rocket.part.type.RocketUpgradeType; 28 | import dev.galacticraft.impl.rocket.part.config.DefaultRocketUpgradeConfig; 29 | import dev.galacticraft.impl.rocket.part.type.InvalidRocketUpgradeType; 30 | import dev.galacticraft.impl.universe.BuiltinObjects; 31 | import net.minecraft.data.worldgen.BootstapContext; 32 | import org.jetbrains.annotations.ApiStatus; 33 | import org.jetbrains.annotations.NotNull; 34 | 35 | public record RocketUpgradeImpl>(@NotNull C config, @NotNull T type) implements RocketUpgrade { 36 | @ApiStatus.Internal 37 | public static void bootstrapRegistries(BootstapContext> context) { 38 | context.register(BuiltinObjects.INVALID_ROCKET_UPGRADE, RocketUpgrade.create(DefaultRocketUpgradeConfig.INSTANCE, InvalidRocketUpgradeType.INSTANCE)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/BasicRocketBodyConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import com.mojang.serialization.codecs.RecordCodecBuilder; 27 | import dev.galacticraft.api.rocket.part.config.RocketBodyConfig; 28 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 29 | 30 | public record BasicRocketBodyConfig(ConfiguredTravelPredicate predicate, int maxPassengers, int upgradeCapacity) implements RocketBodyConfig { 31 | public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( 32 | ConfiguredTravelPredicate.DIRECT_CODEC.fieldOf("predicate").forGetter(BasicRocketBodyConfig::predicate), 33 | Codec.INT.fieldOf("max_passengers").forGetter(BasicRocketBodyConfig::maxPassengers), 34 | Codec.INT.fieldOf("upgrade_capacity").forGetter(BasicRocketBodyConfig::upgradeCapacity) 35 | ).apply(instance, BasicRocketBodyConfig::new)); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/BasicRocketBoosterConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import com.mojang.serialization.codecs.RecordCodecBuilder; 27 | import dev.galacticraft.api.rocket.part.config.RocketBoosterConfig; 28 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 29 | 30 | public record BasicRocketBoosterConfig(ConfiguredTravelPredicate predicate, double maxVelocity, double acceleration, long fuelUsage) implements RocketBoosterConfig { 31 | public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( 32 | ConfiguredTravelPredicate.DIRECT_CODEC.fieldOf("predicate").forGetter(BasicRocketBoosterConfig::predicate), 33 | Codec.DOUBLE.fieldOf("max_velocity").forGetter(BasicRocketBoosterConfig::maxVelocity), 34 | Codec.DOUBLE.fieldOf("acceleration").forGetter(BasicRocketBoosterConfig::acceleration), 35 | Codec.LONG.fieldOf("fuel_usage").forGetter(BasicRocketBoosterConfig::fuelUsage) 36 | ).apply(instance, BasicRocketBoosterConfig::new)); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/BasicRocketBottomConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import com.mojang.serialization.codecs.RecordCodecBuilder; 27 | import dev.galacticraft.api.rocket.part.config.RocketBottomConfig; 28 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 29 | 30 | public record BasicRocketBottomConfig(ConfiguredTravelPredicate predicate, long fuelCapacity) implements RocketBottomConfig { 31 | public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( 32 | ConfiguredTravelPredicate.DIRECT_CODEC.fieldOf("predicate").forGetter(BasicRocketBottomConfig::predicate), 33 | Codec.LONG.fieldOf("fuel_capacity").forGetter(BasicRocketBottomConfig::fuelCapacity) 34 | ).apply(instance, BasicRocketBottomConfig::new)); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/BasicRocketConeConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.config.RocketConeConfig; 27 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 28 | 29 | public record BasicRocketConeConfig(ConfiguredTravelPredicate predicate) implements RocketConeConfig { 30 | public static final Codec CODEC = ConfiguredTravelPredicate.DIRECT_CODEC.xmap(BasicRocketConeConfig::new, BasicRocketConeConfig::predicate); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/BasicRocketFinConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import com.mojang.serialization.codecs.RecordCodecBuilder; 27 | import dev.galacticraft.api.rocket.part.config.RocketFinConfig; 28 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 29 | 30 | public record BasicRocketFinConfig(ConfiguredTravelPredicate predicate, boolean canManeuver) implements RocketFinConfig { 31 | public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( 32 | ConfiguredTravelPredicate.DIRECT_CODEC.fieldOf("predicate").forGetter(BasicRocketFinConfig::predicate), 33 | Codec.BOOL.fieldOf("can_maneuver").forGetter(BasicRocketFinConfig::canManeuver) 34 | ).apply(instance, BasicRocketFinConfig::new)); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/DefaultRocketBodyConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.config.RocketBodyConfig; 27 | 28 | public final class DefaultRocketBodyConfig implements RocketBodyConfig { 29 | public static final DefaultRocketBodyConfig INSTANCE = new DefaultRocketBodyConfig(); 30 | public static final Codec CODEC = Codec.unit(INSTANCE); 31 | 32 | private DefaultRocketBodyConfig() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/DefaultRocketBoosterConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.config.RocketBoosterConfig; 27 | 28 | public final class DefaultRocketBoosterConfig implements RocketBoosterConfig { 29 | public static final DefaultRocketBoosterConfig INSTANCE = new DefaultRocketBoosterConfig(); 30 | public static final Codec CODEC = Codec.unit(INSTANCE); 31 | 32 | private DefaultRocketBoosterConfig() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/DefaultRocketBottomConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.config.RocketBottomConfig; 27 | 28 | public final class DefaultRocketBottomConfig implements RocketBottomConfig { 29 | public static final DefaultRocketBottomConfig INSTANCE = new DefaultRocketBottomConfig(); 30 | public static final Codec CODEC = Codec.unit(INSTANCE); 31 | 32 | private DefaultRocketBottomConfig() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/DefaultRocketConeConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.config.RocketConeConfig; 27 | 28 | public final class DefaultRocketConeConfig implements RocketConeConfig { 29 | public static final DefaultRocketConeConfig INSTANCE = new DefaultRocketConeConfig(); 30 | public static final Codec CODEC = Codec.unit(INSTANCE); 31 | 32 | private DefaultRocketConeConfig() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/DefaultRocketFinConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.config.RocketFinConfig; 27 | 28 | public final class DefaultRocketFinConfig implements RocketFinConfig { 29 | public static final DefaultRocketFinConfig INSTANCE = new DefaultRocketFinConfig(); 30 | public static final Codec CODEC = Codec.unit(INSTANCE); 31 | 32 | private DefaultRocketFinConfig() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/config/DefaultRocketUpgradeConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.part.config.RocketUpgradeConfig; 27 | 28 | public final class DefaultRocketUpgradeConfig implements RocketUpgradeConfig { 29 | public static final DefaultRocketUpgradeConfig INSTANCE = new DefaultRocketUpgradeConfig(); 30 | public static final Codec CODEC = Codec.unit(INSTANCE); 31 | 32 | private DefaultRocketUpgradeConfig() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/type/BasicRocketConeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.type; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.entity.Rocket; 27 | import dev.galacticraft.api.rocket.part.type.RocketConeType; 28 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 29 | import dev.galacticraft.impl.rocket.part.config.BasicRocketConeConfig; 30 | import dev.galacticraft.impl.rocket.travelpredicate.type.DefaultTravelPredicateType; 31 | import org.jetbrains.annotations.NotNull; 32 | 33 | public final class BasicRocketConeType extends RocketConeType { 34 | public static final BasicRocketConeType INSTANCE = new BasicRocketConeType(BasicRocketConeConfig.CODEC); 35 | 36 | private BasicRocketConeType(@NotNull Codec configCodec) { 37 | super(configCodec); 38 | } 39 | 40 | @Override 41 | public void tick(@NotNull Rocket rocket, @NotNull BasicRocketConeConfig config) { 42 | } 43 | 44 | @Override 45 | public @NotNull ConfiguredTravelPredicate travelPredicate(@NotNull BasicRocketConeConfig config) { 46 | return config.predicate(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/part/type/InvalidRocketConeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.part.type; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.entity.Rocket; 27 | import dev.galacticraft.api.rocket.part.type.RocketConeType; 28 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 29 | import dev.galacticraft.impl.rocket.part.config.DefaultRocketConeConfig; 30 | import dev.galacticraft.impl.rocket.travelpredicate.type.DefaultTravelPredicateType; 31 | import org.jetbrains.annotations.NotNull; 32 | 33 | public final class InvalidRocketConeType extends RocketConeType { 34 | public static final InvalidRocketConeType INSTANCE = new InvalidRocketConeType(DefaultRocketConeConfig.CODEC); 35 | 36 | private InvalidRocketConeType(@NotNull Codec configCodec) { 37 | super(configCodec); 38 | } 39 | 40 | @Override 41 | public void tick(@NotNull Rocket rocket, @NotNull DefaultRocketConeConfig config) { 42 | } 43 | 44 | @Override 45 | public @NotNull ConfiguredTravelPredicate travelPredicate(@NotNull DefaultRocketConeConfig config) { 46 | return DefaultTravelPredicateType.CONFIGURED; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/recipe/RocketPartRecipeImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.recipe; 24 | 25 | import dev.galacticraft.api.rocket.part.RocketPart; 26 | import dev.galacticraft.api.rocket.recipe.RocketPartRecipe; 27 | import dev.galacticraft.api.rocket.recipe.RocketPartRecipeSlot; 28 | import dev.galacticraft.api.rocket.recipe.config.RocketPartRecipeConfig; 29 | import dev.galacticraft.api.rocket.recipe.type.RocketPartRecipeType; 30 | import net.minecraft.resources.ResourceKey; 31 | import org.jetbrains.annotations.NotNull; 32 | 33 | import java.util.List; 34 | 35 | public record RocketPartRecipeImpl>(T type, C config) implements RocketPartRecipe { 36 | @Override 37 | public int width() { 38 | return this.type().width(this.config); 39 | } 40 | 41 | @Override 42 | public int height() { 43 | return this.type().height(this.config); 44 | } 45 | 46 | @Override 47 | public @NotNull List slots() { 48 | return this.type().slots(this.config); 49 | } 50 | 51 | @Override 52 | public ResourceKey> output() { 53 | return this.type().output(this.config); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/recipe/RocketPartRecipeSlotImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.recipe; 24 | 25 | import dev.galacticraft.api.rocket.recipe.RocketPartRecipeSlot; 26 | import net.minecraft.world.item.crafting.Ingredient; 27 | import org.jetbrains.annotations.NotNull; 28 | 29 | public record RocketPartRecipeSlotImpl(int x, int y, @NotNull Ingredient ingredient) implements RocketPartRecipeSlot { 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/travelpredicate/config/AccessWeightTravelPredicateConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.travelpredicate.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import com.mojang.serialization.codecs.RecordCodecBuilder; 27 | import dev.galacticraft.api.rocket.travelpredicate.TravelPredicateConfig; 28 | import dev.galacticraft.api.rocket.travelpredicate.TravelPredicateType; 29 | 30 | public record AccessWeightTravelPredicateConfig(int weight, 31 | TravelPredicateType.Result defaultType) implements TravelPredicateConfig { 32 | public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( 33 | Codec.INT.fieldOf("weight").forGetter(AccessWeightTravelPredicateConfig::weight), 34 | TravelPredicateType.Result.CODEC.optionalFieldOf("default", TravelPredicateType.Result.PASS).forGetter(AccessWeightTravelPredicateConfig::defaultType) 35 | ).apply(instance, AccessWeightTravelPredicateConfig::new)); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/travelpredicate/config/AndTravelPredicateConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.travelpredicate.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 27 | import dev.galacticraft.api.rocket.travelpredicate.TravelPredicateConfig; 28 | import org.jetbrains.annotations.NotNull; 29 | import org.jetbrains.annotations.Unmodifiable; 30 | 31 | import java.util.List; 32 | 33 | public record AndTravelPredicateConfig(@Unmodifiable @NotNull List> predicates) implements TravelPredicateConfig { 34 | public static final Codec CODEC = ConfiguredTravelPredicate.DIRECT_CODEC.listOf().xmap(AndTravelPredicateConfig::new, AndTravelPredicateConfig::predicates); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/travelpredicate/config/ConstantTravelPredicateConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.travelpredicate.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.travelpredicate.TravelPredicateConfig; 27 | import dev.galacticraft.api.rocket.travelpredicate.TravelPredicateType; 28 | 29 | public record ConstantTravelPredicateConfig(TravelPredicateType.Result type) implements TravelPredicateConfig { 30 | public static final Codec CODEC = TravelPredicateType.Result.CODEC.xmap(ConstantTravelPredicateConfig::new, ConstantTravelPredicateConfig::type); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/travelpredicate/config/DefaultTravelPredicateConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.travelpredicate.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.travelpredicate.TravelPredicateConfig; 27 | 28 | public final class DefaultTravelPredicateConfig implements TravelPredicateConfig { 29 | public static final DefaultTravelPredicateConfig INSTANCE = new DefaultTravelPredicateConfig(); 30 | public static final Codec CODEC = Codec.unit(INSTANCE); 31 | 32 | private DefaultTravelPredicateConfig() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/travelpredicate/config/OrTravelPredicateConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.travelpredicate.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 27 | import dev.galacticraft.api.rocket.travelpredicate.TravelPredicateConfig; 28 | import org.jetbrains.annotations.NotNull; 29 | import org.jetbrains.annotations.Unmodifiable; 30 | 31 | import java.util.List; 32 | 33 | public record OrTravelPredicateConfig(@Unmodifiable @NotNull List> predicates) implements TravelPredicateConfig { 34 | public static final Codec CODEC = ConfiguredTravelPredicate.DIRECT_CODEC.listOf().xmap(OrTravelPredicateConfig::new, OrTravelPredicateConfig::predicates); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/travelpredicate/type/ConstantTravelPredicateType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.travelpredicate.type; 24 | 25 | import dev.galacticraft.api.rocket.part.*; 26 | import dev.galacticraft.api.rocket.travelpredicate.TravelPredicateType; 27 | import dev.galacticraft.api.universe.celestialbody.CelestialBody; 28 | import dev.galacticraft.impl.rocket.travelpredicate.config.ConstantTravelPredicateConfig; 29 | 30 | public final class ConstantTravelPredicateType extends TravelPredicateType { 31 | public static final ConstantTravelPredicateType INSTANCE = new ConstantTravelPredicateType(); 32 | 33 | private ConstantTravelPredicateType() { 34 | super(ConstantTravelPredicateConfig.CODEC); 35 | } 36 | 37 | @Override 38 | public Result canTravel(CelestialBody from, CelestialBody to, RocketCone cone, RocketBody body, RocketFin fin, RocketBooster booster, RocketBottom bottom, RocketUpgrade[] upgrades, ConstantTravelPredicateConfig config) { 39 | return config.type(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/rocket/travelpredicate/type/DefaultTravelPredicateType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.rocket.travelpredicate.type; 24 | 25 | import dev.galacticraft.api.rocket.part.*; 26 | import dev.galacticraft.api.rocket.travelpredicate.ConfiguredTravelPredicate; 27 | import dev.galacticraft.api.rocket.travelpredicate.TravelPredicateType; 28 | import dev.galacticraft.api.universe.celestialbody.CelestialBody; 29 | import dev.galacticraft.impl.rocket.travelpredicate.config.DefaultTravelPredicateConfig; 30 | 31 | public final class DefaultTravelPredicateType extends TravelPredicateType { 32 | public static final DefaultTravelPredicateType INSTANCE = new DefaultTravelPredicateType(); 33 | public static final ConfiguredTravelPredicate CONFIGURED = INSTANCE.configure(DefaultTravelPredicateConfig.INSTANCE); 34 | 35 | private DefaultTravelPredicateType() { 36 | super(DefaultTravelPredicateConfig.CODEC); 37 | } 38 | 39 | @Override 40 | public Result canTravel(CelestialBody from, CelestialBody to, RocketCone cone, RocketBody body, RocketFin fin, RocketBooster booster, RocketBottom bottom, RocketUpgrade[] upgrades, DefaultTravelPredicateConfig config) { 41 | return Result.PASS; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/universe/celestialbody/landable/teleporter/config/DefaultCelestialTeleporterConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.universe.celestialbody.landable.teleporter.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.universe.celestialbody.landable.teleporter.config.CelestialTeleporterConfig; 27 | 28 | public class DefaultCelestialTeleporterConfig implements CelestialTeleporterConfig { 29 | public static final DefaultCelestialTeleporterConfig INSTANCE = new DefaultCelestialTeleporterConfig(); 30 | public static final Codec CODEC = Codec.unit(INSTANCE); 31 | 32 | private DefaultCelestialTeleporterConfig() {} 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/universe/display/config/EmptyCelestialDisplayConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.universe.display.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import dev.galacticraft.api.universe.display.CelestialDisplayConfig; 27 | 28 | public class EmptyCelestialDisplayConfig implements CelestialDisplayConfig { 29 | public static final EmptyCelestialDisplayConfig INSTANCE = new EmptyCelestialDisplayConfig(); 30 | public static final Codec CODEC = Codec.unit(EmptyCelestialDisplayConfig.INSTANCE); 31 | 32 | private EmptyCelestialDisplayConfig() {} 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/universe/display/config/IconCelestialDisplayConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.universe.display.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import com.mojang.serialization.codecs.RecordCodecBuilder; 27 | import dev.galacticraft.api.universe.display.CelestialDisplayConfig; 28 | import net.minecraft.resources.ResourceLocation; 29 | 30 | public record IconCelestialDisplayConfig(ResourceLocation texture, int u, int v, int width, int height, 31 | float scale) implements CelestialDisplayConfig { 32 | public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( 33 | ResourceLocation.CODEC.fieldOf("texture").forGetter(IconCelestialDisplayConfig::texture), 34 | Codec.INT.fieldOf("u").forGetter(IconCelestialDisplayConfig::u), 35 | Codec.INT.fieldOf("v").forGetter(IconCelestialDisplayConfig::v), 36 | Codec.INT.fieldOf("width").forGetter(IconCelestialDisplayConfig::width), 37 | Codec.INT.fieldOf("height").forGetter(IconCelestialDisplayConfig::height), 38 | Codec.FLOAT.fieldOf("scale").forGetter(IconCelestialDisplayConfig::scale) 39 | ).apply(instance, IconCelestialDisplayConfig::new)); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/universe/display/type/EmptyCelestialDisplayType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.universe.display.type; 24 | 25 | import com.mojang.blaze3d.vertex.BufferBuilder; 26 | import com.mojang.blaze3d.vertex.PoseStack; 27 | import dev.galacticraft.api.universe.display.CelestialDisplayType; 28 | import dev.galacticraft.impl.universe.display.config.EmptyCelestialDisplayConfig; 29 | import net.minecraft.client.renderer.ShaderInstance; 30 | import org.joml.Vector4f; 31 | 32 | import java.util.function.Consumer; 33 | import java.util.function.Supplier; 34 | 35 | public class EmptyCelestialDisplayType extends CelestialDisplayType { 36 | public static final EmptyCelestialDisplayType INSTANCE = new EmptyCelestialDisplayType(); 37 | 38 | private EmptyCelestialDisplayType() { 39 | super(EmptyCelestialDisplayConfig.CODEC); 40 | } 41 | 42 | @Override 43 | public Vector4f render(PoseStack matrices, BufferBuilder buffer, int size, double mouseX, double mouseY, float delta, Consumer> shaderSetter, EmptyCelestialDisplayConfig config) { 44 | return NULL_VECTOR; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/universe/position/config/OrbitalCelestialPositionConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.universe.position.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import com.mojang.serialization.codecs.RecordCodecBuilder; 27 | import dev.galacticraft.api.universe.position.CelestialPositionConfig; 28 | 29 | public record OrbitalCelestialPositionConfig(double orbitTime, double distance, double phaseShift, 30 | boolean planet) implements CelestialPositionConfig { 31 | public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( 32 | Codec.DOUBLE.fieldOf("orbit_time").forGetter(OrbitalCelestialPositionConfig::orbitTime), 33 | Codec.DOUBLE.fieldOf("distance").forGetter(OrbitalCelestialPositionConfig::distance), 34 | Codec.DOUBLE.fieldOf("phase_shift").forGetter(OrbitalCelestialPositionConfig::phaseShift), 35 | Codec.BOOL.fieldOf("planet").orElse(true).forGetter(OrbitalCelestialPositionConfig::planet) 36 | ).apply(instance, OrbitalCelestialPositionConfig::new)); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/universe/position/config/StaticCelestialPositionConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.universe.position.config; 24 | 25 | import com.mojang.serialization.Codec; 26 | import com.mojang.serialization.codecs.RecordCodecBuilder; 27 | import dev.galacticraft.api.universe.position.CelestialPositionConfig; 28 | 29 | public record StaticCelestialPositionConfig(double x, double y) implements CelestialPositionConfig { 30 | public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( 31 | Codec.DOUBLE.fieldOf("x").forGetter(StaticCelestialPositionConfig::x), 32 | Codec.DOUBLE.fieldOf("y").forGetter(StaticCelestialPositionConfig::y) 33 | ).apply(instance, StaticCelestialPositionConfig::new)); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/dev/galacticraft/impl/universe/position/type/StaticCelestialPositionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2023 Team Galacticraft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package dev.galacticraft.impl.universe.position.type; 24 | 25 | import dev.galacticraft.api.universe.position.CelestialPositionType; 26 | import dev.galacticraft.impl.universe.position.config.StaticCelestialPositionConfig; 27 | 28 | public class StaticCelestialPositionType extends CelestialPositionType { 29 | public static final StaticCelestialPositionType INSTANCE = new StaticCelestialPositionType(); 30 | 31 | private StaticCelestialPositionType() { 32 | super(StaticCelestialPositionConfig.CODEC); 33 | } 34 | 35 | @Override 36 | public double x(StaticCelestialPositionConfig config, long worldTime, float delta) { 37 | return config.x(); 38 | } 39 | 40 | @Override 41 | public double y(StaticCelestialPositionConfig config, long worldTime, float delta) { 42 | return config.y(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/assets/galacticraft-api/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamGalacticraft/GalacticraftAPI/6d3bfc9452ea14d7bc22ead73a647aad482d60dc/src/main/resources/assets/galacticraft-api/icon.png -------------------------------------------------------------------------------- /src/main/resources/assets/galacticraft-api/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "galaxy.galacticraft-api.milky_way.name": "Milky Way", 3 | "galaxy.galacticraft-api.milky_way.desc": "", 4 | "star.galacticraft-api.sol.name": "Sol", 5 | "star.galacticraft-api.sol.desc": "", 6 | "planet.galacticraft-api.earth.name": "Earth", 7 | "planet.galacticraft-api.earth.desc": "The Overworld", 8 | "ui.galacticraft-api.bodies.satellite": "Satellite", 9 | 10 | "ui.galacticraft-api.gases.hydrogen": "Hydrogen", 11 | "ui.galacticraft-api.gases.nitrogen": "Nitrogen", 12 | "ui.galacticraft-api.gases.oxygen": "Oxygen", 13 | "ui.galacticraft-api.gases.carbon_dioxide": "Carbon Dioxide", 14 | "ui.galacticraft-api.gases.water_vapor": "Water Vapor", 15 | "ui.galacticraft-api.gases.methane": "Methane", 16 | "ui.galacticraft-api.gases.helium": "Helium", 17 | "ui.galacticraft-api.gases.argon": "Argon", 18 | "ui.galacticraft-api.gases.neon": "Neon", 19 | "ui.galacticraft-api.gases.krypton": "Krypton", 20 | "ui.galacticraft-api.gases.nitrous_oxide": "Nitrous Oxide", 21 | "ui.galacticraft-api.gases.carbon_monoxide": "Carbon Monoxide", 22 | "ui.galacticraft-api.gases.xenon": "Xenon", 23 | "ui.galacticraft-api.gases.ozone": "Ozone", 24 | "ui.galacticraft-api.gases.nitrous_dioxide": "Nitrous Dioxide", 25 | "ui.galacticraft-api.gases.iodine": "Iodine", 26 | 27 | "command.galacticraft-api.debug.registry.dump": "Dumped: %s", 28 | "command.galacticraft-api.debug.registry.id": "%s - %s: %s" 29 | } -------------------------------------------------------------------------------- /src/main/resources/assets/galacticraft-api/textures/body_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamGalacticraft/GalacticraftAPI/6d3bfc9452ea14d7bc22ead73a647aad482d60dc/src/main/resources/assets/galacticraft-api/textures/body_icons.png -------------------------------------------------------------------------------- /src/main/resources/assets/galacticraft-api/textures/gui/player_inventory_switch_tabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamGalacticraft/GalacticraftAPI/6d3bfc9452ea14d7bc22ead73a647aad482d60dc/src/main/resources/assets/galacticraft-api/textures/gui/player_inventory_switch_tabs.png -------------------------------------------------------------------------------- /src/main/resources/assets/galacticraft-api/textures/satellite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamGalacticraft/GalacticraftAPI/6d3bfc9452ea14d7bc22ead73a647aad482d60dc/src/main/resources/assets/galacticraft-api/textures/satellite.png -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "galacticraft-api", 4 | "version": "$version", 5 | 6 | "name": "Galacticraft Addon API", 7 | "icon": "assets/galacticraft-api/icon.png", 8 | "description": "Addon API for the FabricMC port of Galacticraft.", 9 | "license": "MIT", 10 | "contact": { 11 | "homepage": "https://galacticraft.team", 12 | "sources": "https://github.com/TeamGalacticraft/GalacticraftAPI", 13 | "issues": "https://github.com/TeamGalacticraft/GalacticraftAPI/issues" 14 | }, 15 | "authors": [ 16 | { 17 | "name": "Team Galacticraft", 18 | "contact": { 19 | "homepage": "https://github.com/TeamGalacticraft", 20 | "discord": "https://discord.gg/n3QqhMYyFK" 21 | } 22 | } 23 | ], 24 | "environment": "*", 25 | "entrypoints": { 26 | "main": [ 27 | "dev.galacticraft.impl.internal.fabric.GalacticraftAPI" 28 | ], 29 | "client": [ 30 | "dev.galacticraft.impl.internal.client.fabric.GalacticraftAPIClient" 31 | ], 32 | "fabric-datagen": [ 33 | "dev.galacticraft.impl.internal.fabric.GalacticraftAPIData" 34 | ] 35 | }, 36 | "mixins": [ 37 | "galacticraft-api.mixins.json" 38 | ], 39 | "accessWidener": "galacticraft-api.accesswidener", 40 | "depends": { 41 | "fabricloader": ">=0.14", 42 | "minecraft": ">=1.20.1", 43 | "fabric-api-base": "*", 44 | "fabric-api-lookup-api-v1": "*", 45 | "fabric-command-api-v2": "*", 46 | "fabric-lifecycle-events-v1": "*", 47 | "fabric-networking-api-v1": "*", 48 | "fabric-registry-sync-v0": "*", 49 | "fabric-renderer-api-v1": "*", 50 | "fabric-resource-loader-v0": "*", 51 | "fabric-transfer-api-v1": "*" 52 | }, 53 | "suggests": { 54 | "modmenu": ">=4.0.0", 55 | "galacticraft": "*" 56 | }, 57 | "custom": { 58 | "loom:injected_interfaces": { 59 | "net/minecraft/class_742": ["dev/galacticraft/api/accessor/GearInventoryProvider"], 60 | "net/minecraft/class_1309": ["dev/galacticraft/api/accessor/GearInventoryProvider"], 61 | "net/minecraft/class_1937": ["dev/galacticraft/api/accessor/LevelOxygenAccessor"], 62 | "net/minecraft/class_3222": ["dev/galacticraft/api/accessor/GearInventoryProvider"] 63 | }, 64 | "modmenu": { 65 | "badges": [ "library" ], 66 | "parent": "galacticraft" 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/resources/galacticraft-api.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v1 named 2 | accessible class net/minecraft/core/registries/BuiltInRegistries$RegistryBootstrap 3 | accessible class net/minecraft/core/RegistrySynchronization$NetworkedRegistryData 4 | -------------------------------------------------------------------------------- /src/main/resources/galacticraft-api.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "dev.galacticraft.impl.internal.mixin", 4 | "compatibilityLevel": "JAVA_17", 5 | "mixins": [ 6 | "MinecraftServerMixin", 7 | "client.AbstractContainerScreenMixin", 8 | "gear.LivingEntityMixin", 9 | "gear.PlayerListMixin", 10 | "gear.ServerPlayerMixin", 11 | "gravity.EntityGravityMixin", 12 | "gravity.LivingEntityMixin", 13 | "oxygen.ChunkHolderMixin", 14 | "oxygen.ChunkSerializerMixin", 15 | "oxygen.EmptyLevelChunkMixin", 16 | "oxygen.ImposterProtoChunkMixin", 17 | "oxygen.LevelChunkMixin", 18 | "oxygen.LevelChunkSectionMixin", 19 | "oxygen.LevelMixin", 20 | "oxygen.ProtoChunkMixin", 21 | "registry.RegistryDataLoaderMixin", 22 | "registry.RegistrySyncronizationMixin", 23 | "research.AdvancementRewardsMixin", 24 | "research.ServerPlayerMixin" 25 | ], 26 | "client": [ 27 | "client.AbstractClientPlayerEntityMixin", 28 | "client.ClientPlayNetworkHandlerMixin", 29 | "client.MinecraftClientMixin", 30 | "client.ParticleAccessor", 31 | "client.ParticleManagerMixin", 32 | "client.SoundEngineMixin", 33 | "client.SoundManagerAccessor" 34 | ], 35 | "minVersion": "0.8.0", 36 | "injectors": { 37 | "defaultRequire": 1 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/resources/data/gc-api-test/advancements/custom/example_part.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "gc-api-test:custom/root", 3 | "display": { 4 | "icon": { 5 | "item": "minecraft:diamond_block" 6 | }, 7 | "title": { 8 | "translate": "gc-api-test.advancements.custom.diamond_block.title" 9 | }, 10 | "description": { 11 | "translate": "gc-api-test.advancements.custom.diamond_block.description" 12 | }, 13 | "frame": "challenge", 14 | "show_toast": true, 15 | "announce_to_chat": true, 16 | "hidden": false 17 | }, 18 | "rewards": { 19 | "rocket_parts": [ 20 | "gc-api-test:test" 21 | ] 22 | }, 23 | "criteria": { 24 | "diamond_block": { 25 | "trigger": "minecraft:inventory_changed", 26 | "conditions": { 27 | "items": [ 28 | { 29 | "item": "minecraft:diamond_block" 30 | } 31 | ] 32 | } 33 | } 34 | }, 35 | "requirements": [ 36 | [ 37 | "diamond_block" 38 | ] 39 | ] 40 | } -------------------------------------------------------------------------------- /src/test/resources/data/gc-api-test/advancements/custom/root.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecraft:gold_block" 5 | }, 6 | "title": { 7 | "translate": "gc-api-test.advancements.custom.root.title" 8 | }, 9 | "description": { 10 | "translate": "gc-api-test.advancements.custom.root.description" 11 | }, 12 | "frame": "task", 13 | "show_toast": false, 14 | "announce_to_chat": false, 15 | "hidden": false, 16 | "background": "minecraft:textures/block/iron_block.png" 17 | }, 18 | "criteria": { 19 | "gold_block": { 20 | "trigger": "minecraft:inventory_changed", 21 | "conditions": { 22 | "items": [ 23 | { 24 | "item": "minecraft:gold_block" 25 | } 26 | ] 27 | } 28 | } 29 | }, 30 | "requirements": [ 31 | [ 32 | "gold_block" 33 | ] 34 | ] 35 | } -------------------------------------------------------------------------------- /src/test/resources/data/gc-api-test/celestial_body/example_planet.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "access_weight": 0, 4 | "day_temperature": 21, 5 | "night_temperature": 15, 6 | "world": "minecraft:the_end", 7 | "teleporter": { 8 | "type": "galacticraft-api:direct", 9 | "config": {} 10 | }, 11 | "atmosphere": { 12 | "composition": { 13 | "galacticraft-api:nitrogen": 780840, 14 | "galacticraft-api:oxygen": 209500, 15 | "galacticraft-api:water_vapor": 25000, 16 | "galacticraft-api:argon": 9300, 17 | "galacticraft-api:carbon_dioxide": 399, 18 | "galacticraft-api:neon": 18, 19 | "galacticraft-api:helium": 5.42, 20 | "galacticraft-api:methane": 1.79, 21 | "galacticraft-api:krypton": 1.14, 22 | "galacticraft-api:hydrogen": 0.55, 23 | "galacticraft-api:nitrous_oxide": 0.325, 24 | "galacticraft-api:carbon_monoxide": 0.1, 25 | "galacticraft-api:xenon": 0.09, 26 | "galacticraft-api:ozone": 0.07, 27 | "galacticraft-api:nitrous_dioxide": 0.02, 28 | "galacticraft-api:iodine": 0.01 29 | }, 30 | "temperature": 15, 31 | "pressure": 1 32 | }, 33 | "gravity": 1, 34 | "parent": "gc-api-test:example_star", 35 | "position": { 36 | "config": { 37 | "orbit_time": 1536000, 38 | "distance": 1, 39 | "phase_shift": 0, 40 | "planet": true 41 | }, 42 | "type": "galacticraft-api:orbital" 43 | }, 44 | "display": { 45 | "config": { 46 | "width": 16, 47 | "height": 16, 48 | "scale": 1, 49 | "texture": "galacticraft-api:textures/body_icons.png", 50 | "u": 0, 51 | "v": 16 52 | }, 53 | "type": "galacticraft-api:icon" 54 | }, 55 | "name": "planet.gc-api-test.the_end.name", 56 | "description": "planet.gc-api-test.the_end.description", 57 | "galaxy": "gc-api-test:galaxy" 58 | }, 59 | "type": "galacticraft-api:planet" 60 | } 61 | -------------------------------------------------------------------------------- /src/test/resources/data/gc-api-test/celestial_body/example_star.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "gravity": 28, 4 | "luminance": 1, 5 | "surface_temperature": 5772, 6 | "display": { 7 | "config": { 8 | "width": 16, 9 | "height": 16, 10 | "scale": 1.5, 11 | "texture": "galacticraft-api:textures/body_icons.png", 12 | "u": 0, 13 | "v": 0 14 | }, 15 | "type": "galacticraft-api:icon" 16 | }, 17 | "photospheric_composition": { 18 | "composition": { 19 | "galacticraft-api:hydrogen": 734600, 20 | "galacticraft-api:helium": 248500, 21 | "galacticraft-api:oxygen": 7700, 22 | "galacticraft-api:neon": 1200, 23 | "galacticraft-api:nitrogen": 900 24 | }, 25 | "temperature": 15, 26 | "pressure": 28 27 | }, 28 | "name": "star.gc-api-test.star.name", 29 | "description": "star.gc-api-test.star.description", 30 | "galaxy": "gc-api-test:example_galaxy", 31 | "position": { 32 | "config": { 33 | "x": 0, 34 | "y": 0 35 | }, 36 | "type": "galacticraft-api:static" 37 | } 38 | }, 39 | "type": "galacticraft-api:star" 40 | } 41 | -------------------------------------------------------------------------------- /src/test/resources/data/gc-api-test/galaxy/example_galaxy.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "galaxy.gc-api-test.galaxy.name", 3 | "description": "galaxy.gc-api-test.galaxy.description", 4 | "position": { 5 | "config": { 6 | "x": 0, 7 | "y": 0 8 | }, 9 | "type": "galacticraft-api:static" 10 | }, 11 | "display": { 12 | "config": {}, 13 | "type": "galacticraft-api:empty" 14 | } 15 | } -------------------------------------------------------------------------------- /src/test/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "gc-api-test", 4 | "version": "0.1.0", 5 | 6 | "name": "Galacticraft API Test Mod", 7 | "description": "Test mod for the Addon API for the FabricMC port of Galacticraft.", 8 | "license": "MIT", 9 | "contact": { 10 | "homepage": "https://galacticraft.team/", 11 | "sources": "https://github.com/TeamGalacticraft/Addon-API/", 12 | "issues": "https://github.com/TeamGalacticraft/Addon-API/issues/" 13 | }, 14 | "authors": [ 15 | { 16 | "name": "Team Galacticraft", 17 | "contact": { 18 | "homepage": "https://github.com/TeamGalacticraft/", 19 | "discord": "https://discord.gg/n3QqhMYyFK" 20 | } 21 | } 22 | ], 23 | "environment": "*", 24 | "entrypoints": { 25 | "fabric-gametest": [ "dev.galacticraft.api.gametest.GalacticraftApiTestSuite" ] 26 | }, 27 | "depends": { 28 | "galacticraft-api": "*" 29 | } 30 | } 31 | --------------------------------------------------------------------------------