diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0fc4431 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +* text=auto eol=lf +*.bat text eol=crlf +*.png binary +*.ogg binary +*.jar binary +*.zip binary diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9265834..713bbe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,96 +1,105 @@ -name: Steam Advantage 1.12 CI +name: Steam Advantage 1.13 CI on: push: - branches: - - master-1.12.2 - - 'feature/**' + branches: [master-1.13.2, 'feature/**'] pull_request: - branches: - - master-1.12.2 + branches: [master-1.13.2] permissions: contents: read concurrency: - group: steamadvantage-1.12-${{ github.workflow }}-${{ github.ref }} + group: steamadvantage-1.13-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: name: Build, test, and audit runs-on: ubuntu-latest - timeout-minutes: 75 - + timeout-minutes: 105 steps: - name: Check out SteamAdvantage uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - - - name: Check out pinned PowerAdvantage + - name: Check out pinned OreSpawn + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + repository: MinecraftModDevelopmentMods/OreSpawn + ref: 6a7c2bb07b9a7771128812fcc07d185f7d9df58b + path: .ci-dependencies/OreSpawn + - name: Use canonical LF dependency inputs + # Base Metals predates archive text normalization; its LF artifact is separately pinned. + run: git config --global core.autocrlf false + - name: Check out pinned Base Metals + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + repository: MinecraftModDevelopmentMods/BaseMetals + ref: 1376a20d7d5ba22d3abc77dc34b49a2c88943697 + path: .ci-dependencies/BaseMetals + - name: Check out PowerAdvantage 1.13.2 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: repository: MinecraftModDevelopmentMods/PowerAdvantage - ref: 40811a0be37174a0633998eb3d820d95755d35e8 + ref: 6a845ad68eb1e34dcdd793dceb9cb528be22cedf path: .ci-dependencies/PowerAdvantage - - name: Install Java 8 toolchain uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 with: distribution: temurin java-version: '8.0.502+7' - - name: Install Java 17 for Gradle uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 with: distribution: microsoft java-version: '17' - - name: Set up Gradle uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6 - - - name: Build pinned PowerAdvantage development jar - id: poweradvantage + - name: Build 1.13.2 dependency chain + id: dependencies shell: bash run: | set -euo pipefail - dependency="$GITHUB_WORKSPACE/.ci-dependencies/PowerAdvantage" - mirror="$RUNNER_TEMP/reborncore-mirror" - chmod +x "$dependency/gradlew" - ( - cd "$dependency" - bash gradle/stage-reborncore-release.sh "$mirror" - ./gradlew deobfJar verifyReleaseDependencies \ - -PrebornCoreVerificationRepository="$mirror" --no-daemon --stacktrace - ) - jar="$dependency/build/libs-dev/PowerAdvantage-2.4.1.112021-deobf.jar" - test -f "$jar" - echo "jar=$jar" >> "$GITHUB_OUTPUT" - + orespawn="$GITHUB_WORKSPACE/.ci-dependencies/OreSpawn" + basemetals="$GITHUB_WORKSPACE/.ci-dependencies/BaseMetals" + power="$GITHUB_WORKSPACE/.ci-dependencies/PowerAdvantage" + chmod +x "$orespawn/gradlew" "$basemetals/gradlew" "$power/gradlew" + (cd "$orespawn" && ./gradlew jar --no-daemon --stacktrace) + (cd "$basemetals" && ./gradlew jar --no-daemon --stacktrace) + osjar="$orespawn/build/libs-dev/OreSpawn-4.1.0.113021-deobf.jar" + bmjar="$basemetals/build/libs-dev/BaseMetals-3.0.1.113021-deobf.jar" + (cd "$power" && ./gradlew jar verifyReleaseDependencies -PbaseMetalsDeobfJar="$bmjar" -PoreSpawnDeobfJar="$osjar" --no-daemon --stacktrace) + powerjar="$power/build/libs-dev/PowerAdvantage-2.4.4.113021-deobf.jar" + test -f "$osjar" && test -f "$bmjar" && test -f "$powerjar" + echo "orespawn=$osjar" >> "$GITHUB_OUTPUT" + echo "basemetals=$bmjar" >> "$GITHUB_OUTPUT" + echo "power=$powerjar" >> "$GITHUB_OUTPUT" + echo "power_ref=$(git -C "$power" rev-parse HEAD)" >> "$GITHUB_OUTPUT" - name: Build and audit release artifacts run: >- ./gradlew clean check build javadoc verifyReleaseDependencies verifyReleaseArtifacts writeReleaseChecksums verifyEclipseProductionClasspath - -PpowerAdvantageDeobfJar=${{ steps.poweradvantage.outputs.jar }} + -PpowerAdvantageDeobfJar=${{ steps.dependencies.outputs.power }} + -Ppoweradvantage_source_ref=${{ steps.dependencies.outputs.power_ref }} + -PbaseMetalsDeobfJar=${{ steps.dependencies.outputs.basemetals }} + -PoreSpawnDeobfJar=${{ steps.dependencies.outputs.orespawn }} --no-daemon --stacktrace - - name: Upload audited release candidate uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: SteamAdvantage-1.12.2-${{ github.sha }} + name: SteamAdvantage-1.13.2-${{ github.sha }} if-no-files-found: error retention-days: 30 path: | - build/libs/SteamAdvantage-2.2.1.112021.jar - build/libs/SteamAdvantage-2.2.1.112021-sources.jar - build/libs/SteamAdvantage-2.2.1.112021-javadoc.jar + build/libs/SteamAdvantage-2.2.5.113021.jar + build/libs/SteamAdvantage-2.2.5.113021-sources.jar + build/libs/SteamAdvantage-2.2.5.113021-javadoc.jar build/release/SHA256SUMS CHANGELOG.txt - - name: Upload diagnostics on failure if: failure() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: SteamAdvantage-1.12.2-diagnostics-${{ github.sha }} + name: SteamAdvantage-1.13.2-diagnostics-${{ github.sha }} if-no-files-found: ignore retention-days: 14 path: | @@ -99,3 +108,4 @@ jobs: build/*-run/logs/** build/problems/** .ci-dependencies/PowerAdvantage/build/reports/** + .ci-dependencies/PowerAdvantage/build/libs-dev/*.jar diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4de73be..9d4462c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,12 +2,9 @@ name: CodeQL on: push: - branches: - - master-1.12.2 - - 'feature/**' + branches: [master-1.13.2, 'feature/**'] pull_request: - branches: - - master-1.12.2 + branches: [master-1.13.2] schedule: - cron: '53 7 * * 4' @@ -20,62 +17,74 @@ jobs: analyze: name: Analyze Java runs-on: ubuntu-latest - timeout-minutes: 60 - + timeout-minutes: 90 steps: - name: Check out SteamAdvantage uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - - - name: Check out pinned PowerAdvantage + - name: Check out pinned OreSpawn + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + repository: MinecraftModDevelopmentMods/OreSpawn + ref: 6a7c2bb07b9a7771128812fcc07d185f7d9df58b + path: .ci-dependencies/OreSpawn + - name: Use canonical LF dependency inputs + # Base Metals predates archive text normalization; its LF artifact is separately pinned. + run: git config --global core.autocrlf false + - name: Check out pinned Base Metals + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + repository: MinecraftModDevelopmentMods/BaseMetals + ref: 1376a20d7d5ba22d3abc77dc34b49a2c88943697 + path: .ci-dependencies/BaseMetals + - name: Check out PowerAdvantage 1.13.2 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: repository: MinecraftModDevelopmentMods/PowerAdvantage - ref: 40811a0be37174a0633998eb3d820d95755d35e8 + ref: 6a845ad68eb1e34dcdd793dceb9cb528be22cedf path: .ci-dependencies/PowerAdvantage - - name: Install Java 8 toolchain uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 with: distribution: temurin java-version: '8.0.502+7' - - name: Install Java 17 for Gradle uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 with: distribution: microsoft java-version: '17' - - name: Set up Gradle uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6 - - - name: Build pinned PowerAdvantage development jar - id: poweradvantage + - name: Build 1.13.2 dependency chain + id: dependencies shell: bash run: | set -euo pipefail - dependency="$GITHUB_WORKSPACE/.ci-dependencies/PowerAdvantage" - mirror="$RUNNER_TEMP/reborncore-mirror" - chmod +x "$dependency/gradlew" - ( - cd "$dependency" - bash gradle/stage-reborncore-release.sh "$mirror" - ./gradlew deobfJar verifyReleaseDependencies \ - -PrebornCoreVerificationRepository="$mirror" --no-daemon --stacktrace - ) - jar="$dependency/build/libs-dev/PowerAdvantage-2.4.1.112021-deobf.jar" - test -f "$jar" - echo "jar=$jar" >> "$GITHUB_OUTPUT" - + orespawn="$GITHUB_WORKSPACE/.ci-dependencies/OreSpawn" + basemetals="$GITHUB_WORKSPACE/.ci-dependencies/BaseMetals" + power="$GITHUB_WORKSPACE/.ci-dependencies/PowerAdvantage" + chmod +x "$orespawn/gradlew" "$basemetals/gradlew" "$power/gradlew" + (cd "$orespawn" && ./gradlew jar --no-daemon --stacktrace) + (cd "$basemetals" && ./gradlew jar --no-daemon --stacktrace) + osjar="$orespawn/build/libs-dev/OreSpawn-4.1.0.113021-deobf.jar" + bmjar="$basemetals/build/libs-dev/BaseMetals-3.0.1.113021-deobf.jar" + (cd "$power" && ./gradlew jar verifyReleaseDependencies -PbaseMetalsDeobfJar="$bmjar" -PoreSpawnDeobfJar="$osjar" --no-daemon --stacktrace) + powerjar="$power/build/libs-dev/PowerAdvantage-2.4.4.113021-deobf.jar" + test -f "$osjar" && test -f "$bmjar" && test -f "$powerjar" + echo "orespawn=$osjar" >> "$GITHUB_OUTPUT" + echo "basemetals=$bmjar" >> "$GITHUB_OUTPUT" + echo "power=$powerjar" >> "$GITHUB_OUTPUT" + echo "power_ref=$(git -C "$power" rev-parse HEAD)" >> "$GITHUB_OUTPUT" - name: Initialize CodeQL uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4 with: languages: java-kotlin - - name: Compile SteamAdvantage production code run: | chmod +x ./gradlew ./gradlew clean classes --rerun-tasks --no-build-cache --no-daemon --stacktrace \ - -PpowerAdvantageDeobfJar=${{ steps.poweradvantage.outputs.jar }} - + -PpowerAdvantageDeobfJar=${{ steps.dependencies.outputs.power }} \ + -Ppoweradvantage_source_ref=${{ steps.dependencies.outputs.power_ref }} \ + -PbaseMetalsDeobfJar=${{ steps.dependencies.outputs.basemetals }} \ + -PoreSpawnDeobfJar=${{ steps.dependencies.outputs.orespawn }} - name: Analyze uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4 diff --git a/.github/workflows/validate-gradle-build.yml b/.github/workflows/validate-gradle-build.yml index 8959c1a..d4d55ba 100644 --- a/.github/workflows/validate-gradle-build.yml +++ b/.github/workflows/validate-gradle-build.yml @@ -3,11 +3,11 @@ name: Validate Gradle Wrapper on: push: branches: - - master-1.12.2 + - master-1.13.2 - 'feature/**' pull_request: branches: - - master-1.12.2 + - master-1.13.2 permissions: contents: read diff --git a/.gitignore b/.gitignore index 4502811..cb99cf1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,9 @@ /run/ /run-data/ /run.* +/$run/ +/eula.txt +/server.properties /*.log /classes/ /logs/ @@ -62,6 +65,25 @@ /replay_pid*.log /secret.json +# Nested local tooling and generated output +AGENTS.md +AGENT.md +CLAUDE.md +GEMINI.md +ARCHITECT.md +agent-notes/ +.codex/ +.agent/ +.agents/ +.claude/ +.gemini/ +.cursor/ +agent-*.md +codex-*.md +*.log +*.class +__pycache__/ +*.pyc /.DS_Store /README.txt /forge-*-changelog.txt diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ee7ce40..237ce55 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,31 @@ +Steam Advantage 2.2.5.113021 + +- Keep development archives identical in existing workspaces and fresh CI checkouts. +- Separate different steam equipment into distinct recipe-book cells while keeping same-output alternatives together. +- Restore legacy steam-parts chest loot through Power Advantage's native fallback when Additional Loot Tables is absent. +- Recheck all steam equipment acquisition and discovery paths in every recipe mode, including the electric boiler's wire ingredient. +- Add ingredient-triggered recipe-book discoveries for every crafting variant, without exposing crushing recipes or bypassing recipe modes. +- Prevent Eclipse builds from replacing processed mod metadata with unresolved source templates. +- Fix literal 1.13 blockstate model paths and replace removed normal selectors, preserving every orientation and registry identity. +- Add modern language aliases alongside legacy GUI keys and audit native client resources in the combined Advantage launch. +- Point generated Eclipse mod discovery at bin/main and audit it, preventing launches that omit Steam Advantage. +- Make tile-type registration generic inference explicit for Eclipse's compiler. +- Fix drill output into empty vanilla rear inventories and mark both inventories dirty after transfer. +- Preserve unfinished drill progress across chunk reloads and full restarts; reset it when a saved target state has changed. +- Keep legacy progress and target-coordinate NBT readable, with optional target-state snapshots for new saves. + +- Migrate minecraft-prefixed dotted tile IDs from pre-modernization 1.12 saves without resetting machine contents, pressure, progress, or temperature. + +- Port Steam Advantage to Minecraft 1.13.2, Forge 25.0.223, and the zone.moddev.mc implementation namespace. +- Register legacy block-state, tile, item, and NBT migrations with Power Advantage for direct 1.10 and 1.12 upgrades. +- Preserve drill facing, energy, inventory, movement, output, and helper-bit state through migration and full restart. +- Restore pump fluid from Tank with TankOut fallback and geothermal temperature from Temperature with Tempoerature fallback. +- Register all musket enchantments on the Forge mod registry bus. +- Restore vanilla-style crusher comparator levels from 0 through 15. +- Accept Power and Mineralogy crude-oil aliases in the oil boiler without changing configured fuel overrides. +- Guard tagged recipes so reduced mod sets cannot drop required material ingredients. +- Add reproducible 1.13 release artifacts, dependency audits, Eclipse metadata, and Advantage Works coverage. + Steam Advantage 2.2.1.112021 - Move the Minecraft 1.12.2 build to ForgeGradle 7 and Gradle 9.6.1. diff --git a/README.md b/README.md index 2550acd..1d6190c 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,31 @@ # SteamAdvantage -Steam Advantage adds steam-powered machines and infrastructure to Power Advantage for Minecraft 1.12.2. +Steam Advantage adds steam-powered machines and infrastructure to Power Advantage for Minecraft 1.13.2. -## Building Minecraft 1.12.2 +Every crafting variant has an ingredient-triggered recipe-book discovery. See the [shared material checklist and discovery tests](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/docs/1.13/RECIPE-DISCOVERY.md). Regenerate unlock JSON after recipe changes with `node tools/generate-recipe-unlocks.js`; `check` audits recipe coverage and criteria. Crushing recipes are deliberately excluded from the crafting book. -The `master-1.12.2` build uses ForgeGradle 7.0.34 and Gradle 9.6.1. Run Gradle with Java 17; Gradle resolves the Java 8 toolchain used for compilation. +The [manufacturing progression audit](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/docs/1.13/MANUFACTURING-PROGRESSION.md) checks raw-material, processing and loot acquisition paths in every mode, including restart persistence. -First build the pinned sibling PowerAdvantage development jar: +## Building Minecraft 1.13.2 + +The `master-1.13.2` build uses ForgeGradle 7.0.34 and Gradle 9.6.1. Run Gradle with Java 17; production code is compiled for Java 8. + +Build the pinned PowerAdvantage, Base Metals, and OreSpawn deobf jars first. +Exact source commits and checksums are recorded in `gradle.properties`; CI builds the same commits. +With the standard sibling layout: ```text cd ..\..\PowerAdvantage gradlew.bat deobfJar ``` -Then build and audit SteamAdvantage: +Then build SteamAdvantage: ```text -gradlew.bat clean check build javadoc verifyReleaseDependencies verifyReleaseArtifacts writeReleaseChecksums +gradlew.bat clean check build javadoc verifyReleaseDependencies verifyReleaseArtifacts writeReleaseChecksums verifyEclipseProductionClasspath ``` -Release jars are written to `build/libs`. The deobfuscated development jar is written to `build/libs-dev` by `deobfJar` or `build`. +Alternative layouts may pass `-PpowerAdvantageDeobfJar=`, `-PbaseMetalsDeobfJar=`, and `-PoreSpawnDeobfJar=`. None of those dependencies is embedded. For Eclipse, import this repository as an existing Gradle project and run: @@ -27,4 +33,14 @@ For Eclipse, import this repository as an existing Gradle project and run: gradlew.bat cleanEclipse verifyEclipseProductionClasspath ``` -Power Advantage is required at compile time and runtime but is never bundled. Base Metals remains a required distribution dependency while its integrations stay reflection-based and absent from the compile classpath. +Refresh the project in Eclipse, allow its Java build to finish, and launch the generated `runClient.launch`. Eclipse launches discover SteamAdvantage from `bin/main`; command-line Gradle launches use `build/forge-run-mod-classes/main`. The Eclipse audit checks that discovery points at the same production output Eclipse compiles into. + +The Eclipse resource root is `build/resources/main`, so its builder copies expanded mod metadata rather than raw source templates. Refresh the Gradle project and clean/rebuild after this setup changes. After resource/version edits, run `processResources` or refresh Gradle before launching; do not put `src/main/resources` back on the Eclipse Java build path. + +## Compatibility + +For an all-Advantage play-test, run `prepareCombinedEclipseLaunch` in the sibling PowerAdvantage checkout and select its `runClientAllAdvantage.launch`. The [native resource probe](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/test-rig/client-resources/README.md) checks models, textures and names across all three mods. These resource checks do not replace gameplay testing. + +The implementation namespace is `zone.moddev.mc.steamadvantage`. Runtime identities, registries, tile IDs, saved NBT, recipes, and assets remain stable. Steam registers its legacy state and NBT codecs with PowerAdvantage's shared migration hook so 1.10 and 1.12 worlds can be converted before Minecraft flattens old numeric block states. + +Read PowerAdvantage's [1.13 migration guide](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/docs/1.13/MIGRATION.md) before upgrading, and always use a backup. The [qualification notes](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/docs/1.13/CURRENT-QUALIFICATION.md) list the tested scenarios and remaining gaps. diff --git a/build.gradle b/build.gradle index ec616e3..8e78218 100644 --- a/build.gradle +++ b/build.gradle @@ -43,7 +43,10 @@ ext.display_version = project.mod_version ext.release_tag = project.mod_version java { - toolchain.languageVersion = JavaLanguageVersion.of(8) + toolchain { + languageVersion = JavaLanguageVersion.of(8) + vendor = JvmVendorSpec.ADOPTIUM + } withSourcesJar() withJavadocJar() } @@ -51,6 +54,7 @@ java { tasks.withType(JavaCompile).configureEach { javaCompiler = javaToolchains.compilerFor { languageVersion = JavaLanguageVersion.of(8) + vendor = JvmVendorSpec.ADOPTIUM } sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -66,13 +70,14 @@ tasks.withType(Javadoc).configureEach { } tasks.withType(AbstractArchiveTask).configureEach { + includeEmptyDirs = false preserveFileTimestamps = false reproducibleFileOrder = true } def archiveTextSuffixes = [ '.cfg', '.css', '.html', '.info', '.java', '.js', '.json', '.lang', - '.mcmeta', '.md', '.properties', '.txt', '.xml' + '.mcmeta', '.md', '.properties', '.toml', '.txt', '.xml' ] def archiveTextPatterns = archiveTextSuffixes.collect { "**/*${it}".toString() } archiveTextPatterns.addAll(['**/element-list', '**/package-list']) @@ -86,42 +91,53 @@ minecraft { mappings channel: project.mapping_channel, version: project.mapping_version String configuredRunDirectory = providers.gradleProperty('steamAdvantageRunDirectory') .getOrElse('run') + def forgeRunModClassesDirectory = layout.buildDirectory.dir('forge-run-mod-classes/main') + def forgeMainOutputPath = forgeRunModClassesDirectory.get().asFile.absolutePath + def mainModClasses = "${mod_id}%%${forgeMainOutputPath}${File.pathSeparator}${mod_id}%%${forgeMainOutputPath}" + def forge25RunTargets = [client: 'fmluserdevclient', server: 'fmluserdevserver', data: 'fmluserdevdata'] runs { configureEach { + mainClass = 'net.minecraftforge.userdev.LaunchTesting' workingDir.convention layout.projectDirectory.dir(configuredRunDirectory) - systemProperty 'forge.logging.console.level', 'debug' + systemProperty 'forge.logging.markers', 'REGISTRIES' + systemProperty 'forge.logging.console.level', 'info' + mods { steamadvantage { source sourceSets.main } } + environment 'target', forge25RunTargets[name] + environment 'MCP_MAPPINGS', "${mapping_channel}_${mapping_version}" + environment 'MCP_VERSION', mcp_version + environment 'FORGE_VERSION', forge_version + environment 'FORGE_GROUP', 'net.minecraftforge' + environment 'MC_VERSION', minecraft_version + environment 'MOD_CLASSES', mainModClasses } register('client') register('server') { args '--nogui' } + register('data') { + workingDir.convention layout.projectDirectory.dir('run-data') + args '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/'), + '--existing', file('src/main/resources/') + } } } -// Forge 1.12 expects each development mod to expose classes and resources from -// one classpath root. ForgeGradle 7 splits those outputs, so merge only the -// launch output without contaminating the canonical source-set directories. -def forge12DevelopmentOutput = layout.buildDirectory.dir('forge12-development/main') -def syncForge12DevelopmentResources = tasks.register('syncForge12DevelopmentResources', Sync) { +sourceSets.main.resources { + srcDir 'src/generated/resources' + exclude '.cache/**' +} + +def forgeRunModClassesDirectory = layout.buildDirectory.dir('forge-run-mod-classes/main') +def prepareForgeRunModClasses = tasks.register('prepareForgeRunModClasses', Sync) { group = 'ide' - description = 'Merges classes and processed resources for Forge 1.12 Gradle launches.' + description = 'Merges classes and processed resources for Forge 1.13 launches.' dependsOn tasks.named('classes') - from tasks.named('compileJava', JavaCompile).flatMap { it.destinationDirectory } - from sourceSets.main.output.resourcesDir - into forge12DevelopmentOutput -} -tasks.configureEach { - if (name == 'runClient' || name == 'runServer') { - dependsOn syncForge12DevelopmentResources - doFirst { - Set splitMainOutputs = [ - tasks.named('compileJava', JavaCompile).get().destinationDirectory.get().asFile, - sourceSets.main.output.resourcesDir - ] as Set - classpath = files(forge12DevelopmentOutput, classpath.filter { - !splitMainOutputs.contains(it) - }) - } + from sourceSets.main.output + into forgeRunModClassesDirectory +} +tasks.withType(JavaExec).configureEach { + if (name in ['runClient', 'runServer', 'runData']) { + dependsOn prepareForgeRunModClasses } } @@ -159,24 +175,51 @@ if (!powerAdvantageDeobfJar.isFile()) { + "Run gradlew.bat deobfJar in ../../PowerAdvantage first, or pass " + "-PpowerAdvantageDeobfJar=.") } +// These defaults follow the sibling MMD checkout layout. They are constants +// here so another developer can override them without editing the script. +def baseMetalsDeobfJar = file(providers.gradleProperty('baseMetalsDeobfJar') + .getOrElse('../../../../BaseMetals/BaseMetals 113/BaseMetals/build/libs-dev/' + + 'BaseMetals-3.0.1.113021-deobf.jar')) +if (!baseMetalsDeobfJar.isFile()) { + throw new GradleException("Missing Base Metals deobf jar at ${baseMetalsDeobfJar}. " + + "Build Base Metals 1.13 first, or pass -PbaseMetalsDeobfJar=.") +} +def oreSpawnDeobfJar = file(providers.gradleProperty('oreSpawnDeobfJar') + .getOrElse('../../../../MinecraftMineralogy/OS113/OreSpawn/build/libs-dev/' + + 'OreSpawn-4.1.0.113021-deobf.jar')) +if (!oreSpawnDeobfJar.isFile()) { + throw new GradleException("Missing OreSpawn deobf jar at ${oreSpawnDeobfJar}. " + + "Build OreSpawn 1.13 first, or pass -PoreSpawnDeobfJar=.") +} dependencies { implementation minecraft.dependency( "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}") - // Mavenizer's legacy metadata omits this compile-time Minecraft library. - compileOnly 'org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209' - // PowerAdvantage is required at runtime but remains a separate mod jar. compileOnly files(powerAdvantageDeobfJar) runtimeOnly files(powerAdvantageDeobfJar) + compileOnly files(baseMetalsDeobfJar) + runtimeOnly files(baseMetalsDeobfJar) + // Required transitively by the coordinated PowerAdvantage/Base Metals development runtime. + compileOnly files(oreSpawnDeobfJar) + runtimeOnly files(oreSpawnDeobfJar) + testImplementation 'junit:junit:4.13.2' + testImplementation files(powerAdvantageDeobfJar, baseMetalsDeobfJar, oreSpawnDeobfJar) } tasks.named('processResources', ProcessResources) { filteringCharset = 'UTF-8' - inputs.property('version', project.version) - inputs.property('mcversion', project.minecraft_version) - filesMatching('mcmod.info') { - expand version: project.version, mcversion: project.minecraft_version + inputs.properties([ + version: project.version, + minecraft_version_range: project.minecraft_version_range, + forge_version_range: project.forge_version_range, + loader_version_range: project.loader_version_range + ]) + filesMatching('META-INF/mods.toml') { + expand version: project.version, + minecraft_version_range: project.minecraft_version_range, + forge_version_range: project.forge_version_range, + loader_version_range: project.loader_version_range } filesMatching(archiveTextPatterns, normalizeArchiveLineEndings) } @@ -298,13 +341,13 @@ tasks.register('verifyReleaseConfiguration') { group = 'verification' description = 'Validates release identity, target metadata, and dependency policy.' doLast { - if (project.mod_version != '2.2.1.112021') { + if (project.mod_version != '2.2.5.113021') { throw new GradleException("Unexpected SteamAdvantage release version: ${project.mod_version}") } - if (project.minecraft_version != '1.12.2' - || project.forge_version != '14.23.5.2859' - || project.mapping_channel != 'stable' - || project.mapping_version != '39-1.12') { + if (project.minecraft_version != '1.13.2' + || project.forge_version != '25.0.223' + || project.mapping_channel != 'snapshot' + || project.mapping_version != '20180921-1.13') { throw new GradleException('Unexpected Minecraft, Forge, or mappings target') } if (project.loader_name != 'forge' || project.loader_code != '1' @@ -314,7 +357,7 @@ tasks.register('verifyReleaseConfiguration') { throw new GradleException('Unexpected release dispatcher target metadata') } if (project.mod_id != 'steamadvantage' - || project.group.toString() != 'com.mcmoddev.steamadvantage' + || project.group.toString() != 'zone.moddev.mc.steamadvantage' || base.archivesName.get() != 'SteamAdvantage' || project.mod_license != 'GPL-3.0-only' || project.curseforge_project_id != '240984') { @@ -322,33 +365,30 @@ tasks.register('verifyReleaseConfiguration') { } if (project.cf_requirements != 'power-advantage,base-metals' || project.cf_optionals != '' - || project.cf_versions != '1.12.2') { + || project.cf_versions != '1.13.2') { throw new GradleException('Unexpected CurseForge dependency or game-version metadata') } - if (project.poweradvantage_version != '2.4.1.112021' + if (project.poweradvantage_version != '2.4.4.113021' || project.poweradvantage_source_repository != 'MinecraftModDevelopmentMods/PowerAdvantage' - || project.poweradvantage_source_ref != '40811a0be37174a0633998eb3d820d95755d35e8' - || project.poweradvantage_deobf_sha256 != 'DE7759033A094718E1341CC82B9912425A24A035DBD7F91D590D8B921F08DEB2') { + || !(project.poweradvantage_source_ref ==~ /[a-f0-9]{40}/) + || !(project.poweradvantage_deobf_sha256 ==~ /[A-F0-9]{64}/)) { throw new GradleException('Unexpected PowerAdvantage compile dependency identity') } - ['.github/workflows/ci.yml', '.github/workflows/codeql-analysis.yml'].each { workflowPath -> - String workflow = file(workflowPath).getText('UTF-8') - if (!workflow.contains('repository: ' + project.poweradvantage_source_repository) - || !workflow.contains('ref: ' + project.poweradvantage_source_ref)) { - throw new GradleException("${workflowPath} does not build the pinned PowerAdvantage source") - } - } String mainSource = file( - 'src/main/java/com/mcmoddev/steamadvantage/SteamAdvantage.java').getText('UTF-8') + 'src/main/java/zone/moddev/mc/steamadvantage/SteamAdvantage.java').getText('UTF-8') if (!mainSource.contains('MODID = "steamadvantage"') - || !mainSource.contains('VERSION = "2.2.1.112021"') - || !mainSource.contains('dependencies = "required-after:poweradvantage;after:basemetals"')) { - throw new GradleException('SteamAdvantage source identity or dependency policy changed') + || !mainSource.contains('VERSION = "2.2.5.113021"')) { + throw new GradleException('SteamAdvantage source identity changed') + } + String metadata = file('src/main/resources/META-INF/mods.toml').getText('UTF-8').replace('\r\n', '\n') + ['modId="steamadvantage"', 'modId="poweradvantage"', 'modId="basemetals"', + 'versionRange="[2.4.4.113021,3.0.0)"'].each { marker -> + if (!metadata.contains(marker)) { + throw new GradleException("Source mods.toml is missing ${marker}") + } } - def metadata = new JsonSlurper().parse(file('src/main/resources/mcmod.info')) - def mod = metadata instanceof List ? metadata.first() : metadata - if (mod.modid != 'steamadvantage') { - throw new GradleException('Source mcmod.info does not use the stable steamadvantage mod id') + if (!metadata.contains('modId="basemetals"\nmandatory=false')) { + throw new GradleException('Base Metals must remain Forge-optional; CurseForge installs it for players') } } } @@ -367,8 +407,9 @@ tasks.register('verifyReleaseDependencies') { new ZipFile(powerAdvantageDeobfJar).withCloseable { zip -> ['cyano/poweradvantage/api/PoweredEntity.class', 'cyano/poweradvantage/api/GUIBlock.class', - 'com/mcmoddev/poweradvantage/conduitnetwork/ConduitRegistry.class', - 'com/mcmoddev/poweradvantage/init/Fluids.class'].each { required -> + 'cyano/poweradvantage/api/FluidCategoryRegistry.class', + 'zone/moddev/mc/poweradvantage/conduitnetwork/ConduitRegistry.class', + 'zone/moddev/mc/poweradvantage/init/Fluids.class'].each { required -> if (zip.getEntry(required) == null) { throw new GradleException("PowerAdvantage dependency is missing ${required}") } @@ -378,6 +419,19 @@ tasks.register('verifyReleaseDependencies') { throw new GradleException('PowerAdvantage dependency manifest has the wrong version') } } + String actualBaseMetalsHash = MessageDigest.getInstance('SHA-256') + .digest(baseMetalsDeobfJar.bytes).encodeHex().toString().toUpperCase() + if (!(actualBaseMetalsHash in [project.basemetals_deobf_sha256, + project.basemetals_deobf_lf_sha256])) { + throw new GradleException("Base Metals SHA-256 is ${actualBaseMetalsHash}, expected " + + project.basemetals_deobf_sha256) + } + String actualOreSpawnHash = MessageDigest.getInstance('SHA-256') + .digest(oreSpawnDeobfJar.bytes).encodeHex().toString().toUpperCase() + if (actualOreSpawnHash != project.orespawn_deobf_sha256) { + throw new GradleException("OreSpawn SHA-256 is ${actualOreSpawnHash}, expected " + + project.orespawn_deobf_sha256) + } Set compileFiles = configurations.compileClasspath.files.collect { it.canonicalFile } as Set if (!compileFiles.contains(powerAdvantageDeobfJar.canonicalFile)) { @@ -387,10 +441,15 @@ tasks.register('verifyReleaseDependencies') { if (!runtimeFiles.contains(powerAdvantageDeobfJar.canonicalFile)) { throw new GradleException('PowerAdvantage is missing from runtimeClasspath') } + if (!runtimeFiles.contains(baseMetalsDeobfJar.canonicalFile)) { + throw new GradleException('Base Metals is missing from runtimeClasspath') + } + if (!runtimeFiles.contains(oreSpawnDeobfJar.canonicalFile)) { + throw new GradleException('OreSpawn is missing from runtimeClasspath') + } List forbiddenRuntimeMods = runtimeFiles.collect { it.name.toLowerCase(Locale.ROOT) } .findAll { name -> - name.contains('basemetals') || name.contains('orespawn') - || name.contains('rf-api') || name.contains('reborncore') + name.contains('rf-api') || name.contains('reborncore') } if (!forbiddenRuntimeMods.isEmpty()) { throw new GradleException( @@ -437,31 +496,32 @@ tasks.register('verifyReleaseArtifacts') { File mainJar = new File(libs, expectedReleaseFiles.get()[0]) new ZipFile(mainJar).withCloseable { zip -> List names = zip.entries().collect { it.name } - ['mcmod.info', 'pack.mcmeta', - 'com/mcmoddev/steamadvantage/SteamAdvantage.class', - 'com/mcmoddev/steamadvantage/machines/SteamDrillTileEntity.class', - 'com/mcmoddev/steamadvantage/machines/SteamPumpTileEntity.class', - 'com/mcmoddev/steamadvantage/machines/GeothermalBoilerTileEntity.class', - 'assets/steamadvantage/lang/en_us.lang'].each { required -> + ['META-INF/mods.toml', 'pack.mcmeta', + 'zone/moddev/mc/steamadvantage/SteamAdvantage.class', + 'zone/moddev/mc/steamadvantage/machines/SteamDrillTileEntity.class', + 'zone/moddev/mc/steamadvantage/machines/SteamPumpTileEntity.class', + 'zone/moddev/mc/steamadvantage/machines/GeothermalBoilerTileEntity.class', + 'assets/steamadvantage/lang/en_us.json', + 'data/steamadvantage/recipes/steam_pipe.json', + 'data/steamadvantage/advancements/recipes/steam_pipe.json'].each { required -> if (!names.contains(required)) { throw new GradleException("Release jar is missing ${required}") } } ['agent-notes/', '.codex/', 'src/test/', 'fernflower_abstract_parameter_names.txt', - 'cyano/poweradvantage/', - 'com/mcmoddev/poweradvantage/', 'cyano/basemetals/', 'com/mcmoddev/lib/', - 'cyano/orespawn/', 'com/mcmoddev/orespawn/', 'cofh/api/', 'reborncore/', + 'cyano/poweradvantage/', + 'zone/moddev/mc/poweradvantage/', 'zone/moddev/mc/basemetals/', 'cyano/basemetals/', 'com/mcmoddev/lib/', + 'cyano/orespawn/', 'com/mcmoddev/orespawn/', 'cofh/api/', 'reborncore/', 'net/minecraft/', 'net/minecraftforge/'].each { forbidden -> if (names.any { it.contains(forbidden) }) { throw new GradleException("Release jar contains forbidden entry matching ${forbidden}") } } - def metadata = new JsonSlurper().parseText(zip.getInputStream(zip.getEntry('mcmod.info')) - .getText(StandardCharsets.UTF_8.name())) - def mod = metadata instanceof List ? metadata.first() : metadata - if (mod.modid != project.mod_id || mod.version != project.mod_version - || mod.mcversion != project.minecraft_version) { - throw new GradleException('Packaged mcmod.info identity, version, or target is incorrect') + String metadata = zip.getInputStream(zip.getEntry('META-INF/mods.toml')) + .getText(StandardCharsets.UTF_8.name()) + if (!metadata.contains('modId="steamadvantage"') + || !metadata.contains("version=\"${project.mod_version}\"")) { + throw new GradleException('Packaged mods.toml identity or version is incorrect') } def manifest = new Manifest(zip.getInputStream(zip.getEntry('META-INF/MANIFEST.MF'))).mainAttributes if (manifest.getValue('Implementation-Version') != project.mod_version @@ -485,8 +545,8 @@ tasks.register('verifyReleaseArtifacts') { } new ZipFile(new File(libs, expectedReleaseFiles.get()[1])).withCloseable { sourceZip -> - if (sourceZip.getEntry('com/mcmoddev/steamadvantage/SteamAdvantage.java') == null - || sourceZip.getEntry('com/mcmoddev/steamadvantage/machines/SteamDrillTileEntity.java') == null) { + if (sourceZip.getEntry('zone/moddev/mc/steamadvantage/SteamAdvantage.java') == null + || sourceZip.getEntry('zone/moddev/mc/steamadvantage/machines/SteamDrillTileEntity.java') == null) { throw new GradleException('Sources jar is missing required SteamAdvantage sources') } } @@ -503,7 +563,9 @@ tasks.register('writeReleaseChecksums') { description = 'Writes SHA-256 checksums for the audited release jars.' dependsOn tasks.named('verifyReleaseArtifacts') def outputFile = layout.buildDirectory.file('release/SHA256SUMS') + inputs.files(provider { expectedReleaseFiles.get().collect { layout.buildDirectory.file("libs/${it}").get().asFile } }) outputs.file(outputFile) + inputs.files(expectedReleaseFiles.map { names -> names.collect { layout.buildDirectory.file("libs/${it}").get().asFile } }) doLast { File output = outputFile.get().asFile output.parentFile.mkdirs() @@ -653,10 +715,24 @@ eclipse { classpath { downloadSources = true downloadJavadoc = true + file.whenMerged { model -> + // Eclipse must not overwrite expanded metadata with src/main/resources templates. + def rawResources = sourceSets.main.resources.srcDirs.collect { relativePath(it).replace('\\', '/') } + model.entries.removeAll { entry -> + entry instanceof org.gradle.plugins.ide.eclipse.model.SourceFolder + && (rawResources.contains(entry.path) || entry.path == 'build/resources/main') + } + def processed = new org.gradle.plugins.ide.eclipse.model.SourceFolder('build/resources/main', 'bin/main') + processed.entryAttributes['gradle_scope'] = 'main' + processed.entryAttributes['gradle_used_by_scope'] = 'main,test' + model.entries.add(processed) + } } synchronizationTasks 'isolateEclipseProductionRuns' } +tasks.named('eclipseClasspath') { dependsOn tasks.named('processResources') } + tasks.register('configureEclipseBuildship') { group = 'ide' description = 'Creates Buildship preferences for ForgeGradle 7 Eclipse imports.' @@ -706,6 +782,21 @@ tasks.register('isolateEclipseProductionRuns') { contents = contents.replace( 'key="MC_VERSION" value="${MC_VERSION}"', "key=\"MC_VERSION\" value=\"${project.minecraft_version}\"") + if (launch.name in ['runClient.launch', 'runServer.launch', 'runData.launch']) { + // Eclipse compiles into bin/main, not Gradle's merged run output. + def launchXml = new groovy.xml.XmlSlurper().parseText(contents) + def modClasses = launchXml.mapAttribute.find { + it.@key.text() == 'org.eclipse.debug.core.environmentVariables' + }.mapEntry.findAll { it.@key.text() == 'MOD_CLASSES' } + if (modClasses.size() != 1) { + throw new GradleException("${launch.name} must define one MOD_CLASSES entry") + } + String mainOutput = file('bin/main').absolutePath + String eclipseModClasses = "${project.mod_id}%%${mainOutput}" + + "${File.pathSeparator}${project.mod_id}%%${mainOutput}" + modClasses[0].@value = eclipseModClasses + contents = groovy.xml.XmlUtil.serialize(launchXml) + } launch.setText(contents.replace('\r\n', '\n'), 'UTF-8') } ['runClient.launch', 'runServer.launch'].each { name -> @@ -794,27 +885,58 @@ tasks.register('verifyEclipseProductionClasspath') { || !projectMetadata.contains('org.eclipse.buildship.core.gradleprojectbuilder')) { throw new GradleException('Eclipse project metadata is missing its Buildship nature or builder') } - File eclipseModMetadata = file('bin/main/mcmod.info') - def eclipseMetadata = new JsonSlurper().parseText(eclipseModMetadata.getText('UTF-8')) - def eclipseMod = eclipseMetadata instanceof List ? eclipseMetadata.first() : eclipseMetadata - if (eclipseMod.modid != project.mod_id || eclipseMod.version != project.mod_version - || eclipseMod.mcversion != project.minecraft_version) { + File eclipseModMetadata = file('bin/main/META-INF/mods.toml') + String eclipseMetadata = eclipseModMetadata.getText('UTF-8') + if (!eclipseMetadata.contains("modId=\"${project.mod_id}\"") + || !eclipseMetadata.contains("version=\"${project.mod_version}\"")) { throw new GradleException('Eclipse output contains incorrect mod metadata') } + def eclipseClasspath = new groovy.xml.XmlSlurper().parse(file('.classpath')) + def processedResources = eclipseClasspath.classpathentry.findAll { + it.@kind.text() == 'src' && it.@path.text() == 'build/resources/main' + } + def rawResourcePaths = sourceSets.main.resources.srcDirs.collect { relativePath(it).replace('\\', '/') } + if (processedResources.size() != 1 || processedResources[0].@output.text() != 'bin/main' + || eclipseClasspath.classpathentry.any { + it.@kind.text() == 'src' && rawResourcePaths.contains(it.@path.text()) + }) { + throw new GradleException('Eclipse must copy processed resources, never raw mod metadata templates') + } + String mainOutput = eclipseClasspath.classpathentry.find { + it.@kind.text() == 'src' && it.@path.text() == 'src/main/java' + }.@output.text() + if (file(mainOutput).canonicalFile != file('bin/main').canonicalFile) { + throw new GradleException('Eclipse production classes must use bin/main') + } + String expectedModClasses = "${project.mod_id}%%${file(mainOutput).absolutePath}" + + "${File.pathSeparator}${project.mod_id}%%${file(mainOutput).absolutePath}" + ['runClient.launch', 'runServer.launch', 'runData.launch'].each { name -> + def launch = new groovy.xml.XmlSlurper().parse(file(name)) + String modClasses = launch.mapAttribute.find { + it.@key.text() == 'org.eclipse.debug.core.environmentVariables' + }.mapEntry.find { it.@key.text() == 'MOD_CLASSES' }.@value.text() + if (modClasses != expectedModClasses) { + throw new GradleException("${name} does not discover the Eclipse production mod in bin/main") + } + } ['runClient.launch', 'runServer.launch'].each { name -> + def launch = new groovy.xml.XmlSlurper().parse(file(name)) String contents = file(name).getText('UTF-8').replace('\\', '/') - if (!contents.contains('org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE') - || !contents.contains('value="true"') + if (launch.booleanAttribute.find { + it.@key.text() == 'org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE' + }.@value.text() != 'true' || contents.contains('src/test') || contents.contains('bin/test')) { throw new GradleException("${name} does not isolate production code") } - if (!contents.contains('PROJECT_ATTR" value="SteamAdvantage"')) { + if (launch.stringAttribute.find { + it.@key.text() == 'org.eclipse.jdt.launching.PROJECT_ATTR' + }.@value.text() != 'SteamAdvantage') { throw new GradleException("${name} targets the wrong Eclipse project") } if (contents.contains('org.eclipse.buildship.core.gradleclasspathcontainer')) { throw new GradleException("${name} exposes compileOnly dependencies at runtime") } - ['BaseMetals', 'OreSpawn', 'RF-API.jar', 'RebornCore-1.12.2'].each { forbiddenDependency -> + ['RF-API.jar', 'RebornCore-1.12.2'].each { forbiddenDependency -> if (contents.toLowerCase(Locale.ROOT).contains(forbiddenDependency.toLowerCase(Locale.ROOT))) { throw new GradleException( "${name} includes forbidden runtime dependency ${forbiddenDependency}") @@ -823,6 +945,10 @@ tasks.register('verifyEclipseProductionClasspath') { if (!contents.contains(powerAdvantageDeobfJar.canonicalPath.replace('\\', '/'))) { throw new GradleException("${name} is missing the required PowerAdvantage runtime") } + if (!contents.contains(baseMetalsDeobfJar.canonicalPath.replace('\\', '/')) + || !contents.contains(oreSpawnDeobfJar.canonicalPath.replace('\\', '/'))) { + throw new GradleException("${name} is missing the required Base Metals or OreSpawn runtime") + } if (!contents.contains("forge-${project.minecraft_version}-${project.forge_version}")) { throw new GradleException("${name} is missing the Forge development runtime") } @@ -839,9 +965,9 @@ tasks.register('verifyEclipseProductionClasspath') { throw new GradleException( "${name} does not preserve the Forge bootstrap classpath order") } - if (contents.contains('${MC_VERSION}') - || !contents.contains( - "key=\"MC_VERSION\" value=\"${project.minecraft_version}\"")) { + if (contents.contains('${MC_VERSION}') || launch.mapAttribute.find { + it.@key.text() == 'org.eclipse.debug.core.environmentVariables' + }.mapEntry.find { it.@key.text() == 'MC_VERSION' }.@value.text() != project.minecraft_version) { throw new GradleException("${name} does not define a literal Minecraft version") } } @@ -902,7 +1028,7 @@ tasks.register('verifyModelAssets') { if (node instanceof Map) { node.each { key, value -> if (key == 'model' && value instanceof String) { - verifyReference(value, 'models/block', sourcePath) + verifyReference(value, 'models', sourcePath) } else { verifyBlockstateModels(value, sourcePath) } @@ -912,7 +1038,12 @@ tasks.register('verifyModelAssets') { } } fileTree(blockstateRoot) { include '**/*.json' }.files.sort().each { File blockstateFile -> - verifyBlockstateModels(new JsonSlurper().parse(blockstateFile), blockstateFile.path) + def blockstate = new JsonSlurper().parse(blockstateFile) + if (blockstate.containsKey('forge_marker') || (blockstate.variants instanceof Map + && (blockstate.variants.containsKey('normal') || blockstate.variants.containsKey('fluid')))) { + throw new GradleException("${blockstateFile.path} uses removed legacy blockstate selectors") + } + verifyBlockstateModels(blockstate, blockstateFile.path) } } } @@ -956,8 +1087,54 @@ tasks.register('verifyRepositoryHygiene') { } } +tasks.register('verifyRecipeTagGuards') { + group = 'verification' + description = 'Rejects recipes that can collapse when a Forge material tag is empty.' + File recipeRoot = file("src/main/resources/data/${project.mod_id}/recipes") + inputs.dir(recipeRoot) + doLast { + Closure collectTags + collectTags = { Object node, Set tags -> + if (node instanceof Map) { + node.each { key, value -> + if (key == 'conditions' || key == 'result') return + if (key == 'tag' && value instanceof String && value.startsWith('forge:')) { + tags.add(value) + } else { + collectTags(value, tags) + } + } + } else if (node instanceof Collection) { + node.each { collectTags(it, tags) } + } + } + fileTree(recipeRoot) { include '**/*.json' }.files.sort().each { File recipeFile -> + Map recipe = new JsonSlurper().parse(recipeFile) as Map + Set tags = [] as Set + collectTags(recipe, tags) + Collection conditions = (recipe.conditions ?: []) as Collection + if (conditions.any { !(it instanceof Map) }) { + throw new GradleException("${recipeFile.path} contains a non-object recipe condition") + } + Set guards = conditions + .findAll { it instanceof Map && it.type == 'poweradvantage:tag_not_empty' } + .collect { it.tag as String } as Set + Set emptyGuards = conditions.findAll { it.type == 'poweradvantage:tag_empty' } + .collect { it.tag as String } as Set + if (!(emptyGuards.intersect(guards)).isEmpty()) { + throw new GradleException("${recipeFile.path} requires the same tag to be empty and nonempty") + } + Set missing = tags - guards + if (!missing.isEmpty()) { + throw new GradleException("${recipeFile.path} lacks tag_not_empty guards for ${missing.sort()}") + } + } + } +} + tasks.named('check') { dependsOn tasks.named('verifyReleaseConfiguration') dependsOn tasks.named('verifyModelAssets') dependsOn tasks.named('verifyRepositoryHygiene') + dependsOn tasks.named('verifyRecipeTagGuards') } diff --git a/gradle.properties b/gradle.properties index 27145bc..6299d10 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,13 +5,14 @@ org.gradle.caching=true org.gradle.parallel=false net.minecraftforge.gradle.merge-source-sets=false -minecraft_version=1.12.2 -minecraft_version_range=[1.12.2] -forge_version=14.23.5.2859 -forge_version_range=[14.23.5.2859,) -loader_version_range=[14,) -mapping_channel=stable -mapping_version=39-1.12 +minecraft_version=1.13.2 +minecraft_version_range=[1.13.2] +forge_version=25.0.223 +forge_version_range=[25,) +loader_version_range=[25,) +mapping_channel=snapshot +mapping_version=20180921-1.13 +mcp_version=20190213.203750 loader_name=forge loader_code=1 @@ -24,16 +25,24 @@ curseforge_project_id=240984 mod_id=steamadvantage mod_name=Steam Advantage mod_license=GPL-3.0-only -mod_version=2.2.1.112021 -mod_group=com.mcmoddev.steamadvantage +mod_version=2.2.5.113021 +mod_group=zone.moddev.mc.steamadvantage mod_authors=DrCyano mod_description=Steam-powered machines and infrastructure for the Power Advantage platform. cf_requirements=power-advantage,base-metals cf_optionals= -cf_versions=1.12.2 +cf_versions=1.13.2 -poweradvantage_version=2.4.1.112021 +poweradvantage_version=2.4.4.113021 poweradvantage_source_repository=MinecraftModDevelopmentMods/PowerAdvantage -poweradvantage_source_ref=40811a0be37174a0633998eb3d820d95755d35e8 -poweradvantage_deobf_sha256=DE7759033A094718E1341CC82B9912425A24A035DBD7F91D590D8B921F08DEB2 +poweradvantage_source_ref=6a845ad68eb1e34dcdd793dceb9cb528be22cedf +poweradvantage_deobf_sha256=160F29590913A2DA0637E710458DC8AEF8D4CC3883EA3B0E2E258C70240BDE02 + +basemetals_version=3.0.1.113021 +basemetals_deobf_sha256=2E4B0F619AD6B516A341DD332FABB66FE882A9DBA8E5C74F5BB52942302CFD18 +# Same pinned source and class bytes, with a clean LF checkout on Linux. +basemetals_deobf_lf_sha256=D1843CFAB23E7DB4B8A64ADB280D7EA51E3909B8E3490D4F5D471F0C94E1D0BF + +orespawn_version=4.1.0.113021 +orespawn_deobf_sha256=F5A015584000CCEF0E94D8BB567E7B75603B37F10A88BFC5A129176D487BB038 diff --git a/src/main/java/com/mcmoddev/steamadvantage/SteamAdvantage.java b/src/main/java/com/mcmoddev/steamadvantage/SteamAdvantage.java deleted file mode 100644 index 2da0ed2..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/SteamAdvantage.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.mcmoddev.steamadvantage; - -import com.mcmoddev.steamadvantage.init.*; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.HashMap; -import java.util.Map; - -/* TODO list - * + Coal-Fired Steam Boiler - * + Boiler Tank - * + Steam Conduit - * + Steam Powered Rock Crusher - * + Steam Powered Blast Furnace (expanded furnace 2x2) - * --- push version 1.0 --- - * + Steam Powered Drill - * --- push version 1.1 --- - * - pressure cooker (steam-only furnace that only cooks food) - * + Musket (slow-loading ranged weapon) - * + Bullets (smelt lead nuggets into grape-shot, loading a gun consumes 1 grape-shot and 1 gunpowder) - * - Steam Powered Machine Shop (automatable crafter) - * - Steam Powered Defense Cannon (manual aiming and requires redstone trigger) - * --- push version 1.2 --- - * - Steam Powered Lift (pushes up special lift blocks, like an extendable piston) - * --- push version 1.3 --- - * - Oil-Burning Steam Boiler - * - Bioreactor (slowly makes liquid fuel from organic matter) - */ -@Mod(modid = SteamAdvantage.MODID, version = SteamAdvantage.VERSION, name=SteamAdvantage.NAME, - dependencies = "required-after:poweradvantage;after:basemetals", - acceptedMinecraftVersions = "[1.12.2]") -public class SteamAdvantage -{/** The identifier for this mod */ - public static final String MODID = "steamadvantage"; - /** The display name for this mod */ - public static final String NAME = "Steam Advantage"; - /** The version of this mod, in the format major.minor.update */ - public static final String VERSION = "2.2.1.112021"; - - public static float MUSKET_DAMAGE = 20; - public static int MUSKET_RELOAD = 20*5; - public static boolean MUSKET_ENABLE = true; - public static Map fluidBurnValues = new HashMap<>(); - - /** - * Pre-initialization step. Used for initializing objects and reading the - * config file - * @param event FML event object - */ - @EventHandler - public void preInit(FMLPreInitializationEvent event) - { - Entities.registerDataFixers(); - - Configuration config = new Configuration(event.getSuggestedConfigurationFile()); - config.load(); - - MUSKET_DAMAGE = config.getFloat("musket_damage", "options", MUSKET_DAMAGE, 0, 100, - "This is the amount of damage dealt by a shot from a blackpowder musket"); - MUSKET_RELOAD = config.getInt("musket_reload_time", "options", MUSKET_RELOAD, 20, 15*20, - "This is the amount of time (in game update ticks) that it takes to reload a musket.\n"+ - "Note that 20 ticks is 1 second of real time"); - MUSKET_ENABLE = config.getBoolean("musket_allowed", "options", MUSKET_ENABLE, - "If true, then the musket gun will be craftable."); - - fluidBurnValues.clear(); - String[] strs = config.getString("fluid_fuel_values","options","oil=5000;fuel=25000", - "A semi-colon delimited list of fuel fluids (by name) and the burn time (in game ticks) \n" - + "for a bucket (1000 units) of the given fluid. Specified in the following format: \n" - + "fluid name=burn time").split(";"); - for(String e : strs){ - if(e.contains("=")){ - String[] comps = e.split("=", 2); - String fluidName = comps[0].trim(); - try{ - Float value = Float.parseFloat(comps[1].trim()); - fluidBurnValues.put(fluidName, value); - FMLLog.info("%s: adding fluid fuel override for fluid '%s' with a burn time of %s game ticks per bucket",MODID,fluidName,value); - }catch(NumberFormatException ex){ - FMLLog.severe("Fluid fuel descriptor '%s' is not valid!",e); - } - } else { - FMLLog.severe("Fluid fuel descriptor '%s' is not valid!",e); - } - } - - config.save(); - - Blocks.init(); - Items.init(); - TreasureChests.init(config.getConfigFile().toPath().getParent()); - - - if(event.getSide() == Side.CLIENT){ - clientPreInit(event); - } - if(event.getSide() == Side.SERVER){ - serverPreInit(event); - } - } - - @SideOnly(Side.CLIENT) - private void clientPreInit(FMLPreInitializationEvent event){ - // client-only code - } - @SideOnly(Side.SERVER) - private void serverPreInit(FMLPreInitializationEvent event){ - // client-only code - } - /** - * Initialization step. Used for adding renderers and most content to the - * game - * @param event FML event object - */ - @EventHandler - public void init(FMLInitializationEvent event) - { - Recipes.init(); - Entities.init(); - GUI.init(); - Enchantments.init(); - Villages.init(); - - if(event.getSide() == Side.CLIENT){ - clientInit(event); - } - if(event.getSide() == Side.SERVER){ - serverInit(event); - } - } - - - @SideOnly(Side.CLIENT) - private void clientInit(FMLInitializationEvent event){ - // client-only code - Items.registerItemRenders(event); - Blocks.registerItemRenders(event); - Entities.registerRenderers(); - - } - @SideOnly(Side.SERVER) - private void serverInit(FMLInitializationEvent event){ - // client-only code - } - - /** - * Post-initialization step. Used for cross-mod options - * @param event FML event object - */ - @EventHandler - public void postInit(FMLPostInitializationEvent event) - { - - } - - - @SideOnly(Side.CLIENT) - private void clientPostInit(FMLPostInitializationEvent event){ - // client-only code - } - @SideOnly(Side.SERVER) - private void serverPostInit(FMLPostInitializationEvent event){ - // client-only code - } - -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/blocks/DrillBitBlock.java b/src/main/java/com/mcmoddev/steamadvantage/blocks/DrillBitBlock.java deleted file mode 100644 index 3dbdcfd..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/blocks/DrillBitBlock.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.mcmoddev.steamadvantage.blocks; - -import com.mcmoddev.steamadvantage.init.Power; -import net.minecraft.block.Block; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumBlockRenderType; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.Explosion; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import java.util.Collections; -import java.util.List; -import java.util.Random; - -public class DrillBitBlock extends Block implements ITileEntityProvider { - - - public DrillBitBlock() { - super(Material.IRON); - this.setHardness(5.0F).setResistance(2000.0F); - } - - @Override - public TileEntity createNewTileEntity(World arg0, int arg1) { - return new DrillBitTileEntity(); - } - - @Override - public Item getItemDropped(IBlockState bs, Random rand, int fortune){ - return null; - } - - @Override - public int quantityDropped(IBlockState state, int fortune, Random random){ - return 0; - } - - @Override public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ - return Collections.emptyList(); - } - - @Override - public EnumBlockRenderType getRenderType(IBlockState state) { - return EnumBlockRenderType.MODEL; - } - - //And this tell it that you can see through this block, and neighbor blocks should be rendered. - @Override - public boolean isOpaqueCube(IBlockState state) - { - return false; - } - - @Override - public boolean isFullCube(IBlockState state){ - return false; - } - - private static final AxisAlignedBB blockBounds = new AxisAlignedBB(0.25f, 0.25f, 0.25f, 0.75f, 0.75f, 0.75f); - @Override - public void addCollisionBoxToList(final IBlockState state, final World w, final BlockPos coord, final AxisAlignedBB bb, final List list, final Entity e, final boolean isActualState) { - super.addCollisionBoxToList(coord, bb, list, blockBounds); - } - - @Override - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - return blockBounds; - } - - - @Override - public void onEntityCollision(final World world, final BlockPos coord, final IBlockState bs, - final Entity victim) { - victim.attackEntityFrom(Power.machine_damage, 2.0f); - } - - @Override - public void onPlayerDestroy(World w, BlockPos coord, IBlockState state){ - destroyNeighbors(w,coord,w.getBlockState(coord)); - super.onPlayerDestroy(w, coord, state); - w.removeTileEntity(coord); - } - - @Override - public void onBlockExploded(World w, BlockPos coord, Explosion boom){ - destroyNeighbors(w,coord,w.getBlockState(coord)); - super.onBlockExploded(w, coord, boom); - w.removeTileEntity(coord); - } - - - private void destroyNeighbors(World w, BlockPos coord, IBlockState state) { - if(w.isRemote) return; - // destroy connected drill bits - for(int i = 0; i < 6; i++){ - BlockPos pos = coord.offset(EnumFacing.byIndex(i)); - if(w.getTileEntity(pos) instanceof DrillBitTileEntity){ - DrillBitTileEntity te = (DrillBitTileEntity)w.getTileEntity(pos); - te.destroyLine(); - } - } - } - -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/blocks/PlatformBlock.java b/src/main/java/com/mcmoddev/steamadvantage/blocks/PlatformBlock.java deleted file mode 100644 index 88948f8..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/blocks/PlatformBlock.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.mcmoddev.steamadvantage.blocks; - -import com.mcmoddev.steamadvantage.init.Blocks; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.block.properties.IProperty; -import net.minecraft.block.properties.PropertyInteger; -import net.minecraft.block.state.BlockStateContainer; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.Collections; -import java.util.List; -import java.util.Random; - -public class PlatformBlock extends Block{ - - - public static final net.minecraft.block.properties.PropertyInteger HEIGHT = PropertyInteger.create("height", 0, 4); - - private static final AxisAlignedBB[] boxes = new AxisAlignedBB[5]; - static{ - for(int i = 0; i < boxes.length; i++){ - if(i == 0){ - boxes[i] = new AxisAlignedBB(0.25f, 0f, 0.25f, 0.75f, 1f, 0.75f); - continue; - } - boxes[i] = new AxisAlignedBB(0, 0, 0, 1, 0.25f*i, 1); - } - } - - public PlatformBlock() { - super(Material.IRON); - this.setHardness(5.0F).setResistance(2000.0F); - this.setDefaultState(this.blockState.getBaseState().withProperty(HEIGHT, 1)); - } - - @Override - protected BlockStateContainer createBlockState() - { - return new BlockStateContainer(this, new IProperty[]{HEIGHT}); - } - - @Override - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos coord) { - Integer height = ((Integer)state.getValue(HEIGHT)); - return boxes[height]; - } - - @Override - public void addCollisionBoxToList(final IBlockState bs, final World world, final BlockPos coord, - final AxisAlignedBB box, final List collisionBoxList, - final Entity entity, final boolean isActualState) { - Integer height = ((Integer)world.getBlockState(coord).getValue(HEIGHT)); - super.addCollisionBoxToList(coord, box, collisionBoxList, boxes[height]); - } - - /** - * Override of default block behavior - */ - @Override - public boolean isOpaqueCube(final IBlockState bs) { - return false; - } - - /** - * Override of default block behavior - */ - @Override - public boolean isFullCube(final IBlockState bs) { - return false; - } - - /** - * Override of default block behavior - */ - @Override - public boolean isPassable(final IBlockAccess world, final BlockPos coord) { - return false; - } - - @Override - public int getMetaFromState(final IBlockState bs) { - return ((Integer)bs.getValue(HEIGHT)).intValue(); - } - - @Override - public IBlockState getStateFromMeta(final int bs) { - return this.getDefaultState().withProperty(HEIGHT, bs); - } - - /** - * Called when a neighboring block changes. - */ - @Override - public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor) { - if(world instanceof World) { - if (!this.canBlockStay((World)world, pos)) { - ((World)world).destroyBlock(pos, true); - } - } - } - @Override - public void neighborChanged(IBlockState state, World w, BlockPos pos, Block b, BlockPos fromPos){ - onNeighborChange(w,pos,pos); - } - - public boolean canBlockStay(World worldIn, BlockPos pos) - { - Block block = worldIn.getBlockState(pos.down()).getBlock(); - return block == this || block == Blocks.steam_elevator_platform || block == Blocks.steam_elevator; - } - - @Override - public Item getItemDropped(IBlockState bs, Random rand, int fortune){ - return null; - } - - @Override - public int quantityDropped(IBlockState state, int fortune, Random random){ - return 0; - } - - @Override public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ - return Collections.emptyList(); - } - - @SideOnly(Side.CLIENT) - @Override - public boolean shouldSideBeRendered(final IBlockState bs, final IBlockAccess world, final BlockPos coord, final EnumFacing face) { - return true; - } -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/blocks/PumpPipeBlock.java b/src/main/java/com/mcmoddev/steamadvantage/blocks/PumpPipeBlock.java deleted file mode 100644 index c177b56..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/blocks/PumpPipeBlock.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.mcmoddev.steamadvantage.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumBlockRenderType; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.Explosion; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import java.util.Collections; -import java.util.List; -import java.util.Random; - -public class PumpPipeBlock extends Block{ - - - public PumpPipeBlock() { - super(Material.IRON); - this.setHardness(5.0F).setResistance(10.0F); - } - - @Override - public Item getItemDropped(IBlockState bs, Random rand, int fortune){ - return null; - } - - @Override - public int quantityDropped(IBlockState state, int fortune, Random random){ - return 0; - } - - @Override public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ - return Collections.emptyList(); - } - - - @Override - public EnumBlockRenderType getRenderType(IBlockState state) { - return EnumBlockRenderType.MODEL; - } - - //And this tell it that you can see through this block, and neighbor blocks should be rendered. - @Override - public boolean isOpaqueCube(IBlockState bs) - { - return false; - } - - @Override - public boolean isFullCube(IBlockState bs){ - return false; - } - - - private static final AxisAlignedBB blockBounds = new AxisAlignedBB(0.0f, 0.25f, 0.0f, 0.75f, 1.0f, 1.0f); - @Override - public void addCollisionBoxToList(final IBlockState state, final World w, final BlockPos coord, final AxisAlignedBB bb, final List list, final Entity e, final boolean isActualState) { - super.addCollisionBoxToList(coord, bb, list, blockBounds); - } - - @Override - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - return blockBounds; - } - - - - - - @Override - public void onPlayerDestroy(World w, BlockPos coord, IBlockState state){ - destroyNeighbors(w,coord,w.getBlockState(coord)); - super.onPlayerDestroy(w, coord, state); - } - - @Override - public void onBlockExploded(World w, BlockPos coord, Explosion boom){ - destroyNeighbors(w,coord,w.getBlockState(coord)); - super.onBlockExploded(w, coord, boom); - } - - - private void destroyNeighbors(World w, BlockPos coord, IBlockState state) { - if(w.isRemote) return; - // destroy connected drill bits - BlockPos c = coord.down(); - while(c.getY() > 0 && w.getBlockState(c).getBlock() == this){ - w.setBlockToAir(c); - c = c.down(); - } - } - -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/blocks/SteamTrackBlock.java b/src/main/java/com/mcmoddev/steamadvantage/blocks/SteamTrackBlock.java deleted file mode 100644 index a1cd9e2..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/blocks/SteamTrackBlock.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.mcmoddev.steamadvantage.blocks; - -import com.mcmoddev.steamadvantage.init.Power; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.List; - -public class SteamTrackBlock extends cyano.poweradvantage.api.simple.BlockSimplePowerConduit{ - - public SteamTrackBlock() { - super(Material.PISTON, 0.75f, 2f/16f, Power.steam_power); - } - - @Override - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { - return FULL_BLOCK_AABB; - } - @Override - public void addCollisionBoxToList(final IBlockState bs, final World world, final BlockPos coord, - final AxisAlignedBB box, final List collisionBoxList, - final Entity entity, final boolean isActualState) { - super.addCollisionBoxToList(coord, box, collisionBoxList, FULL_BLOCK_AABB); - } - - @Override - public boolean isFullCube(IBlockState bs) { - return false; - } - - @Override - public boolean isOpaqueCube(IBlockState bs) { - return false; - } - - @SideOnly(Side.CLIENT) - @Override - public BlockRenderLayer getRenderLayer() { - return BlockRenderLayer.CUTOUT; - } - - -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/compat/BaseMetalsCompat.java b/src/main/java/com/mcmoddev/steamadvantage/compat/BaseMetalsCompat.java deleted file mode 100644 index f232014..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/compat/BaseMetalsCompat.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.mcmoddev.steamadvantage.compat; - -import com.mcmoddev.steamadvantage.SteamAdvantage; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.Loader; -import org.apache.logging.log4j.Level; - -import java.lang.reflect.Method; - -public final class BaseMetalsCompat { - - private static final String MODID = "basemetals"; - private static final String[] CRUSHER_REGISTRY_CLASSES = { - "cyano.basemetals.registry.CrusherRecipeRegistry", - "com.mcmoddev.lib.registry.CrusherRecipeRegistry" - }; - - private static boolean registryResolved = false; - private static Class crusherRegistryClass = null; - private static boolean missingRegistryLogged = false; - - private BaseMetalsCompat() { - throw new IllegalAccessError("Not an instantiable class"); - } - - public static boolean isLoaded() { - return Loader.isModLoaded(MODID); - } - - public static void addCrusherRecipe(String input, ItemStack output) { - if (!isLoaded()) return; - invokeCrusherRecipe(new Class[]{String.class, ItemStack.class}, new Object[]{input, output}); - } - - public static void addCrusherRecipe(Item input, ItemStack output) { - if (!isLoaded()) return; - invokeCrusherRecipe(new Class[]{Item.class, ItemStack.class}, new Object[]{input, output}); - } - - public static void addCrusherRecipe(Block input, ItemStack output) { - if (!isLoaded()) return; - invokeCrusherRecipe(new Class[]{Block.class, ItemStack.class}, new Object[]{input, output}); - } - - public static boolean hasCrusherRecipe(ItemStack input) { - return getCrusherRecipeOutput(input) != null; - } - - public static ItemStack getCrusherRecipeOutput(ItemStack input) { - if (input == null) return null; - if (isLoaded()) { - ItemStack output = getRecipeOutput(getCrusherRecipe(input, ItemStack.class)); - if (output != null) return output; - } - return getVanillaCrusherOutput(input); - } - - public static ItemStack getCrusherRecipeOutput(IBlockState input) { - if (input == null) return null; - if (isLoaded()) { - ItemStack output = getRecipeOutput(getCrusherRecipe(input, IBlockState.class)); - if (output != null) return output; - } - return getCrusherRecipeOutput(new ItemStack(input.getBlock(), 1, input.getBlock().getMetaFromState(input))); - } - - private static Class getCrusherRegistryClass() { - if (!isLoaded()) return null; - if (registryResolved) return crusherRegistryClass; - - registryResolved = true; - for (String className : CRUSHER_REGISTRY_CLASSES) { - try { - crusherRegistryClass = Class.forName(className); - return crusherRegistryClass; - } catch (ClassNotFoundException e) { - // Try the next known BaseMetals package. - } - } - - if (!missingRegistryLogged) { - FMLLog.warning("%s: BaseMetals is loaded, but no known crusher recipe registry was found", SteamAdvantage.MODID); - missingRegistryLogged = true; - } - return null; - } - - private static void invokeCrusherRecipe(Class[] parameterTypes, Object[] args) { - Class registry = getCrusherRegistryClass(); - if (registry == null) return; - - try { - Method method = registry.getMethod("addNewCrusherRecipe", parameterTypes); - method.invoke(null, args); - } catch (ReflectiveOperationException | RuntimeException e) { - FMLLog.log(Level.WARN, e, "%s: failed to add BaseMetals crusher recipe through %s", SteamAdvantage.MODID, registry.getName()); - } - } - - private static Object getCrusherRecipe(Object input, Class inputType) { - Class registry = getCrusherRegistryClass(); - if (registry == null) return null; - - try { - Object instance = registry.getMethod("getInstance").invoke(null); - Method method = registry.getMethod("getRecipeForInputItem", inputType); - method.setAccessible(true); - return method.invoke(instance, input); - } catch (NoSuchMethodException e) { - return null; - } catch (ReflectiveOperationException | RuntimeException e) { - FMLLog.log(Level.WARN, e, "%s: failed to look up BaseMetals crusher recipe through %s", SteamAdvantage.MODID, registry.getName()); - return null; - } - } - - private static ItemStack getRecipeOutput(Object recipe) { - if (recipe == null) return null; - - try { - Method method = recipe.getClass().getMethod("getOutput"); - method.setAccessible(true); - Object output = method.invoke(recipe); - return output instanceof ItemStack ? ((ItemStack) output).copy() : null; - } catch (ReflectiveOperationException | RuntimeException e) { - FMLLog.log(Level.WARN, e, "%s: failed to read BaseMetals crusher recipe output", SteamAdvantage.MODID); - return null; - } - } - - private static ItemStack getVanillaCrusherOutput(ItemStack input) { - if (input == null || input.getItem() == null) return null; - - Block block = Block.getBlockFromItem(input.getItem()); - int meta = input.getMetadata(); - - if (block == Blocks.STONE) return new ItemStack(Blocks.COBBLESTONE, 1); - if (block == Blocks.STONEBRICK) return new ItemStack(Blocks.COBBLESTONE, 1); - if (block == Blocks.STONE_SLAB && (meta == 0 || meta == 5)) return new ItemStack(Blocks.STONE_SLAB, 1, 3); - if (block == Blocks.COBBLESTONE || block == Blocks.MOSSY_COBBLESTONE) return new ItemStack(Blocks.GRAVEL, 1); - if (block == Blocks.COBBLESTONE_WALL) return new ItemStack(Blocks.GRAVEL, 1); - if (block == Blocks.GRAVEL) return new ItemStack(Blocks.SAND, 1); - if (block == Blocks.SANDSTONE) return new ItemStack(Blocks.SAND, 4); - if (block == Blocks.RED_SANDSTONE) return new ItemStack(Blocks.SAND, 4, 1); - if (block == Blocks.STONE_SLAB && meta == 1) return new ItemStack(Blocks.SAND, 2); - if (block == Blocks.STONE_SLAB2 && meta == 0) return new ItemStack(Blocks.SAND, 2, 1); - if (block == Blocks.GLASS) return new ItemStack(Blocks.SAND, 1); - if (block == Blocks.STAINED_GLASS) return new ItemStack(Blocks.SAND, 1, meta); - if (block == Blocks.GLOWSTONE) return new ItemStack(Items.GLOWSTONE_DUST, 4); - if (block == Blocks.LAPIS_ORE) return new ItemStack(Items.DYE, 8, 4); - if (block == Blocks.LAPIS_BLOCK) return new ItemStack(Items.DYE, 9, 4); - if (block == Blocks.REDSTONE_ORE || block == Blocks.LIT_REDSTONE_ORE) return new ItemStack(Items.REDSTONE, 8); - if (block == Blocks.REDSTONE_BLOCK) return new ItemStack(Items.REDSTONE, 9); - if (block == Blocks.QUARTZ_ORE) return new ItemStack(Items.QUARTZ, 2); - if (block == Blocks.QUARTZ_BLOCK) return new ItemStack(Items.QUARTZ, 4); - if (block == Blocks.PRISMARINE) { - if (meta == 1) return new ItemStack(Items.PRISMARINE_SHARD, 9); - if (meta == 2) return new ItemStack(Items.PRISMARINE_SHARD, 8); - return new ItemStack(Items.PRISMARINE_SHARD, 4); - } - if (block == Blocks.SEA_LANTERN) return new ItemStack(Items.PRISMARINE_CRYSTALS, 3); - if (block == Blocks.SLIME_BLOCK) return new ItemStack(Items.SLIME_BALL, 9); - if (block == Blocks.BONE_BLOCK) return new ItemStack(Items.DYE, 9, 15); - - if (input.getItem() == Items.REEDS) return new ItemStack(Items.SUGAR, 2); - if (input.getItem() == Items.BONE) return new ItemStack(Items.DYE, 3, 15); - if (input.getItem() == Items.BLAZE_ROD) return new ItemStack(Items.BLAZE_POWDER, 2); - - return null; - } -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/init/Blocks.java b/src/main/java/com/mcmoddev/steamadvantage/init/Blocks.java deleted file mode 100644 index a530818..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/init/Blocks.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.mcmoddev.steamadvantage.init; - -import cyano.poweradvantage.api.GUIBlock; -import com.mcmoddev.poweradvantage.blocks.BlockPowerSwitch; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.blocks.*; -import com.mcmoddev.steamadvantage.machines.*; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemBlock; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.registry.ForgeRegistries; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.HashMap; -import java.util.Map; - -public abstract class Blocks { - private static final Map allBlocks = new HashMap<>(); - - - public static GUIBlock steam_boiler_coal; - public static GUIBlock steam_boiler_electric; - public static GUIBlock steam_boiler_geothermal; - public static GUIBlock steam_crusher; - public static GUIBlock steam_furnace; - public static GUIBlock steam_tank; - public static GUIBlock steam_drill; - public static GUIBlock steam_elevator; - public static Block steam_elevator_platform; - public static IBlockState[] steam_elevator_platforms; - public static Block steam_pipe; - public static Block drillbit; - public static Block steam_track; - - public static Block pump_pipe_steam; - public static Block steam_switch; - public static GUIBlock steam_still; - public static GUIBlock steam_pump; - public static GUIBlock steam_boiler_oil; - - private static boolean initDone = false; - @SuppressWarnings("deprecation") - public static void init(){ - if(initDone) return; - - steam_pipe = addBlock(new SteamPipeBlock(),"steam_pipe"); - OreDictionary.registerOre("conduitSteam", steam_pipe); - steam_track = addBlock(new SteamTrackBlock(),"steam_track"); - steam_boiler_coal = (GUIBlock)addBlock(new CoalBoilerBlock(),"steam_boiler_coal"); - steam_boiler_electric = (GUIBlock)addBlock(new ElectricBoilerBlock(),"steam_boiler_electric"); - steam_boiler_geothermal = (GUIBlock)addBlock(new GeothermalBoilerBlock(),"steam_boiler_geothermal"); - steam_tank = (GUIBlock)addBlock(new SteamTankBlock(),"steam_tank"); - steam_furnace = (GUIBlock)addBlock(new BlastFurnaceBlock(),"steam_furnace"); - steam_crusher = (GUIBlock)addBlock(new RockCrusherBlock(),"steam_crusher"); - steam_drill = (GUIBlock)addBlock(new SteamDrillBlock(),"steam_drill"); - drillbit = addBlock(new DrillBitBlock(),"drillbit"); - steam_elevator_platform = addBlock(new PlatformBlock(),"platform"); - steam_elevator_platforms = new IBlockState[5]; - for(int i = 0; i < steam_elevator_platforms.length; i++){ - steam_elevator_platforms[i] = steam_elevator_platform.getStateFromMeta(i); - } - steam_elevator = (GUIBlock)addBlock(new SteamElevatorBlock(),"steam_elevator"); - - steam_switch = addBlock(new BlockPowerSwitch(Power.steam_power),"steam_switch"); - pump_pipe_steam = addBlock(new PumpPipeBlock(),"pump_pipe_steam"); - pump_pipe_steam.setCreativeTab(CreativeTabs.SEARCH); - steam_still = (GUIBlock)addBlock(new SteamStillBlock(),"steam_still"); - steam_pump = (GUIBlock)addBlock(new SteamPumpBlock(),"steam_pump"); - steam_boiler_oil = (GUIBlock)addBlock(new OilBoilerBlock(),"steam_boiler_oil"); - - initDone = true; - } - - - @SuppressWarnings("deprecation") - private static Block addBlock(Block block, String name ){ - block.setTranslationKey(SteamAdvantage.MODID+"."+name); - ResourceLocation registryName = new ResourceLocation(SteamAdvantage.MODID, name); - block.setRegistryName(registryName); - ForgeRegistries.BLOCKS.register(block); - ItemBlock itemBlock = new ItemBlock(block); - itemBlock.setRegistryName(registryName); - ForgeRegistries.ITEMS.register(itemBlock); - block.setCreativeTab(com.mcmoddev.poweradvantage.init.ItemGroups.tab_powerAdvantage); - allBlocks.put(name, block); - return block; - } - - @SideOnly(Side.CLIENT) - public static void registerItemRenders(FMLInitializationEvent event){ - for(Map.Entry e : allBlocks.entrySet()){ - String name = e.getKey(); - Block block = e.getValue(); - Minecraft.getMinecraft().getRenderItem().getItemModelMesher() - .register(net.minecraft.item.Item.getItemFromBlock(block), 0, - new ModelResourceLocation(SteamAdvantage.MODID+":"+name, "inventory")); - } - } - - -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/init/Entities.java b/src/main/java/com/mcmoddev/steamadvantage/init/Entities.java deleted file mode 100644 index d21d4f8..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/init/Entities.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.mcmoddev.steamadvantage.init; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.datafix.FixTypes; -import net.minecraft.util.datafix.IFixableData; -import net.minecraftforge.common.util.ModFixs; -import net.minecraftforge.fml.client.registry.ClientRegistry; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.blocks.DrillBitTileEntity; -import com.mcmoddev.steamadvantage.machines.*; - -public class Entities { - - private static boolean initDone = false; - private static boolean dataFixersRegistered = false; - - public static void registerDataFixers(){ - if(dataFixersRegistered) return; - ModFixs fixes = FMLCommonHandler.instance().getDataFixer().init(SteamAdvantage.MODID, 1); - fixes.registerFix(FixTypes.BLOCK_ENTITY, new LegacyTileEntityIdFix(SteamAdvantage.MODID, 1)); - dataFixersRegistered = true; - } - - public static void init(){ - if(initDone) return; - - Blocks.init(); - - - registerTileEntity(CoalBoilerTileEntity.class, "steam_boiler_coal"); - registerTileEntity(ElectricBoilerTileEntity.class, "steam_boiler_electric"); - registerTileEntity(GeothermalBoilerTileEntity.class, "steam_boiler_geothermal"); - registerTileEntity(SteamTankTileEntity.class, "steam_tank"); - registerTileEntity(BlastFurnaceTileEntity.class, "steam_furnace"); - registerTileEntity(RockCrusherTileEntity.class, "steam_crusher"); - registerTileEntity(SteamDrillTileEntity.class, "steam_drill"); - registerTileEntity(SteamElevatorTileEntity.class, "steam_elevator"); - registerTileEntity(DrillBitTileEntity.class, "drillbit"); - registerTileEntity(SteamStillTileEntity.class, "steam_still"); - registerTileEntity(SteamPumpTileEntity.class, "steam_pump"); - registerTileEntity(OilBoilerTileEntity.class, "steam_boiler_oil"); - - - initDone = true; - } - - private static void registerTileEntity(Class tileEntityClass, String path){ - GameRegistry.registerTileEntity(tileEntityClass, new ResourceLocation(SteamAdvantage.MODID, path)); - } - - private static final class LegacyTileEntityIdFix implements IFixableData { - private final String modid; - private final int version; - - private LegacyTileEntityIdFix(String modid, int version) { - this.modid = modid; - this.version = version; - } - - @Override - public int getFixVersion() { - return version; - } - - @Override - public NBTTagCompound fixTagCompound(NBTTagCompound compound) { - if (compound.hasKey("id", 8)) { - String id = compound.getString("id"); - String legacyPrefix = modid + "."; - String legacyMinecraftPrefix = "minecraft:" + legacyPrefix; - if (id.startsWith(legacyMinecraftPrefix)) { - compound.setString("id", modid + ":" + id.substring(legacyMinecraftPrefix.length())); - } else if (id.startsWith(legacyPrefix)) { - compound.setString("id", modid + ":" + id.substring(legacyPrefix.length())); - } - } - return compound; - } - } - - @SideOnly(Side.CLIENT) - public static void registerRenderers(){ - ClientRegistry.bindTileEntitySpecialRenderer(DrillBitTileEntity.class, new com.mcmoddev.steamadvantage.graphics.DrillBitRenderer()); - } -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/init/Items.java b/src/main/java/com/mcmoddev/steamadvantage/init/Items.java deleted file mode 100644 index 6ebbeb1..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/init/Items.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.mcmoddev.steamadvantage.init; - -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.items.MusketItem; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.registry.ForgeRegistries; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -public abstract class Items { - - - public static final Map allItems = new HashMap<>(); - - public static Item steam_governor; - public static Item steam_drill_bit; - public static Item blackpowder_cartridge; - public static Item blackpowder_musket; - - - private static boolean initDone = false; - public static void init(){ - if(initDone) return; - Blocks.init(); - - steam_governor = addItem("steam_governor",new Item(),"governor","governorBrass"); - steam_drill_bit = addItem("steam_drill_bit",new Item()); - blackpowder_cartridge = addItem("blackpowder_cartridge",new Item(),"ammoBlackpowder"); - blackpowder_musket = addItem("musket",new MusketItem(),"gun"); - - initDone = true; - } - - private static Item addItem(String unlocalizedName, Item i,String... oreDictNames){ - Item n = addItem(unlocalizedName,i); - for(String oreDictName : oreDictNames){ - OreDictionary.registerOre(oreDictName, n); - } - return n; - } - @SuppressWarnings("deprecation") - private static Item addItem(String unlocalizedName, Item i){ - i.setTranslationKey(SteamAdvantage.MODID+"."+unlocalizedName); - i.setRegistryName(new ResourceLocation(SteamAdvantage.MODID, unlocalizedName)); - ForgeRegistries.ITEMS.register(i); - i.setCreativeTab(com.mcmoddev.poweradvantage.init.ItemGroups.tab_powerAdvantage); - allItems.put(unlocalizedName, i); - return i; - } - - public static Item getItemByName(String unlocalizedName){ - return allItems.get(unlocalizedName); - } - - public static Set> getAllRegisteredItems(){ - return allItems.entrySet(); - } - - @SideOnly(Side.CLIENT) - public static void registerItemRenders(FMLInitializationEvent event) { - for(Map.Entry e : getAllRegisteredItems()){ - Minecraft.getMinecraft().getRenderItem().getItemModelMesher() - .register(e.getValue(), 0, - new ModelResourceLocation(SteamAdvantage.MODID+":"+e.getKey(), "inventory")); - } - } - -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/ElectricBoilerBlock.java b/src/main/java/com/mcmoddev/steamadvantage/machines/ElectricBoilerBlock.java deleted file mode 100644 index 025de61..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/ElectricBoilerBlock.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.mcmoddev.steamadvantage.machines; - -import cyano.poweradvantage.api.ConduitType; -import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.steamadvantage.init.Power; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.Explosion; -import net.minecraft.world.World; - - - -public class ElectricBoilerBlock extends cyano.poweradvantage.api.simple.BlockSimplePowerMachine{ - - - public ElectricBoilerBlock() { - super(Material.PISTON, 0.75f, Power.steam_power, ElectricBoilerTileEntity.ELECTRIC_POWER, Fluids.fluidConduit_general); - } - - @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { - return new ElectricBoilerTileEntity(); - } - - @Override - public boolean hasComparatorInputOverride(IBlockState bs) { - return true; - } - - @Override - public int getComparatorInputOverride(IBlockState bs, World world, BlockPos coord) { - if(world.getTileEntity(coord) instanceof ElectricBoilerTileEntity){ - return ((ElectricBoilerTileEntity)world.getTileEntity(coord)).getComparatorOutput(); - } - return 0; - } - - @Override - public boolean isPowerSink(ConduitType type){ - return !ConduitType.areSameType(Power.steam_power, type); - } - - @Override - public boolean isPowerSource(ConduitType type){ - return ConduitType.areSameType(Power.steam_power, type); - } - - - ///// Overrides to make this a multi-type block ///// - - /** - * This method is called whenever the block is placed into the world - */ - @Override - public void onBlockAdded(World w, BlockPos coord, IBlockState state){ - super.onBlockAdded(w, coord, state); - ConduitRegistry.getInstance().conduitBlockPlacedEvent(w, w.provider.getDimension(), coord, ElectricBoilerTileEntity.ELECTRIC_POWER); - ConduitRegistry.getInstance().conduitBlockPlacedEvent(w, w.provider.getDimension(), coord, com.mcmoddev.poweradvantage.init.Fluids.fluidConduit_general); - } - - /** - * This method is called when the block is removed from the world by an entity. - */ - @Override - public void onPlayerDestroy(World w, BlockPos coord, IBlockState state){ - super.onPlayerDestroy(w, coord, state); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, ElectricBoilerTileEntity.ELECTRIC_POWER); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - /** - * This method is called when the block is destroyed by an explosion. - */ - @Override - public void onBlockExploded(World w, BlockPos coord, Explosion boom){ - super.onBlockExploded(w, coord, boom); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, ElectricBoilerTileEntity.ELECTRIC_POWER); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - - - ///// end multi-type overrides ///// -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/GeothermalBoilerBlock.java b/src/main/java/com/mcmoddev/steamadvantage/machines/GeothermalBoilerBlock.java deleted file mode 100644 index aac3482..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/GeothermalBoilerBlock.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.mcmoddev.steamadvantage.machines; - -import cyano.poweradvantage.api.ConduitType; -import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.steamadvantage.init.Power; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.Explosion; -import net.minecraft.world.World; - -public class GeothermalBoilerBlock extends cyano.poweradvantage.api.simple.BlockSimplePowerMachine{ - - public GeothermalBoilerBlock() { - super(Material.PISTON, 0.75f, Power.steam_power, Fluids.fluidConduit_general); - } - - @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { - return new GeothermalBoilerTileEntity(); - } - - @Override - public boolean hasComparatorInputOverride(IBlockState bs) { - return true; - } - - @Override - public int getComparatorInputOverride(IBlockState bs, World world, BlockPos coord) { - if(world.getTileEntity(coord) instanceof GeothermalBoilerTileEntity){ - return ((GeothermalBoilerTileEntity)world.getTileEntity(coord)).getComparatorOutput(); - } - return 0; - } -///// Overrides to make this a multi-type block ///// -@Override -public boolean isPowerSink(ConduitType type){ - return !ConduitType.areSameType(Power.steam_power, type); -} - - @Override - public boolean isPowerSource(ConduitType type){ - return ConduitType.areSameType(Power.steam_power, type); - } - /** - * This method is called whenever the block is placed into the world - */ - @Override - public void onBlockAdded(World w, BlockPos coord, IBlockState state){ - super.onBlockAdded(w, coord, state); - ConduitRegistry.getInstance().conduitBlockPlacedEvent(w, w.provider.getDimension(), coord, com.mcmoddev.poweradvantage.init.Fluids.fluidConduit_general); - } - - /** - * This method is called when the block is removed from the world by an entity. - */ - @Override - public void onPlayerDestroy(World w, BlockPos coord, IBlockState state){ - super.onPlayerDestroy(w, coord, state); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - /** - * This method is called when the block is destroyed by an explosion. - */ - @Override - public void onBlockExploded(World w, BlockPos coord, Explosion boom){ - super.onBlockExploded(w, coord, boom); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - - - ///// end multi-type overrides ///// - -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/recipe/condition/MusketEnabledConditionFactory.java b/src/main/java/com/mcmoddev/steamadvantage/recipe/condition/MusketEnabledConditionFactory.java deleted file mode 100644 index fe1ee5c..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/recipe/condition/MusketEnabledConditionFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.mcmoddev.steamadvantage.recipe.condition; - -import com.google.gson.JsonObject; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import net.minecraftforge.common.crafting.IConditionFactory; -import net.minecraftforge.common.crafting.JsonContext; - -import java.util.function.BooleanSupplier; - -public class MusketEnabledConditionFactory implements IConditionFactory { - @Override - public BooleanSupplier parse(JsonContext context, JsonObject json) { - return () -> SteamAdvantage.MUSKET_ENABLE; - } -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/recipe/condition/RecipeModeConditionFactory.java b/src/main/java/com/mcmoddev/steamadvantage/recipe/condition/RecipeModeConditionFactory.java deleted file mode 100644 index ce77237..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/recipe/condition/RecipeModeConditionFactory.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.mcmoddev.steamadvantage.recipe.condition; - -import com.google.gson.JsonObject; -import com.mcmoddev.poweradvantage.PowerAdvantage; -import com.mcmoddev.poweradvantage.RecipeMode; -import net.minecraft.util.JsonUtils; -import net.minecraftforge.common.crafting.IConditionFactory; -import net.minecraftforge.common.crafting.JsonContext; - -import java.util.Locale; -import java.util.function.BooleanSupplier; - -public class RecipeModeConditionFactory implements IConditionFactory { - @Override - public BooleanSupplier parse(JsonContext context, JsonObject json) { - RecipeMode mode = RecipeMode.valueOf(JsonUtils.getString(json, "mode").toUpperCase(Locale.US)); - return () -> PowerAdvantage.recipeMode == mode; - } -} diff --git a/src/main/java/com/mcmoddev/steamadvantage/util/LegacyFluidHandler.java b/src/main/java/com/mcmoddev/steamadvantage/util/LegacyFluidHandler.java deleted file mode 100644 index 4b72a6c..0000000 --- a/src/main/java/com/mcmoddev/steamadvantage/util/LegacyFluidHandler.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.mcmoddev.steamadvantage.util; - -import net.minecraft.util.EnumFacing; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidTankProperties; - -public interface LegacyFluidHandler extends IFluidHandler { - - int fill(EnumFacing face, FluidStack fluid, boolean forReal); - - FluidStack drain(EnumFacing face, FluidStack fluid, boolean forReal); - - FluidStack drain(EnumFacing face, int amount, boolean forReal); - - boolean canFill(EnumFacing face, Fluid fluid); - - boolean canDrain(EnumFacing face, Fluid fluid); - - FluidTankInfo[] getTankInfo(EnumFacing face); - - @Override - default IFluidTankProperties[] getTankProperties() { - FluidTankInfo[] tankInfo = getTankInfo(null); - IFluidTankProperties[] properties = new IFluidTankProperties[tankInfo.length]; - for (int i = 0; i < tankInfo.length; i++) { - final FluidTankInfo info = tankInfo[i]; - properties[i] = new IFluidTankProperties() { - @Override - public FluidStack getContents() { - return info.fluid; - } - - @Override - public int getCapacity() { - return info.capacity; - } - - @Override - public boolean canFill() { - return true; - } - - @Override - public boolean canDrain() { - return true; - } - - @Override - public boolean canFillFluidType(FluidStack fluidStack) { - return fluidStack != null && LegacyFluidHandler.this.canFill(null, fluidStack.getFluid()); - } - - @Override - public boolean canDrainFluidType(FluidStack fluidStack) { - return fluidStack != null && LegacyFluidHandler.this.canDrain(null, fluidStack.getFluid()); - } - }; - } - return properties; - } - - @Override - default int fill(FluidStack resource, boolean doFill) { - return fill(null, resource, doFill); - } - - @Override - default FluidStack drain(FluidStack resource, boolean doDrain) { - return drain(null, resource, doDrain); - } - - @Override - default FluidStack drain(int maxDrain, boolean doDrain) { - return drain(null, maxDrain, doDrain); - } -} diff --git a/src/main/java/zone/moddev/mc/steamadvantage/SteamAdvantage.java b/src/main/java/zone/moddev/mc/steamadvantage/SteamAdvantage.java new file mode 100644 index 0000000..a672ba9 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/SteamAdvantage.java @@ -0,0 +1,89 @@ +package zone.moddev.mc.steamadvantage; + +import java.util.HashMap; +import java.util.Map; +import java.io.IOException; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.fml.DistExecutor; +import net.minecraftforge.fml.ModLoadingContext; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.config.ModConfig; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.loading.FMLPaths; +import cyano.poweradvantage.api.migration.LegacyConfigMigration; +import cyano.poweradvantage.api.migration.LegacyConfigMigration.Mapping; +import cyano.poweradvantage.api.migration.LegacyConfigMigration.ValueType; +import zone.moddev.mc.steamadvantage.config.SteamAdvantageConfig; +import zone.moddev.mc.steamadvantage.init.Blocks; +import zone.moddev.mc.steamadvantage.init.Enchantments; +import zone.moddev.mc.steamadvantage.init.Entities; +import zone.moddev.mc.steamadvantage.init.GUI; +import zone.moddev.mc.steamadvantage.init.Items; +import zone.moddev.mc.steamadvantage.init.Recipes; +import zone.moddev.mc.steamadvantage.init.TreasureChests; +import zone.moddev.mc.steamadvantage.init.Villages; +import zone.moddev.mc.steamadvantage.migration.SteamLegacyMigrations; +import zone.moddev.mc.steamadvantage.recipe.RecipeConditions; + +/** Forge 1.13 entry point for Steam Advantage. */ +@Mod(SteamAdvantage.MODID) +public final class SteamAdvantage { + public static final String MODID = "steamadvantage"; + public static final String NAME = "Steam Advantage"; + public static final String VERSION = "2.2.5.113021"; + public static final Logger LOGGER = LogManager.getLogger(MODID); + + public static float MUSKET_DAMAGE = 20.0F; + public static int MUSKET_RELOAD = 20 * 5; + public static boolean MUSKET_ENABLE = true; + public static final Map fluidBurnValues = new HashMap<>(); + + public SteamAdvantage() { + SteamLegacyMigrations.register(); + Blocks.init(); + Items.init(); + Entities.init(); + Enchantments.init(); + GUI.init(); + RecipeConditions.register(); + + migrateLegacyConfiguration(); + ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, SteamAdvantageConfig.SPEC); + FMLJavaModLoadingContext.get().getModEventBus().addListener(SteamAdvantageConfig::onConfigLoading); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonSetup); + + DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { + FMLJavaModLoadingContext.get().getModEventBus().addListener( + zone.moddev.mc.steamadvantage.graphics.ClientRegistration::onClientSetup); + }); + } + + private static void migrateLegacyConfiguration() { + try { + LegacyConfigMigration.Result result = LegacyConfigMigration.migrate(FMLPaths.CONFIGDIR.get(), MODID, + Mapping.of("options", "musket_damage", "options", "musketDamage", ValueType.DOUBLE), + Mapping.of("options", "musket_reload_time", "options", "musketReloadTime", ValueType.INTEGER), + Mapping.of("options", "musket_allowed", "options", "musketAllowed", ValueType.BOOLEAN), + Mapping.of("options", "fluid_fuel_values", "options", "fluidFuelValues", ValueType.STRING)); + if (result.wasMigrated()) { + LOGGER.info("Imported {} legacy Steam Advantage settings; report: {}", + result.getImportedValues(), result.getReportFile()); + } + } catch (IOException exception) { + LOGGER.error("Could not migrate legacy Steam Advantage configuration", exception); + } + } + + private void commonSetup(FMLCommonSetupEvent event) { + SteamAdvantageConfig.apply(); + Recipes.init(); + TreasureChests.init(FMLPaths.CONFIGDIR.get()); + Villages.init(); + LOGGER.info("Steam Advantage {} common setup complete", VERSION); + } +} diff --git a/src/main/java/zone/moddev/mc/steamadvantage/blocks/DrillBitBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/blocks/DrillBitBlock.java new file mode 100644 index 0000000..df8f4d0 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/blocks/DrillBitBlock.java @@ -0,0 +1,59 @@ +package zone.moddev.mc.steamadvantage.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.NonNullList; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; +import net.minecraft.item.ItemStack; +import zone.moddev.mc.steamadvantage.init.Power; + +/** Hidden moving drill helper. It deliberately has no item form or drops. */ +public class DrillBitBlock extends Block implements ITileEntityProvider { + private static final VoxelShape SHAPE = VoxelShapes.create(0.25D, 0.25D, 0.25D, 0.75D, 0.75D, 0.75D); + + public DrillBitBlock() { + super(Block.Properties.create(Material.IRON).hardnessAndResistance(5.0F, 2000.0F)); + } + + @Override public TileEntity createNewTileEntity(IBlockReader world) { return new DrillBitTileEntity(); } + @Override public VoxelShape getShape(IBlockState state, IBlockReader world, BlockPos pos) { return SHAPE; } + @Override public VoxelShape getCollisionShape(IBlockState state, IBlockReader world, BlockPos pos) { return SHAPE; } + @Override public boolean isNormalCube(IBlockState state) { return false; } + @Override public boolean isSolid(IBlockState state) { return false; } + @Override public void getDrops(IBlockState state, NonNullList drops, World world, BlockPos pos, int fortune) {} + + @Override + public void onEntityCollision(IBlockState state, World world, BlockPos pos, Entity victim) { + victim.attackEntityFrom(Power.machine_damage, 2.0F); + } + + @Override + public void onReplaced(IBlockState state, World world, BlockPos pos, IBlockState newState, boolean moving) { + if (state.getBlock() != newState.getBlock()) destroyNeighbors(world, pos); + super.onReplaced(state, world, pos, newState, moving); + } + + @Override + public void onExplosionDestroy(World world, BlockPos pos, Explosion explosion) { + destroyNeighbors(world, pos); + super.onExplosionDestroy(world, pos, explosion); + } + + private void destroyNeighbors(World world, BlockPos pos) { + if (world.isRemote) return; + for (EnumFacing side : EnumFacing.values()) { + TileEntity tile = world.getTileEntity(pos.offset(side)); + if (tile instanceof DrillBitTileEntity) ((DrillBitTileEntity) tile).destroyLine(); + } + } +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/blocks/DrillBitTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/blocks/DrillBitTileEntity.java similarity index 81% rename from src/main/java/com/mcmoddev/steamadvantage/blocks/DrillBitTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/blocks/DrillBitTileEntity.java index 0bbec90..1430ad4 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/blocks/DrillBitTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/blocks/DrillBitTileEntity.java @@ -1,6 +1,6 @@ -package com.mcmoddev.steamadvantage.blocks; +package zone.moddev.mc.steamadvantage.blocks; -import com.mcmoddev.steamadvantage.init.Blocks; +import zone.moddev.mc.steamadvantage.init.Blocks; import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; @@ -18,13 +18,13 @@ public class DrillBitTileEntity extends TileEntity implements ITickable{ private EnumFacing direction = EnumFacing.DOWN; public DrillBitTileEntity(){ - super(); + super(zone.moddev.mc.steamadvantage.init.Entities.DRILLBIT); } @Override - public void update(){ + public void tick(){ if(getWorld().isRemote){ - rotation = ROTATION_PER_TICK * (getWorld().getTotalWorldTime() % 20); + rotation = ROTATION_PER_TICK * (getWorld().getGameTime() % 20); } } public void setDirection(EnumFacing dir){ @@ -38,7 +38,7 @@ public EnumFacing.Axis getDirection(){ } public static void createDrillBitBlock(World w, BlockPos coord, EnumFacing dir){ - w.setBlockState(coord, com.mcmoddev.steamadvantage.init.Blocks.drillbit.getDefaultState()); + w.setBlockState(coord, zone.moddev.mc.steamadvantage.init.Blocks.drillbit.getDefaultState()); DrillBitTileEntity te = new DrillBitTileEntity(); te.direction = dir; w.setTileEntity(coord, te); @@ -50,7 +50,7 @@ public static void createDrillBitBlock(World w, BlockPos coord, EnumFacing dir){ public void destroyLine(){ this.destroy(this.direction); this.destroy(this.direction.getOpposite()); - getWorld().setBlockToAir(getPos()); // redundant because this is being called on block destruction + getWorld().removeBlock(getPos()); // redundant because this is being called on block destruction } /** * destroys upstream drillbit @@ -58,28 +58,28 @@ public void destroyLine(){ private void destroy(EnumFacing f){ BlockPos coord = this.getPos().offset(f); while(getWorld().getBlockState(coord).getBlock() == Blocks.drillbit){ - getWorld().setBlockToAir(coord); + getWorld().removeBlock(coord); coord = coord.offset(f); } } @Override - public NBTTagCompound writeToNBT(NBTTagCompound root){ - super.writeToNBT(root); + public NBTTagCompound write(NBTTagCompound root){ + super.write(root); writeDirectionToNBT(root); return root; } @Override - public void readFromNBT(NBTTagCompound root){ - super.readFromNBT(root); + public void read(NBTTagCompound root){ + super.read(root); readDirectionFromNBT(root); } @Override public NBTTagCompound getUpdateTag() { - return writeToNBT(new NBTTagCompound()); + return write(new NBTTagCompound()); } /** diff --git a/src/main/java/zone/moddev/mc/steamadvantage/blocks/PlatformBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/blocks/PlatformBlock.java new file mode 100644 index 0000000..990ecc3 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/blocks/PlatformBlock.java @@ -0,0 +1,49 @@ +package zone.moddev.mc.steamadvantage.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.state.IntegerProperty; +import net.minecraft.state.StateContainer; +import net.minecraft.util.NonNullList; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; +import zone.moddev.mc.steamadvantage.init.Blocks; + +/** Hidden elevator platform segments. HEIGHT preserves the legacy metadata values 0-4. */ +public class PlatformBlock extends Block { + public static final IntegerProperty HEIGHT = IntegerProperty.create("height", 0, 4); + private static final VoxelShape[] SHAPES = new VoxelShape[] { + VoxelShapes.create(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D), + VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D), + VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, 0.50D, 1.0D), + VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D), + VoxelShapes.fullCube() + }; + + public PlatformBlock() { + super(Block.Properties.create(Material.IRON).hardnessAndResistance(5.0F, 2000.0F)); + setDefaultState(getStateContainer().getBaseState().with(HEIGHT, 1)); + } + + @Override protected void fillStateContainer(StateContainer.Builder builder) { builder.add(HEIGHT); } + @Override public VoxelShape getShape(IBlockState state, IBlockReader world, BlockPos pos) { return SHAPES[state.get(HEIGHT)]; } + @Override public VoxelShape getCollisionShape(IBlockState state, IBlockReader world, BlockPos pos) { return SHAPES[state.get(HEIGHT)]; } + @Override public boolean isNormalCube(IBlockState state) { return false; } + @Override public boolean isSolid(IBlockState state) { return false; } + @Override public void getDrops(IBlockState state, NonNullList drops, World world, BlockPos pos, int fortune) {} + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) { + if (!canBlockStay(world, pos)) world.destroyBlock(pos, true); + } + + public boolean canBlockStay(World world, BlockPos pos) { + Block below = world.getBlockState(pos.down()).getBlock(); + return below == this || below == Blocks.steam_elevator_platform || below == Blocks.steam_elevator; + } +} diff --git a/src/main/java/zone/moddev/mc/steamadvantage/blocks/PumpPipeBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/blocks/PumpPipeBlock.java new file mode 100644 index 0000000..ccdeb58 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/blocks/PumpPipeBlock.java @@ -0,0 +1,49 @@ +package zone.moddev.mc.steamadvantage.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; + +/** Hidden pipe shaft placed beneath a steam pump. */ +public class PumpPipeBlock extends Block { + private static final VoxelShape SHAPE = VoxelShapes.create(0.0D, 0.25D, 0.0D, 0.75D, 1.0D, 1.0D); + + public PumpPipeBlock() { + super(Block.Properties.create(Material.IRON).hardnessAndResistance(5.0F, 10.0F)); + } + + @Override public VoxelShape getShape(IBlockState state, IBlockReader world, BlockPos pos) { return SHAPE; } + @Override public VoxelShape getCollisionShape(IBlockState state, IBlockReader world, BlockPos pos) { return SHAPE; } + @Override public boolean isNormalCube(IBlockState state) { return false; } + @Override public boolean isSolid(IBlockState state) { return false; } + @Override public void getDrops(IBlockState state, NonNullList drops, World world, BlockPos pos, int fortune) {} + + @Override + public void onReplaced(IBlockState state, World world, BlockPos pos, IBlockState newState, boolean moving) { + if (state.getBlock() != newState.getBlock()) destroyShaft(world, pos); + super.onReplaced(state, world, pos, newState, moving); + } + + @Override + public void onExplosionDestroy(World world, BlockPos pos, Explosion explosion) { + destroyShaft(world, pos); + super.onExplosionDestroy(world, pos, explosion); + } + + private void destroyShaft(World world, BlockPos pos) { + if (world.isRemote) return; + BlockPos cursor = pos.down(); + while (cursor.getY() > 0 && world.getBlockState(cursor).getBlock() == this) { + world.destroyBlock(cursor, false); + cursor = cursor.down(); + } + } +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/blocks/SteamPipeBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/blocks/SteamPipeBlock.java similarity index 71% rename from src/main/java/com/mcmoddev/steamadvantage/blocks/SteamPipeBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/blocks/SteamPipeBlock.java index 8ab37d6..1926307 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/blocks/SteamPipeBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/blocks/SteamPipeBlock.java @@ -1,6 +1,6 @@ -package com.mcmoddev.steamadvantage.blocks; +package zone.moddev.mc.steamadvantage.blocks; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; public class SteamPipeBlock extends cyano.poweradvantage.api.simple.BlockSimplePowerConduit{ diff --git a/src/main/java/zone/moddev/mc/steamadvantage/blocks/SteamTrackBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/blocks/SteamTrackBlock.java new file mode 100644 index 0000000..529a90c --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/blocks/SteamTrackBlock.java @@ -0,0 +1,22 @@ +package zone.moddev.mc.steamadvantage.blocks; + +import cyano.poweradvantage.api.simple.BlockSimplePowerConduit; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.world.IBlockReader; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import zone.moddev.mc.steamadvantage.init.Power; + +public class SteamTrackBlock extends BlockSimplePowerConduit { + public SteamTrackBlock() { super(Material.PISTON, 0.75F, 2.0F / 16.0F, Power.steam_power); } + @Override public VoxelShape getShape(IBlockState state, IBlockReader world, BlockPos pos) { return VoxelShapes.fullCube(); } + @Override public VoxelShape getCollisionShape(IBlockState state, IBlockReader world, BlockPos pos) { return VoxelShapes.fullCube(); } + @Override public boolean isNormalCube(IBlockState state) { return false; } + @Override public boolean isSolid(IBlockState state) { return false; } + @OnlyIn(Dist.CLIENT) @Override public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT; } +} diff --git a/src/main/java/zone/moddev/mc/steamadvantage/compat/BaseMetalsCompat.java b/src/main/java/zone/moddev/mc/steamadvantage/compat/BaseMetalsCompat.java new file mode 100644 index 0000000..a750a77 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/compat/BaseMetalsCompat.java @@ -0,0 +1,61 @@ +package zone.moddev.mc.steamadvantage.compat; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.world.World; +import net.minecraftforge.fml.ModList; +import zone.moddev.mc.basemetals.recipe.CrushingRecipe; + +/** Accesses Base Metals' data-driven 1.13 crushing recipes without embedding it. */ +public final class BaseMetalsCompat { + private BaseMetalsCompat() {} + + public static boolean isLoaded() { return ModList.get().isLoaded("basemetals"); } + + /** 1.13 additions are supplied as JSON crushing recipes, not mutable runtime registrations. */ + public static void addCrusherRecipe(String input, ItemStack output) {} + public static void addCrusherRecipe(Item input, ItemStack output) {} + public static void addCrusherRecipe(Block input, ItemStack output) {} + + public static boolean hasCrusherRecipe(World world, ItemStack input) { + return getCrusherRecipeOutput(world, input) != null; + } + + public static ItemStack getCrusherRecipeOutput(World world, ItemStack input) { + if (world == null || input == null || input.isEmpty()) return null; + if (isLoaded()) { + InventoryBasic inventory = new InventoryBasic(new TextComponentString("steam crusher"), 1); + inventory.setInventorySlotContents(0, input.copy()); + for (IRecipe candidate : world.getRecipeManager().getRecipes()) { + if (candidate instanceof CrushingRecipe && candidate.matches(inventory, world)) { + return candidate.getRecipeOutput().copy(); + } + } + } + return getVanillaCrusherOutput(input); + } + + public static ItemStack getCrusherRecipeOutput(World world, IBlockState input) { + return input == null ? null : getCrusherRecipeOutput(world, new ItemStack(input.getBlock())); + } + + private static ItemStack getVanillaCrusherOutput(ItemStack input) { + Item item = input.getItem(); + if (item == net.minecraft.init.Blocks.STONE.asItem()) return new ItemStack(net.minecraft.init.Blocks.COBBLESTONE); + if (item == net.minecraft.init.Blocks.COBBLESTONE.asItem()) return new ItemStack(net.minecraft.init.Blocks.GRAVEL); + if (item == net.minecraft.init.Blocks.GRAVEL.asItem()) return new ItemStack(net.minecraft.init.Blocks.SAND); + if (item == net.minecraft.init.Blocks.SANDSTONE.asItem()) return new ItemStack(net.minecraft.init.Blocks.SAND, 4); + if (item == net.minecraft.init.Blocks.RED_SANDSTONE.asItem()) return new ItemStack(net.minecraft.init.Blocks.RED_SAND, 4); + if (item == net.minecraft.init.Blocks.GLASS.asItem()) return new ItemStack(net.minecraft.init.Blocks.SAND); + if (item == net.minecraft.init.Blocks.GLOWSTONE.asItem()) return new ItemStack(net.minecraft.init.Items.GLOWSTONE_DUST, 4); + if (item == net.minecraft.init.Blocks.SUGAR_CANE.asItem()) return new ItemStack(net.minecraft.init.Items.SUGAR, 2); + if (item == net.minecraft.init.Items.BONE) return new ItemStack(net.minecraft.init.Items.BONE_MEAL, 3); + if (item == net.minecraft.init.Items.BLAZE_ROD) return new ItemStack(net.minecraft.init.Items.BLAZE_POWDER, 2); + return null; + } +} diff --git a/src/main/java/zone/moddev/mc/steamadvantage/config/SteamAdvantageConfig.java b/src/main/java/zone/moddev/mc/steamadvantage/config/SteamAdvantageConfig.java new file mode 100644 index 0000000..12340a7 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/config/SteamAdvantageConfig.java @@ -0,0 +1,54 @@ +package zone.moddev.mc.steamadvantage.config; + +import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.fml.config.ModConfig; +import zone.moddev.mc.steamadvantage.SteamAdvantage; + +/** Common configuration retaining the legacy gameplay defaults. */ +public final class SteamAdvantageConfig { + public static final ForgeConfigSpec SPEC; + public static final ForgeConfigSpec.DoubleValue MUSKET_DAMAGE; + public static final ForgeConfigSpec.IntValue MUSKET_RELOAD; + public static final ForgeConfigSpec.BooleanValue MUSKET_ALLOWED; + public static final ForgeConfigSpec.ConfigValue FLUID_FUEL_VALUES; + + private static boolean loaded; + + static { + ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); + builder.push("options"); + MUSKET_DAMAGE = builder.defineInRange("musketDamage", 20.0D, 0.0D, 100.0D); + MUSKET_RELOAD = builder.defineInRange("musketReloadTime", 100, 20, 300); + MUSKET_ALLOWED = builder.define("musketAllowed", true); + FLUID_FUEL_VALUES = builder.comment( + "Semi-colon delimited fluid registry names and burn ticks per bucket, for example oil=5000.") + .define("fluidFuelValues", "oil=5000;fuel=25000"); + builder.pop(); + SPEC = builder.build(); + } + + private SteamAdvantageConfig() {} + + public static void onConfigLoading(ModConfig.Loading event) { + if (event.getConfig().getSpec() != SPEC) return; + loaded = true; + apply(); + } + + public static void apply() { + if (!loaded) return; + SteamAdvantage.MUSKET_DAMAGE = MUSKET_DAMAGE.get().floatValue(); + SteamAdvantage.MUSKET_RELOAD = MUSKET_RELOAD.get(); + SteamAdvantage.MUSKET_ENABLE = MUSKET_ALLOWED.get(); + SteamAdvantage.fluidBurnValues.clear(); + for (String descriptor : FLUID_FUEL_VALUES.get().split(";")) { + String[] parts = descriptor.split("=", 2); + if (parts.length != 2) continue; + try { + SteamAdvantage.fluidBurnValues.put(parts[0].trim(), Float.parseFloat(parts[1].trim())); + } catch (NumberFormatException ex) { + SteamAdvantage.LOGGER.warn("Ignoring invalid fluid fuel descriptor '{}'", descriptor); + } + } + } +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/enchantments/HighExplosiveEnchantment.java b/src/main/java/zone/moddev/mc/steamadvantage/enchantments/HighExplosiveEnchantment.java similarity index 86% rename from src/main/java/com/mcmoddev/steamadvantage/enchantments/HighExplosiveEnchantment.java rename to src/main/java/zone/moddev/mc/steamadvantage/enchantments/HighExplosiveEnchantment.java index 83980a8..2c42de6 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/enchantments/HighExplosiveEnchantment.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/enchantments/HighExplosiveEnchantment.java @@ -1,6 +1,6 @@ -package com.mcmoddev.steamadvantage.enchantments; +package zone.moddev.mc.steamadvantage.enchantments; -import com.mcmoddev.steamadvantage.init.Items; +import zone.moddev.mc.steamadvantage.init.Items; import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; @@ -9,7 +9,6 @@ public class HighExplosiveEnchantment extends net.minecraft.enchantment.Enchantm public HighExplosiveEnchantment() { super(Rarity.UNCOMMON,EnumEnchantmentType.ALL,new EntityEquipmentSlot[]{EntityEquipmentSlot.MAINHAND}); - this.setName("high_explosive"); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/enchantments/PowderlessEnchantment.java b/src/main/java/zone/moddev/mc/steamadvantage/enchantments/PowderlessEnchantment.java similarity index 86% rename from src/main/java/com/mcmoddev/steamadvantage/enchantments/PowderlessEnchantment.java rename to src/main/java/zone/moddev/mc/steamadvantage/enchantments/PowderlessEnchantment.java index 7729f81..8abc052 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/enchantments/PowderlessEnchantment.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/enchantments/PowderlessEnchantment.java @@ -1,6 +1,6 @@ -package com.mcmoddev.steamadvantage.enchantments; +package zone.moddev.mc.steamadvantage.enchantments; -import com.mcmoddev.steamadvantage.init.Items; +import zone.moddev.mc.steamadvantage.init.Items; import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; @@ -9,7 +9,6 @@ public class PowderlessEnchantment extends net.minecraft.enchantment.Enchantment public PowderlessEnchantment() { super(Rarity.VERY_RARE,EnumEnchantmentType.ALL,new EntityEquipmentSlot[]{EntityEquipmentSlot.MAINHAND}); - this.setName("powderless"); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/enchantments/RapidReloadEnchantment.java b/src/main/java/zone/moddev/mc/steamadvantage/enchantments/RapidReloadEnchantment.java similarity index 86% rename from src/main/java/com/mcmoddev/steamadvantage/enchantments/RapidReloadEnchantment.java rename to src/main/java/zone/moddev/mc/steamadvantage/enchantments/RapidReloadEnchantment.java index fa8d759..fc101a8 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/enchantments/RapidReloadEnchantment.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/enchantments/RapidReloadEnchantment.java @@ -1,6 +1,6 @@ -package com.mcmoddev.steamadvantage.enchantments; +package zone.moddev.mc.steamadvantage.enchantments; -import com.mcmoddev.steamadvantage.init.Items; +import zone.moddev.mc.steamadvantage.init.Items; import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; @@ -9,7 +9,6 @@ public class RapidReloadEnchantment extends net.minecraft.enchantment.Enchantmen public RapidReloadEnchantment() { super(Rarity.RARE,EnumEnchantmentType.ALL,new EntityEquipmentSlot[]{EntityEquipmentSlot.MAINHAND}); - this.setName("rapid_reload"); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/enchantments/RecoilEnchantment.java b/src/main/java/zone/moddev/mc/steamadvantage/enchantments/RecoilEnchantment.java similarity index 87% rename from src/main/java/com/mcmoddev/steamadvantage/enchantments/RecoilEnchantment.java rename to src/main/java/zone/moddev/mc/steamadvantage/enchantments/RecoilEnchantment.java index 57bcca1..1c6cc62 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/enchantments/RecoilEnchantment.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/enchantments/RecoilEnchantment.java @@ -1,6 +1,6 @@ -package com.mcmoddev.steamadvantage.enchantments; +package zone.moddev.mc.steamadvantage.enchantments; -import com.mcmoddev.steamadvantage.init.Items; +import zone.moddev.mc.steamadvantage.init.Items; import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; @@ -9,7 +9,6 @@ public class RecoilEnchantment extends net.minecraft.enchantment.Enchantment{ public RecoilEnchantment() { super(Rarity.COMMON,EnumEnchantmentType.ALL,new EntityEquipmentSlot[]{EntityEquipmentSlot.MAINHAND}); - this.setName("recoil"); } diff --git a/src/main/java/zone/moddev/mc/steamadvantage/graphics/ClientRegistration.java b/src/main/java/zone/moddev/mc/steamadvantage/graphics/ClientRegistration.java new file mode 100644 index 0000000..2ac4591 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/graphics/ClientRegistration.java @@ -0,0 +1,14 @@ +package zone.moddev.mc.steamadvantage.graphics; + +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import zone.moddev.mc.steamadvantage.blocks.DrillBitTileEntity; + +/** Client-only renderer registration. */ +public final class ClientRegistration { + private ClientRegistration() {} + + public static void onClientSetup(FMLClientSetupEvent event) { + ClientRegistry.bindTileEntitySpecialRenderer(DrillBitTileEntity.class, new DrillBitRenderer()); + } +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/graphics/DrillBitRenderer.java b/src/main/java/zone/moddev/mc/steamadvantage/graphics/DrillBitRenderer.java similarity index 74% rename from src/main/java/com/mcmoddev/steamadvantage/graphics/DrillBitRenderer.java rename to src/main/java/zone/moddev/mc/steamadvantage/graphics/DrillBitRenderer.java index 96dd057..448f8ce 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/graphics/DrillBitRenderer.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/graphics/DrillBitRenderer.java @@ -1,52 +1,45 @@ -package com.mcmoddev.steamadvantage.graphics; +package zone.moddev.mc.steamadvantage.graphics; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.blocks.DrillBitTileEntity; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.blocks.DrillBitTileEntity; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +@OnlyIn(Dist.CLIENT) // This is needed for classes that extend client-only classes +public class DrillBitRenderer extends TileEntityRenderer{ -@SideOnly(Side.CLIENT) // This is needed for classes that extend client-only classes -public class DrillBitRenderer extends TileEntitySpecialRenderer{ - private final ResourceLocation texture = new ResourceLocation(SteamAdvantage.MODID+":textures/entity/drill_bit.png"); public DrillBitRenderer() { - super(); } - + @Override - public void render(final TileEntity te, final double x, final double y, final double z, final float partialTick, final int destroyStage, final float alpha) { - if(te instanceof DrillBitTileEntity){ - // partialTick is guaranteed to range from 0 to 1 - GlStateManager.pushMatrix(); - GlStateManager.translate((float)x, (float)y, (float)z); - - render((DrillBitTileEntity)te,te.getWorld(),te.getPos(),partialTick); - - GlStateManager.popMatrix(); - } + public void render(final DrillBitTileEntity te, final double x, final double y, final double z, final float partialTick, final int destroyStage) { + GlStateManager.pushMatrix(); + GlStateManager.translated(x, y, z); + render(te,te.getWorld(),te.getPos(),partialTick); + GlStateManager.popMatrix(); } - + private void render(DrillBitTileEntity e, World world, BlockPos pos, float partialTick){ final Tessellator instance = Tessellator.getInstance(); final BufferBuilder worldRenderer = instance.getBuffer(); - + this.bindTexture(texture); - + //This will make your block brightness dependent from surroundings lighting. RenderHelper.disableStandardItemLighting(); GlStateManager.blendFunc(770, 771); @@ -61,7 +54,7 @@ private void render(DrillBitTileEntity e, World world, BlockPos pos, float parti { GlStateManager.shadeModel(7424); } - + final float sideU0 = 0; final float sideU1 = 0.5f; final float sideV0 = 0; @@ -72,14 +65,14 @@ private void render(DrillBitTileEntity e, World world, BlockPos pos, float parti final float endV1 = 0.5f; final float radius = 0.25f; - GlStateManager.translate(0.5f, 0.5f, 0.5f); + GlStateManager.translatef(0.5f, 0.5f, 0.5f); if(e.getDirection() != EnumFacing.Axis.Y){ - GlStateManager.rotate(90, 1.0f, 0.0f, 0.0f); + GlStateManager.rotatef(90, 1.0f, 0.0f, 0.0f); if(e.getDirection() != EnumFacing.Axis.Z){ - GlStateManager.rotate(90, 0.0f, 0.0f, 1.0f); + GlStateManager.rotatef(90, 0.0f, 0.0f, 1.0f); } } - GlStateManager.rotate(e.rotation + DrillBitTileEntity.ROTATION_PER_TICK * partialTick, 0.0f, 1.0f, 0.0f); + GlStateManager.rotatef(e.rotation + DrillBitTileEntity.ROTATION_PER_TICK * partialTick, 0.0f, 1.0f, 0.0f); worldRenderer.begin(7, DefaultVertexFormats.POSITION_TEX); worldRenderer.pos( radius, 0.5f, -radius).tex( sideU0, sideV0).endVertex(); @@ -111,11 +104,11 @@ private void render(DrillBitTileEntity e, World world, BlockPos pos, float parti worldRenderer.pos(-radius,-0.5f, -radius).tex( endU0, endV1).endVertex(); worldRenderer.pos( radius,-0.5f, -radius).tex( endU1, endV1).endVertex(); worldRenderer.pos( radius,-0.5f, radius).tex( endU1, endV0).endVertex(); - + instance.draw(); RenderHelper.enableStandardItemLighting(); - + } - + } diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/BlastFurnaceGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/BlastFurnaceGUI.java similarity index 91% rename from src/main/java/com/mcmoddev/steamadvantage/gui/BlastFurnaceGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/BlastFurnaceGUI.java index eeab1b5..82a16de 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/BlastFurnaceGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/BlastFurnaceGUI.java @@ -1,13 +1,13 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.BlastFurnaceTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.BlastFurnaceTileEntity; public class BlastFurnaceGUI extends SimpleMachineGUI{ @@ -46,7 +46,7 @@ public ItemStack onTake(EntityPlayer player, ItemStack stack) * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/CoalBoilerGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/CoalBoilerGUI.java similarity index 89% rename from src/main/java/com/mcmoddev/steamadvantage/gui/CoalBoilerGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/CoalBoilerGUI.java index c890223..84b5c74 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/CoalBoilerGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/CoalBoilerGUI.java @@ -1,10 +1,10 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import net.minecraft.util.ResourceLocation; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.CoalBoilerTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.CoalBoilerTileEntity; public class CoalBoilerGUI extends SimpleMachineGUI{ @@ -33,7 +33,7 @@ public CoalBoilerGUI() { * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/ElectricBoilerGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/ElectricBoilerGUI.java similarity index 89% rename from src/main/java/com/mcmoddev/steamadvantage/gui/ElectricBoilerGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/ElectricBoilerGUI.java index 32b9768..2affaf7 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/ElectricBoilerGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/ElectricBoilerGUI.java @@ -1,10 +1,10 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import net.minecraft.util.ResourceLocation; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.ElectricBoilerTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.ElectricBoilerTileEntity; public class ElectricBoilerGUI extends SimpleMachineGUI{ @@ -33,7 +33,7 @@ public ElectricBoilerGUI() { * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/GUIHelper.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/GUIHelper.java similarity index 94% rename from src/main/java/com/mcmoddev/steamadvantage/gui/GUIHelper.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/GUIHelper.java index c1b824f..697f3d3 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/GUIHelper.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/GUIHelper.java @@ -1,13 +1,13 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import cyano.poweradvantage.api.simple.SimpleMachineGUI.GUIContainer; -import com.mcmoddev.poweradvantage.gui.FluidTankGUI; +import zone.moddev.mc.poweradvantage.gui.FluidTankGUI; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; -import net.minecraftforge.fluids.FluidStack; +import cyano.poweradvantage.api.fluid.FluidStack; public abstract class GUIHelper { @@ -107,7 +107,7 @@ public static void drawFluidBar(FluidStack fs, float barHeight, int xPos, int yP if(barHeight > 0){ FluidTankGUI.drawFluidFilledRectangle(guiContainer,fs,x+xPos, y+yPos+barSlotHeight-h,w, h,z); } - guiContainer.mc.renderEngine.bindTexture(displayImage); + guiContainer.mc.getTextureManager().bindTexture(displayImage); guiContainer.drawTexturedModalRect(x+xPos-texMarginW, y+yPos-texMarginH, texOverlayX, texOverlayY, texOverlayW, texOverlayH); // x, y, textureOffsetX, textureOffsetY, width, height) } diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/GeothermalBoilerGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/GeothermalBoilerGUI.java similarity index 89% rename from src/main/java/com/mcmoddev/steamadvantage/gui/GeothermalBoilerGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/GeothermalBoilerGUI.java index 2c923bb..dfaf4de 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/GeothermalBoilerGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/GeothermalBoilerGUI.java @@ -1,10 +1,10 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import net.minecraft.util.ResourceLocation; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.GeothermalBoilerTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.GeothermalBoilerTileEntity; public class GeothermalBoilerGUI extends SimpleMachineGUI{ @@ -33,7 +33,7 @@ public GeothermalBoilerGUI() { * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/OilBoilerGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/OilBoilerGUI.java similarity index 88% rename from src/main/java/com/mcmoddev/steamadvantage/gui/OilBoilerGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/OilBoilerGUI.java index 0d6d54d..7ab9de3 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/OilBoilerGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/OilBoilerGUI.java @@ -1,11 +1,11 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.OilBoilerTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.OilBoilerTileEntity; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; +import cyano.poweradvantage.api.fluid.FluidStack; public class OilBoilerGUI extends SimpleMachineGUI{ @@ -33,7 +33,7 @@ public OilBoilerGUI() { * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/RockCrusherGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/RockCrusherGUI.java similarity index 88% rename from src/main/java/com/mcmoddev/steamadvantage/gui/RockCrusherGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/RockCrusherGUI.java index 8ee786a..64c72b2 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/RockCrusherGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/RockCrusherGUI.java @@ -1,10 +1,10 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import net.minecraft.util.ResourceLocation; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.RockCrusherTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.RockCrusherTileEntity; public class RockCrusherGUI extends SimpleMachineGUI{ @@ -32,7 +32,7 @@ public RockCrusherGUI() { * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/SteamDrillGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/SteamDrillGUI.java similarity index 88% rename from src/main/java/com/mcmoddev/steamadvantage/gui/SteamDrillGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/SteamDrillGUI.java index 2b26f6b..41a9727 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/SteamDrillGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/SteamDrillGUI.java @@ -1,10 +1,10 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import net.minecraft.util.ResourceLocation; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.SteamDrillTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.SteamDrillTileEntity; public class SteamDrillGUI extends SimpleMachineGUI{ @@ -32,7 +32,7 @@ public SteamDrillGUI() { * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/SteamPumpGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/SteamPumpGUI.java similarity index 87% rename from src/main/java/com/mcmoddev/steamadvantage/gui/SteamPumpGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/SteamPumpGUI.java index dbe2e34..69ac50f 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/SteamPumpGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/SteamPumpGUI.java @@ -1,11 +1,11 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.SteamPumpTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.SteamPumpTileEntity; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; +import cyano.poweradvantage.api.fluid.FluidStack; public class SteamPumpGUI extends SimpleMachineGUI{ @@ -33,7 +33,7 @@ public SteamPumpGUI() { * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/SteamStillGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/SteamStillGUI.java similarity index 88% rename from src/main/java/com/mcmoddev/steamadvantage/gui/SteamStillGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/SteamStillGUI.java index 1097066..fb5bd8c 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/SteamStillGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/SteamStillGUI.java @@ -1,11 +1,11 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.SteamStillTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.SteamStillTileEntity; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; +import cyano.poweradvantage.api.fluid.FluidStack; public class SteamStillGUI extends SimpleMachineGUI{ @@ -33,7 +33,7 @@ public SteamStillGUI() { * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/com/mcmoddev/steamadvantage/gui/SteamTankGUI.java b/src/main/java/zone/moddev/mc/steamadvantage/gui/SteamTankGUI.java similarity index 87% rename from src/main/java/com/mcmoddev/steamadvantage/gui/SteamTankGUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/gui/SteamTankGUI.java index 77c56e7..69e9cdc 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/gui/SteamTankGUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/gui/SteamTankGUI.java @@ -1,10 +1,10 @@ -package com.mcmoddev.steamadvantage.gui; +package zone.moddev.mc.steamadvantage.gui; import net.minecraft.util.ResourceLocation; import cyano.poweradvantage.api.simple.SimpleMachineGUI; -import com.mcmoddev.poweradvantage.math.Integer2D; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.machines.SteamTankTileEntity; +import zone.moddev.mc.poweradvantage.math.Integer2D; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.machines.SteamTankTileEntity; public class SteamTankGUI extends SimpleMachineGUI{ @@ -32,7 +32,7 @@ public SteamTankGUI() { * @param guiContainer This is the instance of GUIContainer that is drawing * the GUI. You need to use it to draw on the screen. For example:
-guiContainer.mc.renderEngine.bindTexture(arrowTexture);
+guiContainer.mc.getTextureManager().bindTexture(arrowTexture);
 guiContainer.drawTexturedModalRect(x+79, y+35, 0, 0, arrowLength, 17); // x, y, textureOffsetX, textureOffsetY, width, height)
 	   
* @param x This is the x coordinate (in pixels) from the top-left corner of diff --git a/src/main/java/zone/moddev/mc/steamadvantage/init/Blocks.java b/src/main/java/zone/moddev/mc/steamadvantage/init/Blocks.java new file mode 100644 index 0000000..f2ce5f9 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/init/Blocks.java @@ -0,0 +1,112 @@ +package zone.moddev.mc.steamadvantage.init; + +import java.util.LinkedHashMap; +import java.util.Map; + +import cyano.poweradvantage.api.GUIBlock; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import zone.moddev.mc.poweradvantage.blocks.BlockPowerSwitch; +import zone.moddev.mc.poweradvantage.init.ItemGroups; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.blocks.DrillBitBlock; +import zone.moddev.mc.steamadvantage.blocks.PlatformBlock; +import zone.moddev.mc.steamadvantage.blocks.PumpPipeBlock; +import zone.moddev.mc.steamadvantage.blocks.SteamPipeBlock; +import zone.moddev.mc.steamadvantage.blocks.SteamTrackBlock; +import zone.moddev.mc.steamadvantage.machines.BlastFurnaceBlock; +import zone.moddev.mc.steamadvantage.machines.CoalBoilerBlock; +import zone.moddev.mc.steamadvantage.machines.ElectricBoilerBlock; +import zone.moddev.mc.steamadvantage.machines.GeothermalBoilerBlock; +import zone.moddev.mc.steamadvantage.machines.OilBoilerBlock; +import zone.moddev.mc.steamadvantage.machines.RockCrusherBlock; +import zone.moddev.mc.steamadvantage.machines.SteamDrillBlock; +import zone.moddev.mc.steamadvantage.machines.SteamElevatorBlock; +import zone.moddev.mc.steamadvantage.machines.SteamPumpBlock; +import zone.moddev.mc.steamadvantage.machines.SteamStillBlock; +import zone.moddev.mc.steamadvantage.machines.SteamTankBlock; + +@Mod.EventBusSubscriber(modid = SteamAdvantage.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) +public final class Blocks { + private static final Map ALL_BLOCKS = new LinkedHashMap<>(); + + public static GUIBlock steam_boiler_coal; + public static GUIBlock steam_boiler_electric; + public static GUIBlock steam_boiler_geothermal; + public static GUIBlock steam_crusher; + public static GUIBlock steam_furnace; + public static GUIBlock steam_tank; + public static GUIBlock steam_drill; + public static GUIBlock steam_elevator; + public static Block steam_elevator_platform; + public static IBlockState[] steam_elevator_platforms; + public static Block steam_pipe; + public static Block drillbit; + public static Block steam_track; + public static Block pump_pipe_steam; + public static Block steam_switch; + public static GUIBlock steam_still; + public static GUIBlock steam_pump; + public static GUIBlock steam_boiler_oil; + + private static boolean initialized; + private Blocks() {} + + public static synchronized void init() { + if (initialized) return; + ItemGroups.init(); + steam_pipe = add(new SteamPipeBlock(), "steam_pipe"); + steam_track = add(new SteamTrackBlock(), "steam_track"); + steam_boiler_coal = (GUIBlock) add(new CoalBoilerBlock(), "steam_boiler_coal"); + steam_boiler_electric = (GUIBlock) add(new ElectricBoilerBlock(), "steam_boiler_electric"); + steam_boiler_geothermal = (GUIBlock) add(new GeothermalBoilerBlock(), "steam_boiler_geothermal"); + steam_tank = (GUIBlock) add(new SteamTankBlock(), "steam_tank"); + steam_furnace = (GUIBlock) add(new BlastFurnaceBlock(), "steam_furnace"); + steam_crusher = (GUIBlock) add(new RockCrusherBlock(), "steam_crusher"); + steam_drill = (GUIBlock) add(new SteamDrillBlock(), "steam_drill"); + drillbit = add(new DrillBitBlock(), "drillbit"); + steam_elevator_platform = add(new PlatformBlock(), "platform"); + steam_elevator_platforms = new IBlockState[5]; + for (int i = 0; i < steam_elevator_platforms.length; i++) { + steam_elevator_platforms[i] = steam_elevator_platform.getDefaultState().with(PlatformBlock.HEIGHT, i); + } + steam_elevator = (GUIBlock) add(new SteamElevatorBlock(), "steam_elevator"); + steam_switch = add(new BlockPowerSwitch(Power.steam_power), "steam_switch"); + pump_pipe_steam = add(new PumpPipeBlock(), "pump_pipe_steam"); + steam_still = (GUIBlock) add(new SteamStillBlock(), "steam_still"); + steam_pump = (GUIBlock) add(new SteamPumpBlock(), "steam_pump"); + steam_boiler_oil = (GUIBlock) add(new OilBoilerBlock(), "steam_boiler_oil"); + initialized = true; + } + + private static Block add(Block block, String id) { + block.setRegistryName(SteamAdvantage.MODID, id); + ALL_BLOCKS.put(id, block); + return block; + } + + @SubscribeEvent + public static void registerBlocks(RegistryEvent.Register event) { + init(); + event.getRegistry().registerAll(ALL_BLOCKS.values().toArray(new Block[0])); + } + + @SubscribeEvent + public static void registerBlockItems(RegistryEvent.Register event) { + init(); + for (Map.Entry entry : ALL_BLOCKS.entrySet()) { + Item.Properties properties = new Item.Properties(); + if (!"pump_pipe_steam".equals(entry.getKey()) && !"drillbit".equals(entry.getKey())) { + properties.group(ItemGroups.tab_powerAdvantage); + } + ItemBlock item = new ItemBlock(entry.getValue(), properties); + item.setRegistryName(SteamAdvantage.MODID, entry.getKey()); + event.getRegistry().register(item); + } + } +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/init/Enchantments.java b/src/main/java/zone/moddev/mc/steamadvantage/init/Enchantments.java similarity index 70% rename from src/main/java/com/mcmoddev/steamadvantage/init/Enchantments.java rename to src/main/java/zone/moddev/mc/steamadvantage/init/Enchantments.java index 2dfb059..98c3a9e 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/init/Enchantments.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/init/Enchantments.java @@ -1,17 +1,17 @@ -package com.mcmoddev.steamadvantage.init; +package zone.moddev.mc.steamadvantage.init; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.enchantments.HighExplosiveEnchantment; -import com.mcmoddev.steamadvantage.enchantments.PowderlessEnchantment; -import com.mcmoddev.steamadvantage.enchantments.RapidReloadEnchantment; -import com.mcmoddev.steamadvantage.enchantments.RecoilEnchantment; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.enchantments.HighExplosiveEnchantment; +import zone.moddev.mc.steamadvantage.enchantments.PowderlessEnchantment; +import zone.moddev.mc.steamadvantage.enchantments.RapidReloadEnchantment; +import zone.moddev.mc.steamadvantage.enchantments.RecoilEnchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.util.ResourceLocation; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; -@Mod.EventBusSubscriber(modid = SteamAdvantage.MODID) +@Mod.EventBusSubscriber(modid = SteamAdvantage.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class Enchantments { public static Enchantment rapid_reload; diff --git a/src/main/java/zone/moddev/mc/steamadvantage/init/Entities.java b/src/main/java/zone/moddev/mc/steamadvantage/init/Entities.java new file mode 100644 index 0000000..046584f --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/init/Entities.java @@ -0,0 +1,66 @@ +package zone.moddev.mc.steamadvantage.init; + +import java.util.function.Supplier; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityType; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.blocks.DrillBitTileEntity; +import zone.moddev.mc.steamadvantage.machines.BlastFurnaceTileEntity; +import zone.moddev.mc.steamadvantage.machines.CoalBoilerTileEntity; +import zone.moddev.mc.steamadvantage.machines.ElectricBoilerTileEntity; +import zone.moddev.mc.steamadvantage.machines.GeothermalBoilerTileEntity; +import zone.moddev.mc.steamadvantage.machines.OilBoilerTileEntity; +import zone.moddev.mc.steamadvantage.machines.RockCrusherTileEntity; +import zone.moddev.mc.steamadvantage.machines.SteamDrillTileEntity; +import zone.moddev.mc.steamadvantage.machines.SteamElevatorTileEntity; +import zone.moddev.mc.steamadvantage.machines.SteamPumpTileEntity; +import zone.moddev.mc.steamadvantage.machines.SteamStillTileEntity; +import zone.moddev.mc.steamadvantage.machines.SteamTankTileEntity; + +/** Stable tile entity registrations; registry names are unchanged from 1.12. */ +@Mod.EventBusSubscriber(modid = SteamAdvantage.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) +public final class Entities { + public static TileEntityType STEAM_BOILER_COAL; + public static TileEntityType STEAM_BOILER_ELECTRIC; + public static TileEntityType STEAM_BOILER_GEOTHERMAL; + public static TileEntityType STEAM_TANK; + public static TileEntityType STEAM_FURNACE; + public static TileEntityType STEAM_CRUSHER; + public static TileEntityType STEAM_DRILL; + public static TileEntityType STEAM_ELEVATOR; + public static TileEntityType DRILLBIT; + public static TileEntityType STEAM_STILL; + public static TileEntityType STEAM_PUMP; + public static TileEntityType STEAM_BOILER_OIL; + + private Entities() {} + public static void init() {} + + @SubscribeEvent + public static void register(RegistryEvent.Register> event) { + STEAM_BOILER_COAL = register(event, "steam_boiler_coal", CoalBoilerTileEntity::new); + STEAM_BOILER_ELECTRIC = register(event, "steam_boiler_electric", ElectricBoilerTileEntity::new); + STEAM_BOILER_GEOTHERMAL = register(event, "steam_boiler_geothermal", GeothermalBoilerTileEntity::new); + STEAM_TANK = register(event, "steam_tank", SteamTankTileEntity::new); + STEAM_FURNACE = register(event, "steam_furnace", BlastFurnaceTileEntity::new); + STEAM_CRUSHER = register(event, "steam_crusher", RockCrusherTileEntity::new); + STEAM_DRILL = register(event, "steam_drill", SteamDrillTileEntity::new); + STEAM_ELEVATOR = register(event, "steam_elevator", SteamElevatorTileEntity::new); + DRILLBIT = register(event, "drillbit", DrillBitTileEntity::new); + STEAM_STILL = register(event, "steam_still", SteamStillTileEntity::new); + STEAM_PUMP = register(event, "steam_pump", SteamPumpTileEntity::new); + STEAM_BOILER_OIL = register(event, "steam_boiler_oil", OilBoilerTileEntity::new); + } + + private static TileEntityType register( + RegistryEvent.Register> event, String id, Supplier factory) { + TileEntityType type = TileEntityType.Builder.create(factory).build(null); + type.setRegistryName(SteamAdvantage.MODID, id); + event.getRegistry().register(type); + return type; + } +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/init/GUI.java b/src/main/java/zone/moddev/mc/steamadvantage/init/GUI.java similarity index 86% rename from src/main/java/com/mcmoddev/steamadvantage/init/GUI.java rename to src/main/java/zone/moddev/mc/steamadvantage/init/GUI.java index 622559c..d064e07 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/init/GUI.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/init/GUI.java @@ -1,8 +1,8 @@ -package com.mcmoddev.steamadvantage.init; +package zone.moddev.mc.steamadvantage.init; -import com.mcmoddev.poweradvantage.PowerAdvantage; -import com.mcmoddev.poweradvantage.registry.MachineGUIRegistry; -import com.mcmoddev.steamadvantage.gui.*; +import zone.moddev.mc.poweradvantage.PowerAdvantage; +import zone.moddev.mc.poweradvantage.registry.MachineGUIRegistry; +import zone.moddev.mc.steamadvantage.gui.*; public class GUI { diff --git a/src/main/java/zone/moddev/mc/steamadvantage/init/Items.java b/src/main/java/zone/moddev/mc/steamadvantage/init/Items.java new file mode 100644 index 0000000..05c66c6 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/init/Items.java @@ -0,0 +1,54 @@ +package zone.moddev.mc.steamadvantage.init; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + +import net.minecraft.item.Item; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import zone.moddev.mc.poweradvantage.init.ItemGroups; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.items.MusketItem; + +@Mod.EventBusSubscriber(modid = SteamAdvantage.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) +public final class Items { + public static final Map allItems = new LinkedHashMap<>(); + public static Item steam_governor; + public static Item steam_drill_bit; + public static Item blackpowder_cartridge; + public static Item blackpowder_musket; + private static boolean initialized; + + private Items() {} + + public static synchronized void init() { + if (initialized) return; + Blocks.init(); + steam_governor = add("steam_governor", new Item(properties())); + steam_drill_bit = add("steam_drill_bit", new Item(properties())); + blackpowder_cartridge = add("blackpowder_cartridge", new Item(properties())); + blackpowder_musket = add("musket", new MusketItem(properties().maxStackSize(1))); + initialized = true; + } + + private static Item.Properties properties() { + return new Item.Properties().group(ItemGroups.tab_powerAdvantage); + } + + private static Item add(String id, Item item) { + item.setRegistryName(SteamAdvantage.MODID, id); + allItems.put(id, item); + return item; + } + + @SubscribeEvent + public static void register(RegistryEvent.Register event) { + init(); + event.getRegistry().registerAll(allItems.values().toArray(new Item[0])); + } + + public static Item getItemByName(String id) { return allItems.get(id); } + public static Set> getAllRegisteredItems() { return allItems.entrySet(); } +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/init/Power.java b/src/main/java/zone/moddev/mc/steamadvantage/init/Power.java similarity index 90% rename from src/main/java/com/mcmoddev/steamadvantage/init/Power.java rename to src/main/java/zone/moddev/mc/steamadvantage/init/Power.java index b259279..94fcab3 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/init/Power.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/init/Power.java @@ -1,4 +1,4 @@ -package com.mcmoddev.steamadvantage.init; +package zone.moddev.mc.steamadvantage.init; import net.minecraft.util.DamageSource; import cyano.poweradvantage.api.ConduitType; diff --git a/src/main/java/com/mcmoddev/steamadvantage/init/Recipes.java b/src/main/java/zone/moddev/mc/steamadvantage/init/Recipes.java similarity index 72% rename from src/main/java/com/mcmoddev/steamadvantage/init/Recipes.java rename to src/main/java/zone/moddev/mc/steamadvantage/init/Recipes.java index 3ff62cf..833e953 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/init/Recipes.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/init/Recipes.java @@ -1,10 +1,9 @@ -package com.mcmoddev.steamadvantage.init; +package zone.moddev.mc.steamadvantage.init; import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.mcmoddev.poweradvantage.PowerAdvantage; -import com.mcmoddev.poweradvantage.RecipeMode; -import com.mcmoddev.steamadvantage.compat.BaseMetalsCompat; +import zone.moddev.mc.poweradvantage.PowerAdvantage; +import zone.moddev.mc.poweradvantage.RecipeMode; +import zone.moddev.mc.steamadvantage.compat.BaseMetalsCompat; public class Recipes { @@ -19,11 +18,8 @@ public static void init(){ RecipeMode recipeMode = PowerAdvantage.recipeMode; - OreDictionary.registerOre("stick", net.minecraft.init.Items.STICK); - OreDictionary.registerOre("blockObsidian", net.minecraft.init.Blocks.OBSIDIAN); - if(recipeMode == RecipeMode.APOCALYPTIC){ - BaseMetalsCompat.addCrusherRecipe(Items.steam_governor, new ItemStack(com.mcmoddev.poweradvantage.init.Items.sprocket,2)); + BaseMetalsCompat.addCrusherRecipe(Items.steam_governor, new ItemStack(zone.moddev.mc.poweradvantage.init.Items.sprocket,2)); BaseMetalsCompat.addCrusherRecipe(Blocks.steam_crusher, new ItemStack(Items.steam_governor,2)); BaseMetalsCompat.addCrusherRecipe(Blocks.steam_furnace, new ItemStack(Items.steam_governor,2)); diff --git a/src/main/java/com/mcmoddev/steamadvantage/init/TreasureChests.java b/src/main/java/zone/moddev/mc/steamadvantage/init/TreasureChests.java similarity index 94% rename from src/main/java/com/mcmoddev/steamadvantage/init/TreasureChests.java rename to src/main/java/zone/moddev/mc/steamadvantage/init/TreasureChests.java index 51fbf1f..9d45ff2 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/init/TreasureChests.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/init/TreasureChests.java @@ -1,8 +1,6 @@ -package com.mcmoddev.steamadvantage.init; +package zone.moddev.mc.steamadvantage.init; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import net.minecraftforge.fml.common.FMLLog; -import org.apache.logging.log4j.Level; +import zone.moddev.mc.steamadvantage.SteamAdvantage; import java.io.IOException; import java.nio.charset.Charset; @@ -33,7 +31,7 @@ private static void writeLootFile(Path file, String content){ Files.createDirectories(file.getParent()); Files.write(file, Arrays.asList(content), Charset.forName("UTF-8")); } catch (IOException e) { - FMLLog.log(Level.ERROR,e,"Error writing additional-loot-table files"); + SteamAdvantage.LOGGER.error("Error writing additional-loot-table files", e); } } diff --git a/src/main/java/com/mcmoddev/steamadvantage/init/Villages.java b/src/main/java/zone/moddev/mc/steamadvantage/init/Villages.java similarity index 90% rename from src/main/java/com/mcmoddev/steamadvantage/init/Villages.java rename to src/main/java/zone/moddev/mc/steamadvantage/init/Villages.java index a62b4c3..7d52850 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/init/Villages.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/init/Villages.java @@ -1,12 +1,11 @@ -package com.mcmoddev.steamadvantage.init; +package zone.moddev.mc.steamadvantage.init; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.registry.ForgeRegistries; +import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.fml.common.registry.VillagerRegistry; -import org.apache.logging.log4j.Level; +import zone.moddev.mc.steamadvantage.SteamAdvantage; public abstract class Villages { // TODO: add machinist villager @@ -37,7 +36,7 @@ public static void init(){ insertTrades(2, 1, 3, new EntityVillager.ListEnchantedItemForEmeralds(Items.blackpowder_musket, new EntityVillager.PriceInfo(15, 25))); } catch (RuntimeException e) { - FMLLog.log(Level.ERROR, e, "Failed to add trades to villagers"); + SteamAdvantage.LOGGER.error("Failed to add trades to villagers", e); } initDone = true; diff --git a/src/main/java/com/mcmoddev/steamadvantage/items/MusketItem.java b/src/main/java/zone/moddev/mc/steamadvantage/items/MusketItem.java similarity index 79% rename from src/main/java/com/mcmoddev/steamadvantage/items/MusketItem.java rename to src/main/java/zone/moddev/mc/steamadvantage/items/MusketItem.java index 7b071cc..34b2780 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/items/MusketItem.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/items/MusketItem.java @@ -1,16 +1,16 @@ -package com.mcmoddev.steamadvantage.items; +package zone.moddev.mc.steamadvantage.items; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playBigSoundAtPosition; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtPosition; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playBigSoundAtPosition; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtPosition; import java.util.List; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.init.Enchantments; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.init.Enchantments; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.BlockTNT; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; @@ -27,24 +27,28 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.init.Particles; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.play.server.SPacketEntityVelocity; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; -import net.minecraft.util.EnumParticleTypes; +import net.minecraft.particles.IParticleData; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.RayTraceFluidMode; import net.minecraft.util.math.Vec3d; -import net.minecraft.util.text.translation.I18n; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraft.tags.ItemTags; @SuppressWarnings("deprecation") public class MusketItem extends net.minecraft.item.Item{ @@ -54,22 +58,23 @@ public class MusketItem extends net.minecraft.item.Item{ public static final double MAX_RANGE = 64; private static final int maxUseTime = 7200; - public MusketItem(){ - super(); - this.setMaxStackSize(1); - this.setMaxDamage(250); + private static final ResourceLocation BLACKPOWDER_AMMO_TAG = new ResourceLocation("forge", "ammo/blackpowder"); + private static final ResourceLocation STEEL_INGOT_TAG = new ResourceLocation("forge", "ingots/steel"); + + public MusketItem(Item.Properties properties){ + super(properties.defaultMaxDamage(250)); this.addPropertyOverride(new ResourceLocation("loaded"), new IItemPropertyGetter() { - @SideOnly(Side.CLIENT) - public float apply(ItemStack item, World w, EntityLivingBase e) + @OnlyIn(Dist.CLIENT) + public float call(ItemStack item, World w, EntityLivingBase e) { return isLoaded(item) ? 1.0F : 0.0F; } }); this.addPropertyOverride(new ResourceLocation("loading"), new IItemPropertyGetter() { - @SideOnly(Side.CLIENT) - public float apply(ItemStack item, World w, EntityLivingBase e) + @OnlyIn(Dist.CLIENT) + public float call(ItemStack item, World w, EntityLivingBase e) { return e != null && e.isHandActive() && e.getActiveItemStack() == item ? 1.0F : 0.0F; } @@ -93,7 +98,7 @@ public int getItemEnchantability(){ } @Override - public EnumAction getItemUseAction(ItemStack stack){ + public EnumAction getUseAction(ItemStack stack){ if(isLoaded(stack)){ return EnumAction.BOW; } else { @@ -153,18 +158,18 @@ protected void fire(ItemStack srcItemStack, EntityLivingBase playerEntity, World world) { final boolean isPlayer = playerEntity instanceof EntityPlayer; unload(srcItemStack); - if(isPlayer && !((EntityPlayer)playerEntity).capabilities.isCreativeMode){ + if(isPlayer && !((EntityPlayer)playerEntity).isCreative()){ srcItemStack.damageItem(1, playerEntity); } Vec3d lookVector = playerEntity.getLookVec(); - spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, world, + spawnParticle(Particles.EXPLOSION_EMITTER, world, playerEntity.posX+lookVector.x, playerEntity.posY+playerEntity.getEyeHeight()+lookVector.y, playerEntity.posZ + lookVector.z); if(world.isRemote){ playerEntity.rotationPitch -= 15; return; } playSound(SoundEvents.ITEM_FLINTANDSTEEL_USE,world,playerEntity); - playBigSoundAtPosition(playerEntity.posX,playerEntity.posY,playerEntity.posZ, SoundEvents.ENTITY_FIREWORK_BLAST,SoundCategory.PLAYERS,2F,0.5F,world); + playBigSoundAtPosition(playerEntity.posX,playerEntity.posY,playerEntity.posZ, SoundEvents.ENTITY_FIREWORK_ROCKET_BLAST,SoundCategory.PLAYERS,2F,0.5F,world); Vec3d start = new Vec3d(playerEntity.posX, playerEntity.posY+playerEntity.getEyeHeight(),playerEntity.posZ); start.add(MAX_RANGE * lookVector.x, MAX_RANGE * lookVector.y, MAX_RANGE * lookVector.z); @@ -174,8 +179,8 @@ protected void fire(ItemStack srcItemStack, EntityLivingBase playerEntity, return; } final float explodeFactor = 0.75f; - if(rayTrace.typeOfHit == RayTraceResult.Type.ENTITY && rayTrace.entityHit != null){ - Entity e = rayTrace.entityHit; + if(rayTrace.type == RayTraceResult.Type.ENTITY && rayTrace.entity != null){ + Entity e = rayTrace.entity; e.attackEntityFrom(Power.musket_damage, getShotDamage()); if(EnchantmentHelper.getEnchantmentLevel(Enchantments.high_explosive, srcItemStack) > 0){ int lvl = EnchantmentHelper.getEnchantmentLevel(Enchantments.high_explosive, srcItemStack); @@ -189,7 +194,7 @@ protected void fire(ItemStack srcItemStack, EntityLivingBase playerEntity, victim.setFire(lvl); } } - } else if(rayTrace.typeOfHit == RayTraceResult.Type.BLOCK){ + } else if(rayTrace.type == RayTraceResult.Type.BLOCK){ playSoundAtPosition(rayTrace.hitVec.x, rayTrace.hitVec.y, rayTrace.hitVec.z, SoundEvents.BLOCK_GRAVEL_HIT, SoundCategory.BLOCKS, 1f, 1f, world); BlockPos coord = rayTrace.getBlockPos(); @@ -205,8 +210,8 @@ protected void fire(ItemStack srcItemStack, EntityLivingBase playerEntity, world.destroyBlock(coord, true); } else if (blockMat == net.minecraft.block.material.Material.TNT){ if(world.getBlockState(coord).getBlock() instanceof BlockTNT){ - ((BlockTNT)world.getBlockState(coord).getBlock()).explode(world, coord, world.getBlockState(coord).withProperty(BlockTNT.EXPLODE, (Boolean)true), playerEntity); - world.setBlockToAir(coord); + ((BlockTNT)world.getBlockState(coord).getBlock()).explode(world, coord); + world.removeBlock(coord); } } } @@ -223,10 +228,10 @@ protected void fire(ItemStack srcItemStack, EntityLivingBase playerEntity, } } } - if(rayTrace.typeOfHit != RayTraceResult.Type.MISS && rayTrace.hitVec != null){ - spawnParticle(EnumParticleTypes.SMOKE_LARGE, world, + if(rayTrace.type != RayTraceResult.Type.MISS && rayTrace.hitVec != null){ + spawnParticle(Particles.LARGE_SMOKE, world, rayTrace.hitVec.x, rayTrace.hitVec.y, rayTrace.hitVec.z); - spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, world, + spawnParticle(Particles.EXPLOSION, world, rayTrace.hitVec.x, rayTrace.hitVec.y, rayTrace.hitVec.z); } @@ -246,11 +251,10 @@ protected void fire(ItemStack srcItemStack, EntityLivingBase playerEntity, } - private void spawnParticle(EnumParticleTypes p, World w, double x, double y, double z) { + private void spawnParticle(IParticleData p, World w, double x, double y, double z) { w.spawnParticle(p, x, y, z, - 0f, 0f, 0f, - null); + 0f, 0f, 0f); } @Override @@ -270,51 +274,51 @@ protected void playSound(SoundEvent sound, World world, Entity e){ public static void startLoad(ItemStack musket){ NBTTagCompound data; - if(musket.hasTagCompound()){ - data = musket.getTagCompound(); + if(musket.hasTag()){ + data = musket.getTag(); } else { data = new NBTTagCompound(); } data.setByte(NBT_DATA_KEY_LOADED, (byte)2); - musket.setTagCompound(data); + musket.setTag(data); } public static void finishLoad(ItemStack musket){ NBTTagCompound data; - if(musket.hasTagCompound()){ - data = musket.getTagCompound(); + if(musket.hasTag()){ + data = musket.getTag(); } else { data = new NBTTagCompound(); } data.setByte(NBT_DATA_KEY_LOADED, (byte)1); - musket.setTagCompound(data); + musket.setTag(data); } public static void unload(ItemStack musket){ NBTTagCompound data; - if(musket.hasTagCompound()){ - data = musket.getTagCompound(); + if(musket.hasTag()){ + data = musket.getTag(); } else { data = new NBTTagCompound(); } data.setByte(NBT_DATA_KEY_LOADED, (byte)0); - musket.setTagCompound(data); + musket.setTag(data); } public static boolean isLoaded(ItemStack musket){ - NBTTagCompound data = musket.getTagCompound(); + NBTTagCompound data = musket.getTag(); if(data == null) return false; return data.hasKey(NBT_DATA_KEY_LOADED) && data.getByte(NBT_DATA_KEY_LOADED) == 1; } public static boolean isNotLoaded(ItemStack musket){ - NBTTagCompound data = musket.getTagCompound(); + NBTTagCompound data = musket.getTag(); if(data == null || !data.hasKey(NBT_DATA_KEY_LOADED)) return true; return data.hasKey(NBT_DATA_KEY_LOADED) && data.getByte(NBT_DATA_KEY_LOADED) == 0; } public static boolean isAlmostLoaded(ItemStack musket){ - NBTTagCompound data = musket.getTagCompound(); + NBTTagCompound data = musket.getTag(); if(data == null) return false; return data.hasKey(NBT_DATA_KEY_LOADED) && data.getByte(NBT_DATA_KEY_LOADED) == 2; } @@ -324,18 +328,13 @@ public static boolean isAlmostLoaded(ItemStack musket){ public static boolean hasAmmo(EntityLivingBase e, ItemStack musket) { if(e instanceof EntityPlayer) { EntityPlayer playerEntity = (EntityPlayer) e; - if (playerEntity.capabilities.isCreativeMode + if (playerEntity.isCreative() || EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.INFINITY, musket) > 0 || EnchantmentHelper.getEnchantmentLevel(Enchantments.powderless, musket) > 0) return true; - List ammoItems = OreDictionary.getOres("ammoBlackpowder"); for (int i = 0; i < playerEntity.inventory.mainInventory.size(); i++) { ItemStack inventoryStack = playerEntity.inventory.mainInventory.get(i); if (inventoryStack.isEmpty()) continue; - for (int n = 0; n < ammoItems.size(); n++) { - if (OreDictionary.itemMatches(ammoItems.get(n), inventoryStack, false)) { - return true; - } - } + if (ItemTags.getCollection().getOrCreate(BLACKPOWDER_AMMO_TAG).contains(inventoryStack.getItem())) return true; } } return false; @@ -345,21 +344,16 @@ public static boolean hasAmmo(EntityLivingBase e, ItemStack musket) { public static void decrementAmmo(EntityLivingBase e, ItemStack musket) { if(e instanceof EntityPlayer) { EntityPlayer playerEntity = (EntityPlayer) e; - if (playerEntity.capabilities.isCreativeMode + if (playerEntity.isCreative() || EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.INFINITY, musket) > 0 || EnchantmentHelper.getEnchantmentLevel(Enchantments.powderless, musket) > 0) return; - List ammoItems = OreDictionary.getOres("ammoBlackpowder"); for (int i = 0; i < playerEntity.inventory.mainInventory.size(); i++) { ItemStack inventoryStack = playerEntity.inventory.mainInventory.get(i); if (inventoryStack.isEmpty()) continue; - for (int n = 0; n < ammoItems.size(); n++) { - if (OreDictionary.itemMatches(ammoItems.get(n), inventoryStack, false)) { - inventoryStack.shrink(1); - if (inventoryStack.isEmpty()) { - playerEntity.inventory.mainInventory.set(i, ItemStack.EMPTY); - } - return; - } + if (ItemTags.getCollection().getOrCreate(BLACKPOWDER_AMMO_TAG).contains(inventoryStack.getItem())) { + inventoryStack.shrink(1); + if (inventoryStack.isEmpty()) playerEntity.inventory.mainInventory.set(i, ItemStack.EMPTY); + return; } } } @@ -380,7 +374,7 @@ public static RayTraceResult rayTraceBlocksAndEntities(World w, double maxRange, double distSqr = e.getDistanceSq(source.posX, source.posY, source.posZ); if(distSqr < rangeSqr){ // e is within range - AxisAlignedBB box = e.getEntityBoundingBox(); + AxisAlignedBB box = e.getBoundingBox(); if(rayIntersectsBoundingBox(rayOrigin,rayDirection, box)){ // e is in cross-hairs if(distSqr < closestDistSqr){ @@ -392,7 +386,7 @@ public static RayTraceResult rayTraceBlocksAndEntities(World w, double maxRange, } } if(closestEntity == null) { - return w.rayTraceBlocks(rayOrigin, rayOrigin.add(mul(rayDirection, maxRange)), true, false, false); + return w.rayTraceBlocks(rayOrigin, rayOrigin.add(mul(rayDirection, maxRange)), RayTraceFluidMode.SOURCE_ONLY, false, false); } else { Vec3d pos = new Vec3d(closestEntity.posX, closestEntity.posY+closestEntity.getEyeHeight(), closestEntity.posZ); RayTraceResult entityCollision = new RayTraceResult(closestEntity, pos); @@ -446,22 +440,18 @@ private static double min(double a, double b){ @Override public boolean getIsRepairable(ItemStack srcItemStack, ItemStack rawMaterial) { // repair with steel ingots - List repairItems = OreDictionary.getOres("ingotSteel"); - for(int i = 0; i < repairItems.size(); i++){ - if(OreDictionary.itemMatches(repairItems.get(i),rawMaterial,false)) return true; - } - return false; + return ItemTags.getCollection().getOrCreate(STEEL_INGOT_TAG).contains(rawMaterial.getItem()); } @Override - public void addInformation(ItemStack stack, World world, List list, net.minecraft.client.util.ITooltipFlag flag){ + public void addInformation(ItemStack stack, World world, List list, net.minecraft.client.util.ITooltipFlag flag){ super.addInformation(stack,world,list,flag); - list.add(I18n.translateToLocal("tooltip.musket.damage").replace("%x", String.valueOf((int)MusketItem.getShotDamage()))); + list.add(new TextComponentTranslation("tooltip.musket.damage", (int)MusketItem.getShotDamage())); if(isLoaded(stack)){ - list.add(I18n.translateToLocal("tooltip.musket.loaded")); + list.add(new TextComponentTranslation("tooltip.musket.loaded")); } else { - list.add(I18n.translateToLocal("tooltip.musket.unloaded")); - list.add(I18n.translateToLocal("tooltip.musket.ammo").replace("%x",I18n.translateToLocal("item.steamadvantage.blackpowder_cartridge.name"))); + list.add(new TextComponentTranslation("tooltip.musket.unloaded")); + list.add(new TextComponentTranslation("tooltip.musket.ammo", new TextComponentTranslation("item.steamadvantage.blackpowder_cartridge"))); } } @@ -476,7 +466,7 @@ public Multimap getAttributeModifiers(EntityEquipment } @Override - public int getMaxItemUseDuration(ItemStack stack) + public int getUseDuration(ItemStack stack) { if(isLoaded(stack)){ return maxUseTime; diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/BlastFurnaceBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/BlastFurnaceBlock.java similarity index 86% rename from src/main/java/com/mcmoddev/steamadvantage/machines/BlastFurnaceBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/BlastFurnaceBlock.java index 2c4b3d2..d049813 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/BlastFurnaceBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/BlastFurnaceBlock.java @@ -1,8 +1,8 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; @@ -21,7 +21,7 @@ public BlastFurnaceBlock() { } @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { return new BlastFurnaceTileEntity(); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/BlastFurnaceTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/BlastFurnaceTileEntity.java similarity index 84% rename from src/main/java/com/mcmoddev/steamadvantage/machines/BlastFurnaceTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/BlastFurnaceTileEntity.java index 9c2c4e4..df77562 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/BlastFurnaceTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/BlastFurnaceTileEntity.java @@ -1,21 +1,24 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.text.TextComponentString; +import net.minecraftforge.common.crafting.VanillaRecipeTypes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.EnumFacing; import net.minecraft.util.SoundCategory; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import java.util.Arrays; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; public class BlastFurnaceTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine{ @@ -37,14 +40,14 @@ public class BlastFurnaceTileEntity extends cyano.poweradvantage.api.simple.Tile private boolean redstone = true; public BlastFurnaceTileEntity() { - super(Power.steam_power, 200, "tile.steamadvantage.steam_furnace.name"); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_FURNACE, Power.steam_power, 200, "tile.steamadvantage.steam_furnace.name"); allSlots = new int[inventory.length]; for(int i = 0; i < allSlots.length; i++){ allSlots[i] = i; } } - @SideOnly(Side.CLIENT) + @OnlyIn(Dist.CLIENT) public float[] getProgress(){ float[] a = new float[progress.length]; System.arraycopy(progress, 0, a, 0, progress.length); @@ -119,7 +122,7 @@ public void tickUpdate(boolean isServerWorld) { private boolean canSmelt(int slot) { ItemStack input = inventory[slot]; if(input == null) return false; - ItemStack output = FurnaceRecipes.instance().getSmeltingResult(input); + ItemStack output = getSmeltingResult(input); if(output.isEmpty()) return false; ItemStack outputSlot = inventory[slot+3]; if(outputSlot == null) return true; @@ -130,7 +133,7 @@ private boolean canSmelt(int slot) { private void doSmelt(int slot) { ItemStack input = inventory[slot]; - ItemStack output = FurnaceRecipes.instance().getSmeltingResult(input); + ItemStack output = getSmeltingResult(input); ItemStack outputSlot = inventory[slot+3]; if(outputSlot == null){ inventory[slot+3] = output.copy(); @@ -184,7 +187,7 @@ private void energyDecay() { private int getFuelBurnTime(ItemStack item) { if(item == null) return 0; - return TileEntityFurnace.getItemBurnTime(item); + return zone.moddev.mc.steamadvantage.util.FurnaceFuelHelper.getBurnTime(item); } private void decrementFuel() { @@ -249,16 +252,16 @@ public void onDataFieldUpdate() { @Override - public NBTTagCompound writeToNBT(NBTTagCompound tagRoot){ - super.writeToNBT(tagRoot); + public NBTTagCompound write(NBTTagCompound tagRoot){ + super.write(tagRoot); prepareDataFieldsForSync(); tagRoot.setIntArray("Data", getDataFieldArray()); return tagRoot; } @Override - public void readFromNBT(NBTTagCompound tagRoot){ - super.readFromNBT(tagRoot); + public void read(NBTTagCompound tagRoot){ + super.read(tagRoot); if(tagRoot.hasKey("Data")){ int[] data = tagRoot.getIntArray("Data"); System.arraycopy(data, 0, this.getDataFieldArray(), 0, Math.min(data.length,this.getDataFieldArray().length)); @@ -303,7 +306,7 @@ public boolean isItemValidForSlot(final int slot, final ItemStack item) { case 1: case 2: case 3: - return FurnaceRecipes.instance().getSmeltingResult(item) != null; + return !getSmeltingResult(item).isEmpty(); case 4: case 5: case 6: @@ -313,6 +316,14 @@ public boolean isItemValidForSlot(final int slot, final ItemStack item) { } } + private ItemStack getSmeltingResult(ItemStack input) { + if (input == null || input.isEmpty() || getWorld() == null) return ItemStack.EMPTY; + InventoryBasic inventory = new InventoryBasic(new TextComponentString("steamadvantage.smelting"), 1); + inventory.setInventorySlotContents(0, input); + IRecipe recipe = getWorld().getRecipeManager().getRecipe(inventory, getWorld(), VanillaRecipeTypes.SMELTING); + return recipe == null ? ItemStack.EMPTY : recipe.getCraftingResult(inventory); + } + @Override public boolean isPowerSink(ConduitType powerType) { diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/CoalBoilerBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/CoalBoilerBlock.java similarity index 53% rename from src/main/java/com/mcmoddev/steamadvantage/machines/CoalBoilerBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/CoalBoilerBlock.java index 79008bf..aec3569 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/CoalBoilerBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/CoalBoilerBlock.java @@ -1,10 +1,10 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; @@ -26,7 +26,7 @@ public CoalBoilerBlock() { } @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { return new CoalBoilerTileEntity(); } @@ -57,32 +57,5 @@ public boolean isPowerSink(ConduitType type) { public boolean isPowerSource(ConduitType type){ return ConduitType.areSameType(Power.steam_power,type); } - /** - * This method is called whenever the block is placed into the world - */ - @Override - public void onBlockAdded(World w, BlockPos coord, IBlockState state){ - super.onBlockAdded(w, coord, state); - ConduitRegistry.getInstance().conduitBlockPlacedEvent(w, w.provider.getDimension(), coord, com.mcmoddev.poweradvantage.init.Fluids.fluidConduit_general); - } - - /** - * This method is called when the block is removed from the world by an entity. - */ - @Override - public void onPlayerDestroy(World w, BlockPos coord, IBlockState state){ - super.onPlayerDestroy(w, coord, state); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - /** - * This method is called when the block is destroyed by an explosion. - */ - @Override - public void onBlockExploded(World w, BlockPos coord, Explosion boom){ - super.onBlockExploded(w, coord, boom); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - - ///// end multi-type overrides ///// } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/CoalBoilerTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/CoalBoilerTileEntity.java similarity index 82% rename from src/main/java/com/mcmoddev/steamadvantage/machines/CoalBoilerTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/CoalBoilerTileEntity.java index dba9d33..f94468a 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/CoalBoilerTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/CoalBoilerTileEntity.java @@ -1,12 +1,12 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PowerRequest; import cyano.poweradvantage.api.fluid.FluidRequest; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; @@ -14,39 +14,39 @@ import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.EnumFacing; import net.minecraft.util.SoundCategory; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.FluidTankInfo; -import com.mcmoddev.steamadvantage.util.LegacyFluidHandler; +import net.minecraft.fluid.Fluid; + +import cyano.poweradvantage.api.fluid.FluidStack; +import cyano.poweradvantage.api.fluid.FluidTank; +import cyano.poweradvantage.api.fluid.FluidTankInfo; +import zone.moddev.mc.steamadvantage.util.LegacyFluidHandler; @SuppressWarnings("deprecation") public class CoalBoilerTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine implements LegacyFluidHandler{ - + public static final int LAVA_REQUEST_SIZE = 100; public static final float LAVA_TO_BURN_TICKS = 16; - + private final FluidTank tank; - + private final ItemStack[] inventory; - + private int burnTime = 0; private int totalBurnTime = 0; - + private final int[] dataSyncArray = new int[4]; - + public CoalBoilerTileEntity() { - super(new ConduitType[]{Power.steam_power,Fluids.fluidConduit_general}, new float[]{1000,1000}, "tile.steamadvantage.steam_boiler_coal.name"); - tank = new FluidTank(Fluid.BUCKET_VOLUME * 4); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_BOILER_COAL, new ConduitType[]{Power.steam_power,Fluids.fluidConduit_general}, new float[]{1000,1000}, "tile.steamadvantage.steam_boiler_coal.name"); + tank = new FluidTank(FluidTank.BUCKET_VOLUME * 4); inventory = new ItemStack[1]; } private boolean redstone = true; - + private int timeSinceSound = 0; - + @Override public void tickUpdate(boolean isServerWorld) { if(isServerWorld){ @@ -97,9 +97,9 @@ private void energyDecay() { private int getFuelBurnTime() { if(inventory[0] == null) return 0; - return TileEntityFurnace.getItemBurnTime(inventory[0]); + return zone.moddev.mc.steamadvantage.util.FurnaceFuelHelper.getBurnTime(inventory[0]); } - + private void decrementFuel() { if(inventory[0].getCount() == 1 && inventory[0].getItem().getContainerItem(inventory[0]) != null){ @@ -123,8 +123,8 @@ private void boilWater() { @Override public void powerUpdate(){ super.powerUpdate(); - // powerUpdate occurs once every 8 world ticks and is scheduled such that neighboring - // machines don't powerUpdate in the same world tick. To reduce network congestion, + // powerUpdate occurs once every 8 world ticks and is scheduled such that neighboring + // machines don't powerUpdate in the same world tick. To reduce network congestion, // I'm doing the synchonization logic here instead of in the tickUpdate method boolean updateFlag = false; @@ -140,22 +140,22 @@ public void powerUpdate(){ oldWater = getTank().getFluidAmount(); updateFlag = true; } - + redstone = hasRedstoneSignal(); - + if(updateFlag){ super.sync(); } } - + public float getWaterLevel(){ return ((float)getTank().getFluidAmount()) / ((float)getTank().getCapacity()); } - + public float getSteamLevel(){ return this.getEnergy(Power.steam_power) / this.getEnergyCapacity(Power.steam_power); } - + public float getBurnLevel(){ if(burnTime == 0){ return 0; @@ -164,7 +164,7 @@ public float getBurnLevel(){ } return Math.max(0,Math.min(1,((float)burnTime)/((float)totalBurnTime))); } - + public FluidTank getTank(){ return tank; } @@ -190,24 +190,24 @@ public void prepareDataFieldsForSync() { @Override public void onDataFieldUpdate() { this.setEnergy(Float.intBitsToFloat(dataSyncArray[0]), Power.steam_power); - this.getTank().setFluid(new FluidStack(FluidRegistry.WATER,dataSyncArray[1])); + this.getTank().setFluid(new FluidStack(net.minecraft.init.Fluids.WATER,dataSyncArray[1])); this.burnTime = dataSyncArray[2]; this.totalBurnTime = dataSyncArray[3]; } - + /** * Handles data saving and loading * @param tagRoot An NBT tag */ @Override - public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { - super.writeToNBT(tagRoot); + public NBTTagCompound write(final NBTTagCompound tagRoot) { + super.write(tagRoot); NBTTagCompound tankTag = new NBTTagCompound(); this.getTank().writeToNBT(tankTag); tagRoot.setTag("Tank", tankTag); - if(this.burnTime > 0)tagRoot.setInteger("BurnTime", this.burnTime); - if(this.totalBurnTime > 0)tagRoot.setInteger("BurnTimeTotal", this.totalBurnTime); + if(this.burnTime > 0)tagRoot.setInt("BurnTime", this.burnTime); + if(this.totalBurnTime > 0)tagRoot.setInt("BurnTimeTotal", this.totalBurnTime); return tagRoot; } /** @@ -215,33 +215,33 @@ public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { * @param tagRoot An NBT tag */ @Override - public void readFromNBT(final NBTTagCompound tagRoot) { - super.readFromNBT(tagRoot); + public void read(final NBTTagCompound tagRoot) { + super.read(tagRoot); if (tagRoot.hasKey("Tank")) { - NBTTagCompound tankTag = tagRoot.getCompoundTag("Tank"); - getTank().readFromNBT(tankTag); - if(tankTag.hasKey("Empty")){ - // empty the tank if NBT says its empty (not default behavior of Tank.readFromNBT(...) ) - getTank().setFluid(null); - } + NBTTagCompound tankTag = tagRoot.getCompound("Tank"); + getTank().readFromNBT(tankTag); + if(tankTag.hasKey("Empty")){ + // empty the tank if NBT says its empty (not default behavior of Tank.read(...) ) + getTank().setFluid(null); + } } if(tagRoot.hasKey("BurnTime")){ - this.burnTime = tagRoot.getInteger("BurnTime"); + this.burnTime = tagRoot.getInt("BurnTime"); } else { this.burnTime = 0; } if(tagRoot.hasKey("BurnTimeTotal")){ - this.totalBurnTime = tagRoot.getInteger("BurnTimeTotal"); + this.totalBurnTime = tagRoot.getInt("BurnTimeTotal"); } else { this.totalBurnTime = 0; } } - + public int getComparatorOutput() { if(inventory[0] == null) return 0; return Math.min(Math.max(15 * inventory[0].getCount() * inventory[0].getMaxStackSize() / inventory[0].getMaxStackSize(),1),15); } - + ///// Overrides to make this a multi-type block ///// @Override public boolean isPowerSink(ConduitType type) { @@ -253,9 +253,9 @@ public boolean isPowerSink(ConduitType type) { public boolean isPowerSource(ConduitType type){ return ConduitType.areSameType(Power.steam_power,type); } - + /** - * Adds "energy" as a fluid to the FluidTank returned by getTank(). This implementation ignores + * Adds "energy" as a fluid to the FluidTank returned by getTank(). This implementation ignores * all non-fluid energy types. * @param amount amount of energy/fluid to add * @param type the type of energy/fluid being added. @@ -264,13 +264,13 @@ public boolean isPowerSource(ConduitType type){ @Override public float addEnergy(float amount, ConduitType type){ if(Fluids.isFluidType(type)){ - if(Fluids.conduitTypeToFluid(type) == FluidRegistry.WATER){ + if(Fluids.conduitTypeToFluid(type) == net.minecraft.init.Fluids.WATER){ if(this.canFill(null, Fluids.conduitTypeToFluid(type))){ return this.fill(null, new FluidStack(Fluids.conduitTypeToFluid(type),(int)amount), true); } else { return 0; } - } else if(Fluids.conduitTypeToFluid(type) == FluidRegistry.LAVA){ + } else if(Fluids.conduitTypeToFluid(type) == net.minecraft.init.Fluids.LAVA){ burnTime += (int)(amount * LAVA_TO_BURN_TICKS); totalBurnTime = (int)(LAVA_REQUEST_SIZE * LAVA_TO_BURN_TICKS); return amount; @@ -295,7 +295,7 @@ public void setEnergy(float amount,ConduitType type) { } } /** - * Subtracts "energy" as a fluid to the FluidTank returned by getTank(). This implementation + * Subtracts "energy" as a fluid to the FluidTank returned by getTank(). This implementation * ignores all non-fluid energy types. * @param amount amount of energy/fluid to add * @param type the type of energy/fluid being added. @@ -313,16 +313,16 @@ public float subtractEnergy(float amount, ConduitType type){ return super.subtractEnergy(amount, type); } } - + @Override public PowerRequest getPowerRequest(ConduitType offer) { - if(Fluids.conduitTypeToFluid(offer) == FluidRegistry.WATER){ + if(Fluids.conduitTypeToFluid(offer) == net.minecraft.init.Fluids.WATER){ PowerRequest request = new FluidRequest(FluidRequest.MEDIUM_PRIORITY+1, (getTank().getCapacity() - getTank().getFluidAmount()), this); return request; - } else if(Fluids.conduitTypeToFluid(offer) == FluidRegistry.LAVA - && burnTime <= 0 && getFuelBurnTime() <= 0 + } else if(Fluids.conduitTypeToFluid(offer) == net.minecraft.init.Fluids.LAVA + && burnTime <= 0 && getFuelBurnTime() <= 0 && getTank().getFluidAmount() > 0 && !redstone){ PowerRequest request = new FluidRequest(FluidRequest.MEDIUM_PRIORITY+1, @@ -333,12 +333,12 @@ && getTank().getFluidAmount() > 0 return PowerRequest.REQUEST_NOTHING; } } - + ///// end multi-type overrides ///// - - + + ///// IFluidHandler ///// /** @@ -390,7 +390,7 @@ public FluidStack drain(EnumFacing face, int amount, boolean forReal) { */ @Override public boolean canFill(EnumFacing face, Fluid fluid) { - if(fluid != FluidRegistry.WATER) return false; + if(fluid != net.minecraft.init.Fluids.WATER) return false; if(getTank().getFluid() == null) return true; return getTank().getFluidAmount() <= getTank().getCapacity() && fluid.equals(getTank().getFluid().getFluid()); } @@ -404,7 +404,7 @@ public boolean canDrain(EnumFacing face, Fluid fluid) { if(getTank().getFluid() == null) return false; return getTank().getFluidAmount() > 0 && fluid.equals(getTank().getFluid().getFluid()); } - + /** * Implementation of IFluidHandler * @param face Face of the block being polled @@ -418,12 +418,12 @@ public FluidTankInfo[] getTankInfo(EnumFacing face) { } ///// end of IFluidHandler methods ///// - + @Override public boolean isItemValidForSlot(final int slot, final ItemStack item) { - return super.isItemValidForSlot(slot, item) && TileEntityFurnace.getItemBurnTime(item) > 0; + return super.isItemValidForSlot(slot, item) && zone.moddev.mc.steamadvantage.util.FurnaceFuelHelper.getBurnTime(item) > 0; } - + @Override public boolean isUsableByPlayer(EntityPlayer player) { return true; diff --git a/src/main/java/zone/moddev/mc/steamadvantage/machines/ElectricBoilerBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/ElectricBoilerBlock.java new file mode 100644 index 0000000..3a80788 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/ElectricBoilerBlock.java @@ -0,0 +1,52 @@ +package zone.moddev.mc.steamadvantage.machines; + +import cyano.poweradvantage.api.ConduitType; +import cyano.poweradvantage.api.PoweredEntity; +import zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.steamadvantage.init.Power; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + + + +public class ElectricBoilerBlock extends cyano.poweradvantage.api.simple.BlockSimplePowerMachine{ + + + public ElectricBoilerBlock() { + super(Material.PISTON, 0.75f, Power.steam_power, ElectricBoilerTileEntity.ELECTRIC_POWER, Fluids.fluidConduit_general); + } + + @Override + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { + return new ElectricBoilerTileEntity(); + } + + @Override + public boolean hasComparatorInputOverride(IBlockState bs) { + return true; + } + + @Override + public int getComparatorInputOverride(IBlockState bs, World world, BlockPos coord) { + if(world.getTileEntity(coord) instanceof ElectricBoilerTileEntity){ + return ((ElectricBoilerTileEntity)world.getTileEntity(coord)).getComparatorOutput(); + } + return 0; + } + + @Override + public boolean isPowerSink(ConduitType type){ + return !ConduitType.areSameType(Power.steam_power, type); + } + + @Override + public boolean isPowerSource(ConduitType type){ + return ConduitType.areSameType(Power.steam_power, type); + } + + +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/ElectricBoilerTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/ElectricBoilerTileEntity.java similarity index 89% rename from src/main/java/com/mcmoddev/steamadvantage/machines/ElectricBoilerTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/ElectricBoilerTileEntity.java index 9ffcd33..cfbfb33 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/ElectricBoilerTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/ElectricBoilerTileEntity.java @@ -1,24 +1,24 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PowerRequest; import cyano.poweradvantage.api.fluid.FluidRequest; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.SoundCategory; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.FluidTankInfo; -import com.mcmoddev.steamadvantage.util.LegacyFluidHandler; +import net.minecraft.fluid.Fluid; + +import cyano.poweradvantage.api.fluid.FluidStack; +import cyano.poweradvantage.api.fluid.FluidTank; +import cyano.poweradvantage.api.fluid.FluidTankInfo; +import zone.moddev.mc.steamadvantage.util.LegacyFluidHandler; @SuppressWarnings("deprecation") public class ElectricBoilerTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine implements LegacyFluidHandler{ @@ -37,10 +37,10 @@ public class ElectricBoilerTileEntity extends cyano.poweradvantage.api.simple.Ti private final int[] dataSyncArray = new int[3]; public ElectricBoilerTileEntity() { - super(new ConduitType[]{Power.steam_power, ELECTRIC_POWER, Fluids.fluidConduit_general}, + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_BOILER_ELECTRIC, new ConduitType[]{Power.steam_power, ELECTRIC_POWER, Fluids.fluidConduit_general}, new float[]{100, MAX_ELECTRICITY, 1000}, "tile.steamadvantage.steam_boiler_electric.name"); - tank = new FluidTank(Fluid.BUCKET_VOLUME * 2); + tank = new FluidTank(FluidTank.BUCKET_VOLUME * 2); inventory = new ItemStack[0]; } @@ -164,7 +164,7 @@ public void prepareDataFieldsForSync() { @Override public void onDataFieldUpdate() { this.setEnergy(Float.intBitsToFloat(dataSyncArray[0]), Power.steam_power); - this.getTank().setFluid(new FluidStack(FluidRegistry.WATER,dataSyncArray[1])); + this.getTank().setFluid(new FluidStack(net.minecraft.init.Fluids.WATER,dataSyncArray[1])); this.setEnergy(Float.intBitsToFloat(dataSyncArray[2]),ELECTRIC_POWER); } @@ -174,8 +174,8 @@ public void onDataFieldUpdate() { * @param tagRoot An NBT tag */ @Override - public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { - super.writeToNBT(tagRoot); + public NBTTagCompound write(final NBTTagCompound tagRoot) { + super.write(tagRoot); NBTTagCompound tankTag = new NBTTagCompound(); this.getTank().writeToNBT(tankTag); tagRoot.setTag("Tank", tankTag); @@ -187,13 +187,13 @@ public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { * @param tagRoot An NBT tag */ @Override - public void readFromNBT(final NBTTagCompound tagRoot) { - super.readFromNBT(tagRoot); + public void read(final NBTTagCompound tagRoot) { + super.read(tagRoot); if (tagRoot.hasKey("Tank")) { - NBTTagCompound tankTag = tagRoot.getCompoundTag("Tank"); + NBTTagCompound tankTag = tagRoot.getCompound("Tank"); getTank().readFromNBT(tankTag); if(tankTag.hasKey("Empty")){ - // empty the tank if NBT says its empty (not default behavior of Tank.readFromNBT(...) ) + // empty the tank if NBT says its empty (not default behavior of Tank.read(...) ) getTank().setFluid(null); } } @@ -229,7 +229,7 @@ public boolean isPowerSource(ConduitType type){ @Override public float addEnergy(float amount, ConduitType type){ if(Fluids.isFluidType(type)){ - if(Fluids.conduitTypeToFluid(type) == FluidRegistry.WATER){ + if(Fluids.conduitTypeToFluid(type) == net.minecraft.init.Fluids.WATER){ if(this.canFill(null, Fluids.conduitTypeToFluid(type))){ return this.fill(null, new FluidStack(Fluids.conduitTypeToFluid(type),(int)amount), true); } else { @@ -277,7 +277,7 @@ public float subtractEnergy(float amount, ConduitType type){ @Override public PowerRequest getPowerRequest(ConduitType offer) { - if(Fluids.isFluidType(offer) && Fluids.conduitTypeToFluid(offer) == FluidRegistry.WATER){ + if(Fluids.isFluidType(offer) && Fluids.conduitTypeToFluid(offer) == net.minecraft.init.Fluids.WATER){ PowerRequest request = new FluidRequest(FluidRequest.MEDIUM_PRIORITY+1, (getTank().getCapacity() - getTank().getFluidAmount()), this); @@ -342,7 +342,7 @@ public FluidStack drain(EnumFacing face, int amount, boolean forReal) { */ @Override public boolean canFill(EnumFacing face, Fluid fluid) { - if(fluid != FluidRegistry.WATER) return false; + if(fluid != net.minecraft.init.Fluids.WATER) return false; if(getTank().getFluid() == null) return true; return getTank().getFluidAmount() <= getTank().getCapacity() && fluid.equals(getTank().getFluid().getFluid()); } diff --git a/src/main/java/zone/moddev/mc/steamadvantage/machines/GeothermalBoilerBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/GeothermalBoilerBlock.java new file mode 100644 index 0000000..9abde1d --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/GeothermalBoilerBlock.java @@ -0,0 +1,49 @@ +package zone.moddev.mc.steamadvantage.machines; + +import cyano.poweradvantage.api.ConduitType; +import cyano.poweradvantage.api.PoweredEntity; +import zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.steamadvantage.init.Power; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class GeothermalBoilerBlock extends cyano.poweradvantage.api.simple.BlockSimplePowerMachine{ + + public GeothermalBoilerBlock() { + super(Material.PISTON, 0.75f, Power.steam_power, Fluids.fluidConduit_general); + } + + @Override + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { + return new GeothermalBoilerTileEntity(); + } + + @Override + public boolean hasComparatorInputOverride(IBlockState bs) { + return true; + } + + @Override + public int getComparatorInputOverride(IBlockState bs, World world, BlockPos coord) { + if(world.getTileEntity(coord) instanceof GeothermalBoilerTileEntity){ + return ((GeothermalBoilerTileEntity)world.getTileEntity(coord)).getComparatorOutput(); + } + return 0; + } +///// Overrides to make this a multi-type block ///// +@Override +public boolean isPowerSink(ConduitType type){ + return !ConduitType.areSameType(Power.steam_power, type); +} + + @Override + public boolean isPowerSource(ConduitType type){ + return ConduitType.areSameType(Power.steam_power, type); + } + ///// end multi-type overrides ///// + +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/GeothermalBoilerTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/GeothermalBoilerTileEntity.java similarity index 88% rename from src/main/java/com/mcmoddev/steamadvantage/machines/GeothermalBoilerTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/GeothermalBoilerTileEntity.java index da16c11..399b7f7 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/GeothermalBoilerTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/GeothermalBoilerTileEntity.java @@ -1,12 +1,12 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; -import com.mcmoddev.steamadvantage.util.LegacyFluidHandler; +import zone.moddev.mc.steamadvantage.util.LegacyFluidHandler; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PowerRequest; import cyano.poweradvantage.api.fluid.FluidRequest; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -16,9 +16,12 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fluids.*; +import net.minecraft.fluid.Fluid; +import cyano.poweradvantage.api.fluid.FluidStack; +import cyano.poweradvantage.api.fluid.FluidTank; +import cyano.poweradvantage.api.fluid.FluidTankInfo; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; @SuppressWarnings("deprecation") public class GeothermalBoilerTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine implements LegacyFluidHandler{ @@ -39,8 +42,8 @@ public class GeothermalBoilerTileEntity extends cyano.poweradvantage.api.simple. private final int[] dataSyncArray = new int[3]; public GeothermalBoilerTileEntity() { - super(new ConduitType[]{Power.steam_power,Fluids.fluidConduit_general}, new float[]{100,1000}, "tile.steamadvantage.steam_boiler_geothermal.name"); - tank = new FluidTank(Fluid.BUCKET_VOLUME * 2); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_BOILER_GEOTHERMAL, new ConduitType[]{Power.steam_power,Fluids.fluidConduit_general}, new float[]{100,1000}, "tile.steamadvantage.steam_boiler_geothermal.name"); + tank = new FluidTank(FluidTank.BUCKET_VOLUME * 2); inventory = new ItemStack[0]; } @@ -106,8 +109,9 @@ private static float thermalEnergy(IBlockState bs){ Block b = bs.getBlock(); if(b == net.minecraft.init.Blocks.FIRE){ return 200; - } else if(FluidRegistry.lookupFluidForBlock(b) != null) { - return Math.max(0, FluidRegistry.lookupFluidForBlock(b).getTemperature() - 372) * 0.5f; + } else if(bs.getFluidState().getFluid().isEquivalentTo(net.minecraft.init.Fluids.LAVA)) { + // Forge 1.13 native fluids no longer expose the old temperature property. + return (1300 - 372) * 0.5f; } else { return 0; } @@ -194,7 +198,7 @@ public void prepareDataFieldsForSync() { @Override public void onDataFieldUpdate() { this.setEnergy(Float.intBitsToFloat(dataSyncArray[0]), Power.steam_power); - this.getTank().setFluid(new FluidStack(FluidRegistry.WATER,dataSyncArray[1])); + this.getTank().setFluid(new FluidStack(net.minecraft.init.Fluids.WATER,dataSyncArray[1])); this.temperature = Float.intBitsToFloat(dataSyncArray[2]); } @@ -204,8 +208,8 @@ public void onDataFieldUpdate() { * @param tagRoot An NBT tag */ @Override - public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { - super.writeToNBT(tagRoot); + public NBTTagCompound write(final NBTTagCompound tagRoot) { + super.write(tagRoot); NBTTagCompound tankTag = new NBTTagCompound(); this.getTank().writeToNBT(tankTag); tagRoot.setTag("Tank", tankTag); @@ -217,13 +221,13 @@ public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { * @param tagRoot An NBT tag */ @Override - public void readFromNBT(final NBTTagCompound tagRoot) { - super.readFromNBT(tagRoot); + public void read(final NBTTagCompound tagRoot) { + super.read(tagRoot); if (tagRoot.hasKey("Tank")) { - NBTTagCompound tankTag = tagRoot.getCompoundTag("Tank"); + NBTTagCompound tankTag = tagRoot.getCompound("Tank"); getTank().readFromNBT(tankTag); if(tankTag.hasKey("Empty")){ - // empty the tank if NBT says its empty (not default behavior of Tank.readFromNBT(...) ) + // empty the tank if NBT says its empty (not default behavior of Tank.read(...) ) getTank().setFluid(null); } } @@ -261,7 +265,7 @@ public boolean isPowerSource(ConduitType type){ @Override public float addEnergy(float amount, ConduitType type){ if(Fluids.isFluidType(type)){ - if(Fluids.conduitTypeToFluid(type) == FluidRegistry.WATER){ + if(Fluids.conduitTypeToFluid(type) == net.minecraft.init.Fluids.WATER){ if(this.canFill(null, Fluids.conduitTypeToFluid(type))){ return this.fill(null, new FluidStack(Fluids.conduitTypeToFluid(type),(int)amount), true); } else { @@ -309,7 +313,7 @@ public float subtractEnergy(float amount, ConduitType type){ @Override public PowerRequest getPowerRequest(ConduitType offer) { - if(Fluids.conduitTypeToFluid(offer) == FluidRegistry.WATER){ + if(Fluids.conduitTypeToFluid(offer) == net.minecraft.init.Fluids.WATER){ PowerRequest request = new FluidRequest(FluidRequest.MEDIUM_PRIORITY+1, (getTank().getCapacity() - getTank().getFluidAmount()), this); @@ -374,7 +378,7 @@ public FluidStack drain(EnumFacing face, int amount, boolean forReal) { */ @Override public boolean canFill(EnumFacing face, Fluid fluid) { - if(fluid != FluidRegistry.WATER) return false; + if(fluid != net.minecraft.init.Fluids.WATER) return false; if(getTank().getFluid() == null) return true; return getTank().getFluidAmount() <= getTank().getCapacity() && fluid.equals(getTank().getFluid().getFluid()); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/OilBoilerBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/OilBoilerBlock.java similarity index 51% rename from src/main/java/com/mcmoddev/steamadvantage/machines/OilBoilerBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/OilBoilerBlock.java index c8137d2..c614ddb 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/OilBoilerBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/OilBoilerBlock.java @@ -1,10 +1,10 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; @@ -26,7 +26,7 @@ public OilBoilerBlock() { } @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { return new OilBoilerTileEntity(); } @@ -56,32 +56,5 @@ public boolean isPowerSink(ConduitType type){ public boolean isPowerSource(ConduitType type){ return ConduitType.areSameType(Power.steam_power, type); } - /** - * This method is called whenever the block is placed into the world - */ - @Override - public void onBlockAdded(World w, BlockPos coord, IBlockState state){ - super.onBlockAdded(w, coord, state); - ConduitRegistry.getInstance().conduitBlockPlacedEvent(w, w.provider.getDimension(), coord, com.mcmoddev.poweradvantage.init.Fluids.fluidConduit_general); - } - - /** - * This method is called when the block is removed from the world by an entity. - */ - @Override - public void onPlayerDestroy(World w, BlockPos coord, IBlockState state){ - super.onPlayerDestroy(w, coord, state); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - /** - * This method is called when the block is destroyed by an explosion. - */ - @Override - public void onBlockExploded(World w, BlockPos coord, Explosion boom){ - super.onBlockExploded(w, coord, boom); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - - ///// end multi-type overrides ///// } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/OilBoilerTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/OilBoilerTileEntity.java similarity index 80% rename from src/main/java/com/mcmoddev/steamadvantage/machines/OilBoilerTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/OilBoilerTileEntity.java index d402c1e..b3f8684 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/OilBoilerTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/OilBoilerTileEntity.java @@ -1,35 +1,40 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; -import com.mcmoddev.poweradvantage.util.FluidIdHelper; +import zone.moddev.mc.poweradvantage.util.FluidIdHelper; -import com.mcmoddev.steamadvantage.util.LegacyFluidHandler; +import zone.moddev.mc.steamadvantage.util.LegacyFluidHandler; import cyano.poweradvantage.api.ConduitType; +import cyano.poweradvantage.api.FluidCategoryRegistry; import cyano.poweradvantage.api.PowerRequest; import cyano.poweradvantage.api.fluid.FluidRequest; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.poweradvantage.registry.FuelRegistry; -import com.mcmoddev.steamadvantage.SteamAdvantage; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.poweradvantage.registry.FuelRegistry; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.SoundCategory; -import net.minecraftforge.common.ForgeModContainer; -import net.minecraftforge.fluids.*; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.registry.IRegistry; +import net.minecraft.fluid.Fluid; +import cyano.poweradvantage.api.fluid.FluidStack; +import cyano.poweradvantage.api.fluid.FluidTank; +import cyano.poweradvantage.api.fluid.FluidTankInfo; import java.util.HashMap; import java.util.Map; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; @SuppressWarnings("deprecation") public class OilBoilerTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine implements LegacyFluidHandler{ - public static final int FLUID_BURN_ALIQUOT = Fluid.BUCKET_VOLUME / 10; // number of fluid units burned at a time + public static final int FLUID_BURN_ALIQUOT = FluidTank.BUCKET_VOLUME / 10; // number of fluid units burned at a time private final FluidTank waterTank; private final FluidTank fuelTank; @@ -40,9 +45,9 @@ public class OilBoilerTileEntity extends cyano.poweradvantage.api.simple.TileEnt private final int[] dataSyncArray = new int[6]; public OilBoilerTileEntity() { - super(new ConduitType[]{Power.steam_power, Fluids.fluidConduit_general}, new float[]{1000,1000}, "tile.steamadvantage.steam_boiler_oil.name"); - waterTank = new FluidTank(Fluid.BUCKET_VOLUME * 4); - fuelTank = new FluidTank(Fluid.BUCKET_VOLUME * 4); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_BOILER_OIL, new ConduitType[]{Power.steam_power, Fluids.fluidConduit_general}, new float[]{1000,1000}, "tile.steamadvantage.steam_boiler_oil.name"); + waterTank = new FluidTank(FluidTank.BUCKET_VOLUME * 4); + fuelTank = new FluidTank(FluidTank.BUCKET_VOLUME * 4); } private boolean redstone = true; @@ -100,7 +105,7 @@ private void energyDecay() { private int getFuelBurnTime(Fluid fluid, int amount) { - return (int)(getBurnTimePerBucketFor(fluid) * amount / Fluid.BUCKET_VOLUME); + return (int)(getBurnTimePerBucketFor(fluid) * amount / FluidTank.BUCKET_VOLUME); } private static Float getBurnTimePerBucketFor(Fluid fluid){ @@ -115,8 +120,9 @@ private static Float getBurnTimePerBucketFor(Fluid fluid){ return fuelPerBucket; } // second, check universal bucket fuel registry - int vol = ForgeModContainer.getInstance().universalBucket.getCapacity(); - ItemStack bucket = FluidUtil.getFilledBucket(new FluidStack(fluid, vol)); + int vol = FluidTank.BUCKET_VOLUME; + ItemStack bucket = fluid.getFilledBucket() == net.minecraft.init.Items.AIR + ? ItemStack.EMPTY : new ItemStack(fluid.getFilledBucket()); if(bucket.isEmpty()){ flammibilityCache.put(fluid,0f); return 0f; @@ -137,11 +143,16 @@ private static Float getBurnTimePerBucketFor(Fluid fluid){ } private static Float getConfiguredBurnTimePerBucketFor(Fluid fluid) { - if(SteamAdvantage.fluidBurnValues.containsKey(fluid.getName())){ - return SteamAdvantage.fluidBurnValues.get(fluid.getName()); + ResourceLocation id = IRegistry.field_212619_h.getKey(fluid); + if (id != null) { + if (SteamAdvantage.fluidBurnValues.containsKey(id.toString())) return SteamAdvantage.fluidBurnValues.get(id.toString()); + if (SteamAdvantage.fluidBurnValues.containsKey(id.getPath())) return SteamAdvantage.fluidBurnValues.get(id.getPath()); } - if(SteamAdvantage.fluidBurnValues.containsKey(fluid.getUnlocalizedName())){ - return SteamAdvantage.fluidBurnValues.get(fluid.getUnlocalizedName()); + if (FluidCategoryRegistry.matches(FluidCategoryRegistry.CRUDE_OIL, fluid)) { + for (String alias : FluidCategoryRegistry.getAliases(FluidCategoryRegistry.CRUDE_OIL)) { + Float configured = SteamAdvantage.fluidBurnValues.get(alias); + if (configured != null) return configured; + } } return null; } @@ -230,13 +241,13 @@ public void prepareDataFieldsForSync() { dataSyncArray[4] = this.getFuelTank().getFluidAmount(); dataSyncArray[5] = (getFuelTank().getFluid() != null && getFuelTank().getFluid().getFluid() != null ? FluidIdHelper.getFluidId(getFuelTank().getFluid().getFluid()) - : FluidIdHelper.getFluidId(FluidRegistry.WATER)); + : FluidIdHelper.getFluidId(net.minecraft.init.Fluids.WATER)); } @Override public void onDataFieldUpdate() { this.setEnergy(Float.intBitsToFloat(dataSyncArray[0]), Power.steam_power); - this.getWaterTank().setFluid(new FluidStack(FluidRegistry.WATER,dataSyncArray[1])); + this.getWaterTank().setFluid(new FluidStack(net.minecraft.init.Fluids.WATER,dataSyncArray[1])); this.burnTime = dataSyncArray[2]; this.totalBurnTime = dataSyncArray[3]; this.getFuelTank().setFluid(new FluidStack(FluidIdHelper.getFluid(dataSyncArray[5]),dataSyncArray[4])); @@ -248,16 +259,16 @@ public void onDataFieldUpdate() { * @param tagRoot An NBT tag */ @Override - public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { - super.writeToNBT(tagRoot); + public NBTTagCompound write(final NBTTagCompound tagRoot) { + super.write(tagRoot); NBTTagCompound tankTag = new NBTTagCompound(); this.getWaterTank().writeToNBT(tankTag); tagRoot.setTag("WaterTank", tankTag); NBTTagCompound tankTag2 = new NBTTagCompound(); this.getFuelTank().writeToNBT(tankTag2); tagRoot.setTag("FuelTank", tankTag2); - if(this.burnTime > 0)tagRoot.setInteger("BurnTime", this.burnTime); - if(this.totalBurnTime > 0)tagRoot.setInteger("BurnTimeTotal", this.totalBurnTime); + if(this.burnTime > 0)tagRoot.setInt("BurnTime", this.burnTime); + if(this.totalBurnTime > 0)tagRoot.setInt("BurnTimeTotal", this.totalBurnTime); return tagRoot; } /** @@ -265,31 +276,31 @@ public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { * @param tagRoot An NBT tag */ @Override - public void readFromNBT(final NBTTagCompound tagRoot) { - super.readFromNBT(tagRoot); + public void read(final NBTTagCompound tagRoot) { + super.read(tagRoot); if (tagRoot.hasKey("WaterTank")) { - NBTTagCompound tankTag = tagRoot.getCompoundTag("WaterTank"); + NBTTagCompound tankTag = tagRoot.getCompound("WaterTank"); getWaterTank().readFromNBT(tankTag); if(tankTag.hasKey("Empty")){ - // empty the tank if NBT says its empty (not default behavior of Tank.readFromNBT(...) ) + // empty the tank if NBT says its empty (not default behavior of Tank.read(...) ) getWaterTank().setFluid(null); } } if (tagRoot.hasKey("FuelTank")) { - NBTTagCompound tankTag = tagRoot.getCompoundTag("FuelTank"); + NBTTagCompound tankTag = tagRoot.getCompound("FuelTank"); getFuelTank().readFromNBT(tankTag); if(tankTag.hasKey("Empty")){ - // empty the tank if NBT says its empty (not default behavior of Tank.readFromNBT(...) ) + // empty the tank if NBT says its empty (not default behavior of Tank.read(...) ) getFuelTank().setFluid(null); } } if(tagRoot.hasKey("BurnTime")){ - this.burnTime = tagRoot.getInteger("BurnTime"); + this.burnTime = tagRoot.getInt("BurnTime"); } else { this.burnTime = 0; } if(tagRoot.hasKey("BurnTimeTotal")){ - this.totalBurnTime = tagRoot.getInteger("BurnTimeTotal"); + this.totalBurnTime = tagRoot.getInt("BurnTimeTotal"); } else { this.totalBurnTime = 0; } @@ -339,7 +350,7 @@ public float addEnergy(float amount, ConduitType type){ public void setEnergy(float amount,ConduitType type) { if(Fluids.isFluidType(type) && !ConduitType.areSameType(Fluids.fluidConduit_general,type)){ Fluid f = Fluids.conduitTypeToFluid(type); - if(f == FluidRegistry.WATER){ + if(f == net.minecraft.init.Fluids.WATER){ this.getWaterTank().setFluid(new FluidStack(f,(int)amount)); }else{ this.getFuelTank().setFluid(new FluidStack(f,(int)amount)); @@ -372,7 +383,7 @@ public float subtractEnergy(float amount, ConduitType type){ @Override public PowerRequest getPowerRequest(ConduitType offer) { if(this.redstone) return PowerRequest.REQUEST_NOTHING; - if(Fluids.conduitTypeToFluid(offer) == FluidRegistry.WATER){ + if(Fluids.conduitTypeToFluid(offer) == net.minecraft.init.Fluids.WATER){ PowerRequest request = new FluidRequest(FluidRequest.MEDIUM_PRIORITY+1, (getWaterTank().getCapacity() - getWaterTank().getFluidAmount()), this); @@ -403,7 +414,7 @@ public PowerRequest getPowerRequest(ConduitType offer) { @Override public int fill(EnumFacing face, FluidStack fluid, boolean forReal) { if(fluid == null) return 0; - if(fluid.getFluid() == FluidRegistry.WATER){ + if(fluid.getFluid() == net.minecraft.init.Fluids.WATER){ if(getWaterTank().getFluidAmount() <= 0 || getWaterTank().getFluid().getFluid().equals(fluid.getFluid())){ return getWaterTank().fill(fluid, forReal); } @@ -423,7 +434,7 @@ public int fill(EnumFacing face, FluidStack fluid, boolean forReal) { @Override public FluidStack drain(EnumFacing face, FluidStack fluid, boolean forReal) { if(fluid == null) return null; - if(fluid.getFluid() == FluidRegistry.WATER && getWaterTank().getFluidAmount() > 0 && getWaterTank().getFluid().getFluid().equals(FluidRegistry.WATER)){ + if(fluid.getFluid() == net.minecraft.init.Fluids.WATER && getWaterTank().getFluidAmount() > 0 && getWaterTank().getFluid().getFluid().equals(net.minecraft.init.Fluids.WATER)){ return getWaterTank().drain(fluid.amount,forReal); } else if(getFuelTank().getFluidAmount() > 0 && getFuelTank().getFluid().getFluid().equals(fluid.getFluid())){ return getFuelTank().drain(fluid.amount,forReal); @@ -454,7 +465,7 @@ public FluidStack drain(EnumFacing face, int amount, boolean forReal) { */ @Override public boolean canFill(EnumFacing face, Fluid fluid) { - if(fluid == FluidRegistry.WATER) { + if(fluid == net.minecraft.init.Fluids.WATER) { if(getWaterTank().getFluidAmount() <= 0) return true; return getWaterTank().getFluidAmount() <= getWaterTank().getCapacity() && fluid.equals(getWaterTank().getFluid().getFluid()); } else if(getBurnTimePerBucketFor(fluid) > 0){ @@ -471,7 +482,7 @@ public boolean canFill(EnumFacing face, Fluid fluid) { @Override public boolean canDrain(EnumFacing face, Fluid fluid) { if(fluid == null) return false; - if(fluid == FluidRegistry.WATER) { + if(fluid == net.minecraft.init.Fluids.WATER) { return getWaterTank().getFluidAmount() > 0 && fluid.equals(getWaterTank().getFluid().getFluid()); } else { return getFuelTank().getFluidAmount() > 0 && fluid.equals(getFuelTank().getFluid().getFluid()); diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/RockCrusherBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/RockCrusherBlock.java similarity index 85% rename from src/main/java/com/mcmoddev/steamadvantage/machines/RockCrusherBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/RockCrusherBlock.java index 8f0f5ae..d8b8079 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/RockCrusherBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/RockCrusherBlock.java @@ -1,8 +1,8 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; @@ -21,7 +21,7 @@ public RockCrusherBlock() { } @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { return new RockCrusherTileEntity(); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/RockCrusherTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/RockCrusherTileEntity.java similarity index 89% rename from src/main/java/com/mcmoddev/steamadvantage/machines/RockCrusherTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/RockCrusherTileEntity.java index 3236fad..13f4598 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/RockCrusherTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/RockCrusherTileEntity.java @@ -1,4 +1,4 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import net.minecraft.entity.player.EntityPlayer; @@ -6,11 +6,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; -import com.mcmoddev.steamadvantage.compat.BaseMetalsCompat; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.steamadvantage.compat.BaseMetalsCompat; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.util.SoundCategory; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; public class RockCrusherTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine{ @@ -25,7 +25,7 @@ public class RockCrusherTileEntity extends cyano.poweradvantage.api.simple.TileE private int progress = 0; public RockCrusherTileEntity() { - super(Power.steam_power, 50, "tile.steamadvantage.steam_crusher.name"); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_CRUSHER, Power.steam_power, 50, "tile.steamadvantage.steam_crusher.name"); allSlots = new int[inventory.length]; for(int i = 0; i < allSlots.length; i++){ allSlots[i] = i; @@ -131,7 +131,7 @@ private void energyDecay() { private ItemStack getCrusherRecipeOutput(ItemStack item) { if(item == null) return null; - return BaseMetalsCompat.getCrusherRecipeOutput(item); + return BaseMetalsCompat.getCrusherRecipeOutput(getWorld(), item); } private boolean hasRedstoneSignal() { @@ -182,15 +182,15 @@ private int canAddToOutputInventory(ItemStack output) { } @Override - public NBTTagCompound writeToNBT(NBTTagCompound tagRoot){ - super.writeToNBT(tagRoot); + public NBTTagCompound write(NBTTagCompound tagRoot){ + super.write(tagRoot); tagRoot.setShort("progress",(short)progress); return tagRoot; } @Override - public void readFromNBT(NBTTagCompound tagRoot){ - super.readFromNBT(tagRoot); + public void read(NBTTagCompound tagRoot){ + super.read(tagRoot); if(tagRoot.hasKey("progress")){ progress = tagRoot.getShort("progress"); } @@ -200,7 +200,7 @@ public void readFromNBT(NBTTagCompound tagRoot){ public int getComparatorOutput() { if(inventory[0] == null) return 0; - return Math.min(Math.max(15 * inventory[0].getCount() * inventory[0].getMaxStackSize() / inventory[0].getMaxStackSize(),1),15); + return Math.min(15, 1 + 14 * inventory[0].getCount() / inventory[0].getMaxStackSize()); } ///// Item Handling (for hoppers) ///// @@ -224,7 +224,7 @@ public boolean canInsertItem(final int slot, final ItemStack srcItem, final Enum public boolean isItemValidForSlot(final int slot, final ItemStack item) { switch(slot){ case 0: - return BaseMetalsCompat.hasCrusherRecipe(item); + return BaseMetalsCompat.hasCrusherRecipe(getWorld(), item); case 1: case 2: case 3: diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamDrillBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamDrillBlock.java similarity index 63% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamDrillBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamDrillBlock.java index fa51efc..5ac1aea 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamDrillBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamDrillBlock.java @@ -1,19 +1,20 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.*; import cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine; -import com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry; -import com.mcmoddev.steamadvantage.blocks.DrillBitTileEntity; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry; +import zone.moddev.mc.steamadvantage.blocks.DrillBitTileEntity; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.IProperty; -import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.state.DirectionProperty; +import net.minecraft.state.StateContainer; +import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; @@ -28,39 +29,46 @@ public class SteamDrillBlock extends GUIBlock implements ITypedConduit { /** * Blockstate property */ - public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final DirectionProperty FACING = BlockStateProperties.FACING; public SteamDrillBlock(){ super(Material.PISTON); this.setPowerAdvantageHardness(0.75f); - this.setDefaultState(getDefaultState().withProperty(FACING, EnumFacing.DOWN)); + this.setDefaultState(getStateContainer().getBaseState().with(FACING, EnumFacing.DOWN)); } /** * Override of default block behavior */ @Override - public void onBlockAdded(final World world, final BlockPos coord, final IBlockState state) { - super.onBlockAdded(world, coord, state); - ConduitRegistry.getInstance().conduitBlockPlacedEvent(world, world.provider.getDimension(), coord, Power.steam_power); + public void onBlockAdded(final IBlockState state, final World world, final BlockPos coord, final IBlockState oldState) { + super.onBlockAdded(state, world, coord, oldState); + ConduitRegistry.getInstance().conduitBlockPlacedEvent(world, world.dimension.getType().getId(), coord, Power.steam_power); } /** * This method is called when the block is removed from the world by an entity. */ @Override - public void onPlayerDestroy(World w, BlockPos coord, IBlockState state){ - super.onPlayerDestroy(w, coord, state); - destroyNeighbors(w,coord,w.getBlockState(coord)); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Power.steam_power); + public void onReplaced(IBlockState state, World w, BlockPos coord, IBlockState newState, boolean isMoving){ + if (state.getBlock() != newState.getBlock()) { + destroyNeighbors(w, coord, state); + ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.dimension.getType().getId(), coord, Power.steam_power); + TileEntity tileEntity = w.getTileEntity(coord); + if (tileEntity instanceof TileEntitySimplePowerMachine) { + InventoryHelper.dropInventoryItems(w, coord, (IInventory) tileEntity); + w.updateComparatorOutputLevel(coord, this); + } + } + super.onReplaced(state, w, coord, newState, isMoving); } /** * This method is called when the block is destroyed by an explosion. */ @Override - public void onBlockExploded(World w, BlockPos coord, Explosion boom){ - super.onBlockExploded(w, coord, boom); + public void onExplosionDestroy(World w, BlockPos coord, Explosion boom){ destroyNeighbors(w,coord,w.getBlockState(coord)); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Power.steam_power); + ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.dimension.getType().getId(), coord, Power.steam_power); + super.onExplosionDestroy(w, coord, boom); } @@ -83,7 +91,7 @@ private void destroyNeighbors(World w, BlockPos coord, IBlockState state) { * TileEntitySimplePowerConsumer. */ @Override - public PoweredEntity createNewTileEntity(final World world, final int metaDataValue){ + public PoweredEntity createNewTileEntity(final net.minecraft.world.IBlockReader world){ return new SteamDrillTileEntity(); } @@ -114,20 +122,12 @@ public boolean isPowerSource(ConduitType t){ /** * Override of default block behavior */ - @Override - public Item getItemDropped(final IBlockState state, final Random prng, final int i3) { - return Item.getItemFromBlock(this); - } - - /** * Creates the blockstate of this block when it is placed in the world */ @Override - public IBlockState getStateForPlacement(final World world, final BlockPos coord, final EnumFacing facing, - final float f1, final float f2, final float f3, - final int meta, final EntityLivingBase player) { - return this.getDefaultState().withProperty( FACING, facing.getOpposite()); + public IBlockState getStateForPlacement(final BlockItemUseContext context) { + return this.getDefaultState().with(FACING, context.getFace().getOpposite()); } /** @@ -139,7 +139,7 @@ public void onBlockPlacedBy(final World world, final BlockPos coord, final IBloc if (srcItemStack.hasDisplayName()) { final TileEntity tileEntity = world.getTileEntity(coord); if (tileEntity instanceof PoweredEntity){ - ((PoweredEntity)tileEntity).setCustomInventoryName(srcItemStack.getDisplayName()); + ((PoweredEntity)tileEntity).setCustomInventoryName(srcItemStack.getDisplayName().getString()); } } } @@ -152,17 +152,6 @@ public void onBlockPlacedBy(final World world, final BlockPos coord, final IBloc * Destroys the TileEntity associated with this block when this block * breaks. */ - @Override - public void breakBlock(final World world, final BlockPos coord, final IBlockState bs) { - final TileEntity tileEntity = world.getTileEntity(coord); - if (tileEntity instanceof TileEntitySimplePowerMachine) { - InventoryHelper.dropInventoryItems(world, coord, (IInventory)tileEntity); - world.updateComparatorOutputLevel(coord, this); - } - super.breakBlock(world, coord, bs); - } - - /** * This method tells Minecraft whether this block has a signal that can be * measured by a redstone comparator. @@ -209,30 +198,12 @@ public int getComparatorInputOverride(IBlockState bs, final World world, final B } } - /** - * Converts metadata into blockstate - */ - @Override - public IBlockState getStateFromMeta(final int metaValue) { - EnumFacing enumFacing = EnumFacing.values()[metaValue % EnumFacing.values().length]; - return this.getDefaultState().withProperty( FACING, enumFacing); - } - - /** - * Converts blockstate into metadata - */ - @Override - public int getMetaFromState(final IBlockState bs) { - if(!bs.getProperties().containsKey(FACING)) return EnumFacing.DOWN.getIndex(); - return ((EnumFacing)bs.getValue( FACING)).getIndex(); - } - /** * Creates a blockstate */ @Override - protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] { FACING }); + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(FACING); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamDrillTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamDrillTileEntity.java similarity index 80% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamDrillTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamDrillTileEntity.java index 3382e04..a7fb1e5 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamDrillTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamDrillTileEntity.java @@ -1,11 +1,11 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; -import com.mcmoddev.poweradvantage.util.InventoryWrapper; -import com.mcmoddev.steamadvantage.blocks.DrillBitTileEntity; -import com.mcmoddev.steamadvantage.compat.BaseMetalsCompat; -import com.mcmoddev.steamadvantage.init.Blocks; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.util.InventoryWrapper; +import zone.moddev.mc.steamadvantage.blocks.DrillBitTileEntity; +import zone.moddev.mc.steamadvantage.compat.BaseMetalsCompat; +import zone.moddev.mc.steamadvantage.init.Blocks; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -14,8 +14,10 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; +import net.minecraft.util.NonNullList; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -23,8 +25,8 @@ import java.util.Arrays; import java.util.List; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtPosition; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtPosition; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; @SuppressWarnings("deprecation") public class SteamDrillTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine{ @@ -41,6 +43,7 @@ public class SteamDrillTileEntity extends cyano.poweradvantage.api.simple.TileEn private int progressGoal = 0; private BlockPos targetBlockCoord = null; private IBlockState targetBlockState = null; + private NBTTagCompound savedTargetState = null; private Block targetBlock = null; private List targetBlockItems = null; private EnumFacing oldDir = null; @@ -50,7 +53,7 @@ public class SteamDrillTileEntity extends cyano.poweradvantage.api.simple.TileEn private boolean deferred = false; public SteamDrillTileEntity() { - super(Power.steam_power, 50, "tile.steamadvantage.steam_drill.name"); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_DRILL, Power.steam_power, 50, "tile.steamadvantage.steam_drill.name"); } @@ -59,7 +62,7 @@ public SteamDrillTileEntity() { public void tickUpdate(boolean isServerWorld) { if(isServerWorld){ if(deferred){ - targetBlock(targetBlockCoord); + restoreTargetBlock(); } EnumFacing face = this.getFacing(); if(oldDir == null){ @@ -87,7 +90,7 @@ public void tickUpdate(boolean isServerWorld) { // Mined it! playSoundAtPosition(targetBlockCoord.getX()+0.5, targetBlockCoord.getY()+0.5, targetBlockCoord.getZ()+0.5, targetBlock.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, 0.5f, 1f, this.powerAdvantageWorld()); playSoundAtTileEntity( SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.AMBIENT, 0.5f, 1f, this); - powerAdvantageWorld().setBlockToAir(targetBlockCoord); + powerAdvantageWorld().removeBlock(targetBlockCoord); for(ItemStack item : targetBlockItems){ addItem(item); } @@ -181,11 +184,11 @@ private boolean followTrack(){ } SteamDrillTileEntity te = (SteamDrillTileEntity)movedTile; NBTTagCompound dataTransfer = new NBTTagCompound(); - this.writeToNBT(dataTransfer); - dataTransfer.setInteger("x", nextPos.getX()); - dataTransfer.setInteger("y", nextPos.getY()); - dataTransfer.setInteger("z", nextPos.getZ()); - te.readFromNBT(dataTransfer); + this.write(dataTransfer); + dataTransfer.setInt("x", nextPos.getX()); + dataTransfer.setInt("y", nextPos.getY()); + dataTransfer.setInt("z", nextPos.getZ()); + te.read(dataTransfer); te.setPos(nextPos); te.validate(); te.subtractEnergy(ENERGY_COST_MOVE, Power.steam_power); @@ -194,7 +197,7 @@ private boolean followTrack(){ // replace this block with steam pipe destroyDrillBit(drillDirection); - w.setBlockState(currentPos.offset(drillDirection), com.mcmoddev.poweradvantage.init.Blocks.steel_frame.getDefaultState()); + w.setBlockState(currentPos.offset(drillDirection), zone.moddev.mc.poweradvantage.init.Blocks.steel_frame.getDefaultState()); w.setBlockState(currentPos, Blocks.steam_pipe.getDefaultState(), 2); return true; } @@ -226,7 +229,7 @@ public void onDataFieldUpdate() { private int oldProgress = 0; @Override public void powerUpdate(){ if(deferred){ - targetBlock(targetBlockCoord); + restoreTargetBlock(); } super.powerUpdate(); boolean flagSync = progress != oldProgress || oldEnergy != getEnergy(Power.steam_power); @@ -256,7 +259,7 @@ public void onDataFieldUpdate() { break; } if(powerAdvantageWorld().getBlockState(n).getBlock() != Blocks.drillbit){ - if(powerAdvantageWorld().isAirBlock(n) || powerAdvantageWorld().getBlockState(n).getBlock().isReplaceable(powerAdvantageWorld(), n)){ + if(powerAdvantageWorld().isAirBlock(n) || powerAdvantageWorld().getBlockState(n).getMaterial().isReplaceable()){ // this block is not worth mining, replace it DrillBitTileEntity.createDrillBitBlock(powerAdvantageWorld(), n, f); this.subtractEnergy(ENERGY_COST_DRILLBIT, Power.steam_power); @@ -283,8 +286,8 @@ public void onDataFieldUpdate() { if(hitEnd){ boolean moved = followTrack(); if(moved){ - com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry.getInstance() - .conduitBlockRemovedEvent(powerAdvantageWorld(), powerAdvantageWorld().provider.getDimension(), powerAdvantagePos(), Power.steam_power); + zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry.getInstance() + .conduitBlockRemovedEvent(powerAdvantageWorld(), powerAdvantageWorld().dimension.getType().getId(), powerAdvantagePos(), Power.steam_power); return; } } @@ -313,8 +316,8 @@ public void onDataFieldUpdate() { private void destroyDrillBit(EnumFacing f) { BlockPos n = powerAdvantagePos().offset(f); - while(powerAdvantageWorld().getBlockState(n).getBlock() == com.mcmoddev.steamadvantage.init.Blocks.drillbit){ - powerAdvantageWorld().setBlockToAir(n); + while(powerAdvantageWorld().getBlockState(n).getBlock() == zone.moddev.mc.steamadvantage.init.Blocks.drillbit){ + powerAdvantageWorld().removeBlock(n); n = n.offset(f); } } @@ -324,15 +327,31 @@ private void targetBlock (BlockPos n){ targetBlockCoord = n; progressGoal = this.getBlockStrength(n); targetBlockState = powerAdvantageWorld().getBlockState(n); + savedTargetState = NBTUtil.writeBlockState(targetBlockState); targetBlock = targetBlockState.getBlock(); - ItemStack crusherOutput = BaseMetalsCompat.getCrusherRecipeOutput(targetBlockState); + ItemStack crusherOutput = BaseMetalsCompat.getCrusherRecipeOutput(powerAdvantageWorld(), targetBlockState); if(crusherOutput != null){ targetBlockItems = Arrays.asList(crusherOutput); } else { - targetBlockItems = targetBlock.getDrops(powerAdvantageWorld(), n, powerAdvantageWorld().getBlockState(n), 0); + NonNullList drops = NonNullList.create(); + targetBlock.getDrops(powerAdvantageWorld().getBlockState(n), drops, powerAdvantageWorld(), n, 0); + targetBlockItems = drops; } deferred = false; } + + private void restoreTargetBlock(){ + int savedProgress = progress; + if(savedTargetState != null && !savedTargetState.equals( + NBTUtil.writeBlockState(powerAdvantageWorld().getBlockState(targetBlockCoord)))){ + untargetBlock(); + return; + } + // Rebuild drops and hardness without discarding work saved for this target. + targetBlock(targetBlockCoord); + progress = Math.max(0, Math.min(savedProgress, progressGoal)); + redstone = hasRedstoneSignal(); + } private void deferredTargetBlock (BlockPos n){ targetBlockCoord = n; @@ -340,18 +359,20 @@ private void deferredTargetBlock (BlockPos n){ } private void untargetBlock(){ + deferred = false; progress = 0; progressGoal = 0; targetBlockCoord = null; targetBlock = null; targetBlockState = null; + savedTargetState = null; targetBlockItems = null; } private EnumFacing getFacing(){ IBlockState state = powerAdvantageWorld().getBlockState(powerAdvantagePos()); - if(state.getProperties().containsKey(SteamDrillBlock.FACING)){ - savedFacing = (EnumFacing)state.getValue(SteamDrillBlock.FACING); + if(state.has(SteamDrillBlock.FACING)){ + savedFacing = state.get(SteamDrillBlock.FACING); return savedFacing; } if(savedFacing == null) savedFacing = inferFacing(); @@ -408,17 +429,19 @@ private void inventoryTransfer(BlockPos adj, EnumFacing otherFace) { int[] accessibleSlots = inv.getSlotsForFace(otherFace); if(accessibleSlots.length == 0) return; for(int mySlot = 0; mySlot < this.inventory.length; mySlot++){ - if(this.inventory[mySlot] == null) continue; + if(this.inventory[mySlot] == null || this.inventory[mySlot].isEmpty()) continue; for(int i = 0; i < accessibleSlots.length; i++){ int theirSlot = accessibleSlots[i]; ItemStack theirItem = inv.getStackInSlot(theirSlot); if(inv.canInsertItem(theirSlot, inventory[mySlot], otherFace)){ - if(theirItem == null){ + if(theirItem == null || theirItem.isEmpty()){ ItemStack newItem = inventory[mySlot].copy(); newItem.setCount(1); inv.setInventorySlotContents(theirSlot, newItem); inventory[mySlot].shrink(1); if(inventory[mySlot].isEmpty()) inventory[mySlot] = null; + inv.markDirty(); + this.markDirty(); return; } else if(ItemStack.areItemsEqual(theirItem, inventory[mySlot]) && ItemStack.areItemStackTagsEqual(theirItem, inventory[mySlot]) @@ -427,6 +450,8 @@ private void inventoryTransfer(BlockPos adj, EnumFacing otherFace) { theirItem.grow(1); inventory[mySlot].shrink(1); if(inventory[mySlot].isEmpty()) inventory[mySlot] = null; + inv.markDirty(); + this.markDirty(); return; } } @@ -437,22 +462,24 @@ private void inventoryTransfer(BlockPos adj, EnumFacing otherFace) { } @Override - public NBTTagCompound writeToNBT(NBTTagCompound tagRoot){ - super.writeToNBT(tagRoot); + public NBTTagCompound write(NBTTagCompound tagRoot){ + super.write(tagRoot); tagRoot.setShort("progress",(short)progress); if(powerAdvantageWorld() != null) savedFacing = getFacing(); if(savedFacing != null) tagRoot.setByte("Facing", (byte)savedFacing.getIndex()); if(targetBlockCoord != null){ - tagRoot.setInteger("targetX", targetBlockCoord.getX()); - tagRoot.setInteger("targetY", targetBlockCoord.getY()); - tagRoot.setInteger("targetZ", targetBlockCoord.getZ()); + tagRoot.setInt("targetX", targetBlockCoord.getX()); + tagRoot.setInt("targetY", targetBlockCoord.getY()); + tagRoot.setInt("targetZ", targetBlockCoord.getZ()); + if(savedTargetState != null) tagRoot.setTag("TargetState", savedTargetState.copy()); } return tagRoot; } @Override - public void readFromNBT(NBTTagCompound tagRoot){ - super.readFromNBT(tagRoot); + public void read(NBTTagCompound tagRoot){ + super.read(tagRoot); + untargetBlock(); if(tagRoot.hasKey("Facing")){ int facingIndex = tagRoot.getByte("Facing"); if(facingIndex >= 0 && facingIndex < EnumFacing.values().length){ @@ -463,14 +490,16 @@ public void readFromNBT(NBTTagCompound tagRoot){ progress = tagRoot.getShort("progress"); } if(tagRoot.hasKey("targetX") && tagRoot.hasKey("targetY") && tagRoot.hasKey("targetZ")){ - int x = tagRoot.getInteger("targetX"); - int y = tagRoot.getInteger("targetY"); - int z = tagRoot.getInteger("targetZ"); + int x = tagRoot.getInt("targetX"); + int y = tagRoot.getInt("targetY"); + int z = tagRoot.getInt("targetZ"); + savedTargetState = tagRoot.contains("TargetState", 10) ? tagRoot.getCompound("TargetState").copy() : null; // Note: world object for tile entities is set AFTER loading them from NBT if(powerAdvantageWorld() == null){ this.deferredTargetBlock(new BlockPos(x,y,z)); } else { - this.targetBlock(new BlockPos(x,y,z)); + this.deferredTargetBlock(new BlockPos(x,y,z)); + this.restoreTargetBlock(); } } } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamElevatorBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamElevatorBlock.java similarity index 85% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamElevatorBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamElevatorBlock.java index c263b9d..bfc24fe 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamElevatorBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamElevatorBlock.java @@ -1,8 +1,8 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; @@ -21,7 +21,7 @@ public SteamElevatorBlock() { } @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { return new SteamElevatorTileEntity(); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamElevatorTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamElevatorTileEntity.java similarity index 89% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamElevatorTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamElevatorTileEntity.java index 433c7db..d405b16 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamElevatorTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamElevatorTileEntity.java @@ -1,8 +1,8 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; -import com.mcmoddev.steamadvantage.init.Blocks; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.steamadvantage.init.Blocks; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; @@ -14,7 +14,7 @@ import java.util.List; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; public class SteamElevatorTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine{ @@ -29,7 +29,7 @@ public class SteamElevatorTileEntity extends cyano.poweradvantage.api.simple.Til private boolean up = false; public SteamElevatorTileEntity() { - super(Power.steam_power, STEAM_PER_ELEVATOR_MOVE*2, "tile.steamadvantage.steam_elevator.name"); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_ELEVATOR, Power.steam_power, STEAM_PER_ELEVATOR_MOVE*2, "tile.steamadvantage.steam_elevator.name"); } private boolean redstone = true; @@ -99,7 +99,7 @@ private boolean moveDown(){ // remove piston BlockPos i = p.down(); for(; i.getY() > getPos().getY(); i = i.down()){ - getWorld().setBlockToAir(i); + getWorld().removeBlock(i); } // move people List passengers = getWorld().getEntitiesWithinAABB(Entity.class, @@ -167,15 +167,15 @@ public void onDataFieldUpdate() { @Override - public NBTTagCompound writeToNBT(NBTTagCompound tagRoot){ - super.writeToNBT(tagRoot); + public NBTTagCompound write(NBTTagCompound tagRoot){ + super.write(tagRoot); tagRoot.setBoolean("up",up); return tagRoot; } @Override - public void readFromNBT(NBTTagCompound tagRoot){ - super.readFromNBT(tagRoot); + public void read(NBTTagCompound tagRoot){ + super.read(tagRoot); if(tagRoot.hasKey("up")){ up = tagRoot.getBoolean("up"); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamPumpBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamPumpBlock.java similarity index 54% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamPumpBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamPumpBlock.java index ba2e011..a9c08fd 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamPumpBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamPumpBlock.java @@ -1,11 +1,11 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.steamadvantage.init.Blocks; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.steamadvantage.init.Blocks; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; @@ -27,7 +27,7 @@ public SteamPumpBlock() { } @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { return new SteamPumpTileEntity(); } @@ -56,32 +56,16 @@ public boolean isPowerSink(ConduitType type){ public boolean isPowerSource(ConduitType type){ return !ConduitType.areSameType(Power.steam_power, type); } - /** - * This method is called whenever the block is placed into the world - */ @Override - public void onBlockAdded(World w, BlockPos coord, IBlockState state){ - super.onBlockAdded(w, coord, state); - ConduitRegistry.getInstance().conduitBlockPlacedEvent(w, w.provider.getDimension(), coord, com.mcmoddev.poweradvantage.init.Fluids.fluidConduit_general); + public void onReplaced(IBlockState state, World w, BlockPos coord, IBlockState newState, boolean isMoving) { + if (state.getBlock() != newState.getBlock()) destroyPipe(w, coord); + super.onReplaced(state, w, coord, newState, isMoving); } - - /** - * This method is called when the block is removed from the world by an entity. - */ - @Override - public void onPlayerDestroy(World w, BlockPos coord, IBlockState state){ - super.onPlayerDestroy(w, coord, state); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - destroyPipe(w,coord); - } - /** - * This method is called when the block is destroyed by an explosion. - */ + @Override - public void onBlockExploded(World w, BlockPos coord, Explosion boom){ - super.onBlockExploded(w, coord, boom); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - destroyPipe(w,coord); + public void onExplosionDestroy(World w, BlockPos coord, Explosion boom){ + destroyPipe(w, coord); + super.onExplosionDestroy(w, coord, boom); } @@ -90,7 +74,7 @@ private void destroyPipe(World w, BlockPos coord) { // destroy connected drill bits BlockPos c = coord.down(); while(c.getY() > 0 && w.getBlockState(c).getBlock() == Blocks.pump_pipe_steam){ - w.setBlockToAir(c); + w.removeBlock(c); c = c.down(); } } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamPumpTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamPumpTileEntity.java similarity index 83% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamPumpTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamPumpTileEntity.java index 9df5b04..448f3f1 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamPumpTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamPumpTileEntity.java @@ -1,17 +1,15 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; -import com.mcmoddev.poweradvantage.util.FluidIdHelper; +import zone.moddev.mc.poweradvantage.util.FluidIdHelper; -import com.mcmoddev.steamadvantage.util.LegacyFluidHandler; +import zone.moddev.mc.steamadvantage.util.LegacyFluidHandler; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PowerRequest; -import com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.poweradvantage.util.FluidHandlerHelper; -import com.mcmoddev.steamadvantage.init.Power; -import net.minecraft.block.Block; -import net.minecraft.block.BlockLiquid; +import zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.poweradvantage.util.FluidHandlerHelper; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -23,13 +21,16 @@ import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fluids.*; -import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraft.fluid.Fluid; +import cyano.poweradvantage.api.fluid.FluidStack; +import cyano.poweradvantage.api.fluid.FluidTank; +import cyano.poweradvantage.api.fluid.FluidTankInfo; +import cyano.poweradvantage.api.fluid.IAdvantageFluidHandler; import java.util.HashSet; import java.util.Set; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; @SuppressWarnings("deprecation") public class SteamPumpTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine implements LegacyFluidHandler{ @@ -48,8 +49,8 @@ public class SteamPumpTileEntity extends cyano.poweradvantage.api.simple.TileEnt private byte timeUntilNextPump = PUMP_INTERVAL; public SteamPumpTileEntity() { - super(new ConduitType[]{Power.steam_power,Fluids.fluidConduit_general}, new float[]{300f,1000f}, "tile.steamadvantage.steam_pump.name"); - tank = new FluidTank(Fluid.BUCKET_VOLUME); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_PUMP, new ConduitType[]{Power.steam_power,Fluids.fluidConduit_general}, new float[]{300f,1000f}, "tile.steamadvantage.steam_pump.name"); + tank = new FluidTank(FluidTank.BUCKET_VOLUME); } private boolean redstone = true; @@ -65,12 +66,12 @@ public void tickUpdate(boolean isServerWorld) { World w = getWorld(); boolean success = false; BlockPos target = this.getPos().down(); - while(target.getY() > 0 && w.getBlockState(target).getBlock() == com.mcmoddev.steamadvantage.init.Blocks.pump_pipe_steam){ + while(target.getY() > 0 && w.getBlockState(target).getBlock() == zone.moddev.mc.steamadvantage.init.Blocks.pump_pipe_steam){ target = target.down(); } if(target.getY() > 0 && w.isAirBlock(target) && getEnergy(Power.steam_power) >= ENERGY_COST_PIPE){ // place pipe - w.setBlockState(target, com.mcmoddev.steamadvantage.init.Blocks.pump_pipe_steam.getDefaultState()); + w.setBlockState(target, zone.moddev.mc.steamadvantage.init.Blocks.pump_pipe_steam.getDefaultState()); this.subtractEnergy(ENERGY_COST_PIPE, Power.steam_power); timeUntilNextPump = PIPE_INTERVAL; playSoundAtTileEntity( SoundEvents.BLOCK_STONE_PLACE, SoundCategory.BLOCKS, 0.3f, 1f, this); @@ -89,9 +90,9 @@ public void tickUpdate(boolean isServerWorld) { IBlockState blockstate = w.getBlockState(fluidSource); Fluid f = getFluid(blockstate); if(f != null && getEnergy(Power.steam_power) >= cost){ - this.getTank().fill(new FluidStack(f,Fluid.BUCKET_VOLUME), true); + this.getTank().fill(new FluidStack(f,FluidTank.BUCKET_VOLUME), true); this.subtractEnergy(cost, Power.steam_power); - w.setBlockToAir(fluidSource); + w.removeBlock(fluidSource); success = true; } } @@ -116,7 +117,7 @@ public void tickUpdate(boolean isServerWorld) { private Fluid getFluid(IBlockState blockstate) { - return FluidRegistry.lookupFluidForBlock(blockstate.getBlock()); + return blockstate.getFluidState().isEmpty() ? null : blockstate.getFluidState().getFluid(); } @@ -130,7 +131,7 @@ private BlockPos scan(Set searchSpace, BlockPos coord, int limit) { searchSpace.add(coord); BlockPos next; boolean nomore = true; - for(EnumFacing dir : EnumFacing.VALUES){ + for(EnumFacing dir : EnumFacing.values()){ next = coord.offset(dir); if(!searchSpace.contains(next) && isFluidBlock(next)){ coord = next; @@ -145,19 +146,9 @@ private BlockPos scan(Set searchSpace, BlockPos coord, int limit) { } while(searchSpace.size() < limit); return null; } - + private boolean isSourceBlock( BlockPos coord){ - IBlockState bs = getWorld().getBlockState(coord); - Block block = bs.getBlock(); - if(block instanceof IFluidBlock){ - return ((IFluidBlock)block).canDrain(getWorld(),coord); - } else if(block == Blocks.WATER){ - return getWorld().getBlockState(coord).getValue(BlockLiquid.LEVEL) == 0; - } else if(block == Blocks.LAVA){ - return getWorld().getBlockState(coord).getValue(BlockLiquid.LEVEL) == 0; - } else { - return false; - } + return getWorld().getFluidState(coord).isSource(); } @@ -165,8 +156,7 @@ private boolean isSourceBlock( BlockPos coord){ private boolean isFluidBlock(BlockPos coord) { World w = getWorld(); if(w.isBlockLoaded(coord) == false) return false; - Block b = w.getBlockState(coord).getBlock(); - return (b instanceof BlockLiquid || b instanceof IFluidBlock); + return !w.getFluidState(coord).isEmpty(); } @@ -193,7 +183,7 @@ public void powerUpdate(){ FluidStack fluid = getTank().getFluid(); ConduitType type = Fluids.fluidToConduitType(fluid.getFluid()); float availableAmount = getTank().getFluidAmount(); - float delta = ConduitRegistry.transmitPowerToConsumers(availableAmount, com.mcmoddev.poweradvantage.init.Fluids.fluidConduit_general, type, + float delta = ConduitRegistry.transmitPowerToConsumers(availableAmount, zone.moddev.mc.poweradvantage.init.Fluids.fluidConduit_general, type, PowerRequest.LAST_PRIORITY, getWorld(), getPos(), this); if(delta > 0){ getTank().drain(Math.max((int)delta,1),true); // no free energy! @@ -204,17 +194,17 @@ public void powerUpdate(){ EnumFacing dir = EnumFacing.values()[i]; BlockPos nPos = getPos().offset(dir); TileEntity neighbor = getWorld().getTileEntity(nPos); - IFluidHandler handler = FluidHandlerHelper.getHandler(neighbor, dir.getOpposite()); + IAdvantageFluidHandler handler = FluidHandlerHelper.getHandler(neighbor, dir.getOpposite()); if(handler != null){ - int d = handler.fill(fluid,true); + int d = handler.fill(dir.getOpposite(), fluid, true); getTank().drain(Math.max(d,1),true); // no free energy! fluid = getTank().getFluid(); } } } } - // powerUpdate occurs once every 8 world ticks and is scheduled such that neighboring - // machines don't powerUpdate in the same world tick. To reduce network congestion, + // powerUpdate occurs once every 8 world ticks and is scheduled such that neighboring + // machines don't powerUpdate in the same world tick. To reduce network congestion, // I'm doing the synchonization logic here instead of in the tickUpdate method boolean updateFlag = false; @@ -259,7 +249,7 @@ public int[] getDataFieldArray() { public void prepareDataFieldsForSync() { dataSyncArray[0] = Float.floatToRawIntBits(this.getEnergy(Power.steam_power)); dataSyncArray[1] = this.getTank().getFluidAmount(); - dataSyncArray[2] = (this.getTank().getFluidAmount() > 0 ? FluidIdHelper.getFluidId(this.getTank().getFluid().getFluid()) : FluidIdHelper.getFluidId(FluidRegistry.WATER)); + dataSyncArray[2] = (this.getTank().getFluidAmount() > 0 ? FluidIdHelper.getFluidId(this.getTank().getFluid().getFluid()) : FluidIdHelper.getFluidId(net.minecraft.init.Fluids.WATER)); dataSyncArray[3] = this.timeUntilNextPump; } @@ -276,8 +266,8 @@ public void onDataFieldUpdate() { * @param tagRoot An NBT tag */ @Override - public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { - super.writeToNBT(tagRoot); + public NBTTagCompound write(final NBTTagCompound tagRoot) { + super.write(tagRoot); NBTTagCompound tankTag = new NBTTagCompound(); this.getTank().writeToNBT(tankTag); tagRoot.setTag("Tank", tankTag); @@ -289,14 +279,14 @@ public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { * @param tagRoot An NBT tag */ @Override - public void readFromNBT(final NBTTagCompound tagRoot) { - super.readFromNBT(tagRoot); + public void read(final NBTTagCompound tagRoot) { + super.read(tagRoot); String tankKey = tagRoot.hasKey("Tank") ? "Tank" : "TankOut"; if (tagRoot.hasKey(tankKey)) { - NBTTagCompound tankTag = tagRoot.getCompoundTag(tankKey); + NBTTagCompound tankTag = tagRoot.getCompound(tankKey); getTank().readFromNBT(tankTag); if(tankTag.hasKey("Empty")){ - // empty the tank if NBT says its empty (not default behavior of Tank.readFromNBT(...) ) + // empty the tank if NBT says its empty (not default behavior of Tank.read(...) ) getTank().setFluid(null); } } @@ -320,10 +310,10 @@ public boolean isPowerSink(ConduitType type){ @Override public boolean isPowerSource(ConduitType type){ - return com.mcmoddev.poweradvantage.init.Fluids.isFluidType(type); + return zone.moddev.mc.poweradvantage.init.Fluids.isFluidType(type); } /** - * Adds "energy" as a fluid to the FluidTank returned by getTank(). This implementation ignores + * Adds "energy" as a fluid to the FluidTank returned by getTank(). This implementation ignores * all non-fluid energy types. * @param amount amount of energy/fluid to add * @param type the type of energy/fluid being added. @@ -335,14 +325,15 @@ public float addEnergy(float amount, ConduitType type){ if(amount > 0 && this.canFill(null, Fluids.conduitTypeToFluid(type))){ return this.fill(null, new FluidStack(Fluids.conduitTypeToFluid(type),(int)amount), true); } else if (amount < 0 && this.canDrain(null, Fluids.conduitTypeToFluid(type))){ - return -1 * this.drain(null, (int)amount, true).amount; + FluidStack drained = this.drain(null, Math.max(1, (int)-amount), true); + return drained == null ? 0 : -drained.amount; } } return super.addEnergy(amount, type); } - + /** - * Subtracts "energy" as a fluid to the FluidTank returned by getTank(). This implementation + * Subtracts "energy" as a fluid to the FluidTank returned by getTank(). This implementation * ignores all non-fluid energy types. * @param amount amount of energy/fluid to add * @param type the type of energy/fluid being added. diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamStillBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamStillBlock.java similarity index 50% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamStillBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamStillBlock.java index 13ae4ca..ddcd13d 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamStillBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamStillBlock.java @@ -1,10 +1,10 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; @@ -26,7 +26,7 @@ public SteamStillBlock() { } @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { return new SteamStillTileEntity(); } @@ -58,32 +58,5 @@ public boolean isPowerSource(ConduitType type){ return Fluids.isFluidType(type); } - /** - * This method is called whenever the block is placed into the world - */ - @Override - public void onBlockAdded(World w, BlockPos coord, IBlockState state){ - super.onBlockAdded(w, coord, state); - ConduitRegistry.getInstance().conduitBlockPlacedEvent(w, w.provider.getDimension(), coord, com.mcmoddev.poweradvantage.init.Fluids.fluidConduit_general); - } - - /** - * This method is called when the block is removed from the world by an entity. - */ - @Override - public void onPlayerDestroy(World w, BlockPos coord, IBlockState state){ - super.onPlayerDestroy(w, coord, state); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - /** - * This method is called when the block is destroyed by an explosion. - */ - @Override - public void onBlockExploded(World w, BlockPos coord, Explosion boom){ - super.onBlockExploded(w, coord, boom); - ConduitRegistry.getInstance().conduitBlockRemovedEvent(w, w.provider.getDimension(), coord, Fluids.fluidConduit_general); - } - - ///// end multi-type overrides ///// } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamStillTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamStillTileEntity.java similarity index 86% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamStillTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamStillTileEntity.java index 15a4ac9..cbb4702 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamStillTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamStillTileEntity.java @@ -1,26 +1,29 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; -import com.mcmoddev.poweradvantage.util.FluidIdHelper; +import zone.moddev.mc.poweradvantage.util.FluidIdHelper; -import com.mcmoddev.steamadvantage.util.LegacyFluidHandler; +import zone.moddev.mc.steamadvantage.util.LegacyFluidHandler; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PowerRequest; import cyano.poweradvantage.api.fluid.FluidRequest; -import com.mcmoddev.poweradvantage.conduitnetwork.ConduitRegistry; -import com.mcmoddev.poweradvantage.init.Fluids; -import com.mcmoddev.poweradvantage.registry.still.recipe.DistillationRecipe; -import com.mcmoddev.poweradvantage.registry.still.recipe.DistillationRecipeRegistry; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.poweradvantage.conduitnetwork.ConduitRegistry; +import zone.moddev.mc.poweradvantage.init.Fluids; +import zone.moddev.mc.poweradvantage.registry.still.recipe.DistillationRecipe; +import zone.moddev.mc.poweradvantage.registry.still.recipe.DistillationRecipeRegistry; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.SoundCategory; -import net.minecraftforge.fluids.*; +import net.minecraft.fluid.Fluid; +import cyano.poweradvantage.api.fluid.FluidStack; +import cyano.poweradvantage.api.fluid.FluidTank; +import cyano.poweradvantage.api.fluid.FluidTankInfo; -import static com.mcmoddev.steamadvantage.util.SoundHelper.playSoundAtTileEntity; +import static zone.moddev.mc.steamadvantage.util.SoundHelper.playSoundAtTileEntity; @SuppressWarnings("deprecation") public class SteamStillTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine implements LegacyFluidHandler{ @@ -34,9 +37,9 @@ public class SteamStillTileEntity extends cyano.poweradvantage.api.simple.TileEn private final int[] dataSyncArray = new int[5]; public SteamStillTileEntity() { - super(new ConduitType[]{Power.steam_power, Fluids.fluidConduit_general}, new float[]{100,1000}, "tile.steamadvantage.steam_still.name"); - outputTank = new FluidTank(Fluid.BUCKET_VOLUME ); - inputTank = new FluidTank(Fluid.BUCKET_VOLUME); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_STILL, new ConduitType[]{Power.steam_power, Fluids.fluidConduit_general}, new float[]{100,1000}, "tile.steamadvantage.steam_still.name"); + outputTank = new FluidTank(FluidTank.BUCKET_VOLUME ); + inputTank = new FluidTank(FluidTank.BUCKET_VOLUME); } private boolean redstone = true; @@ -48,7 +51,7 @@ public void tickUpdate(boolean isServerWorld) { if(isServerWorld){ // server-side logic if(!redstone){ - if(getInputTank().getFluidAmount() > 0 + if(getInputTank().getFluidAmount() > 0 && getEnergy(Power.steam_power) > steamPerDistill && canDistill(getInputTank().getFluid())){ distill(); @@ -88,14 +91,14 @@ public void powerUpdate(){ if(this.getOutputTank().getFluidAmount() > 0){ ConduitType type = Fluids.fluidToConduitType(getOutputTank().getFluid().getFluid()); float availableAmount = getOutputTank().getFluidAmount(); - float delta = ConduitRegistry.transmitPowerToConsumers(availableAmount, com.mcmoddev.poweradvantage.init.Fluids.fluidConduit_general, type, + float delta = ConduitRegistry.transmitPowerToConsumers(availableAmount, zone.moddev.mc.poweradvantage.init.Fluids.fluidConduit_general, type, this.getMinimumSinkPriority(), getWorld(), getPos(), this); if(delta > 0){ getOutputTank().drain(Math.max((int)delta,1),true); // no free energy! } } - // powerUpdate occurs once every 8 world ticks and is scheduled such that neighboring - // machines don't powerUpdate in the same world tick. To reduce network congestion, + // powerUpdate occurs once every 8 world ticks and is scheduled such that neighboring + // machines don't powerUpdate in the same world tick. To reduce network congestion, // I'm doing the synchonization logic here instead of in the tickUpdate method boolean updateFlag = false; @@ -151,9 +154,9 @@ public int[] getDataFieldArray() { public void prepareDataFieldsForSync() { dataSyncArray[0] = Float.floatToRawIntBits(this.getEnergy(Power.steam_power)); dataSyncArray[1] = this.getOutputTank().getFluidAmount(); - dataSyncArray[2] = FluidIdHelper.getFluidId(this.getOutputTank().getFluidAmount() > 0 ? this.getOutputTank().getFluid().getFluid() : FluidRegistry.WATER); + dataSyncArray[2] = FluidIdHelper.getFluidId(this.getOutputTank().getFluidAmount() > 0 ? this.getOutputTank().getFluid().getFluid() : net.minecraft.init.Fluids.WATER); dataSyncArray[3] = inputTank.getFluidAmount(); - dataSyncArray[4] = FluidIdHelper.getFluidId(inputTank.getFluidAmount() > 0 ? inputTank.getFluid().getFluid() : FluidRegistry.WATER); + dataSyncArray[4] = FluidIdHelper.getFluidId(inputTank.getFluidAmount() > 0 ? inputTank.getFluid().getFluid() : net.minecraft.init.Fluids.WATER); } @Override @@ -169,8 +172,8 @@ public void onDataFieldUpdate() { * @param tagRoot An NBT tag */ @Override - public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { - super.writeToNBT(tagRoot); + public NBTTagCompound write(final NBTTagCompound tagRoot) { + super.write(tagRoot); NBTTagCompound tankTag = new NBTTagCompound(); this.getOutputTank().writeToNBT(tankTag); tagRoot.setTag("TankOut", tankTag); @@ -184,22 +187,22 @@ public NBTTagCompound writeToNBT(final NBTTagCompound tagRoot) { * @param tagRoot An NBT tag */ @Override - public void readFromNBT(final NBTTagCompound tagRoot) { - super.readFromNBT(tagRoot); + public void read(final NBTTagCompound tagRoot) { + super.read(tagRoot); if (tagRoot.hasKey("TankOut")) { - NBTTagCompound tankTag = tagRoot.getCompoundTag("TankOut"); + NBTTagCompound tankTag = tagRoot.getCompound("TankOut"); getOutputTank().readFromNBT(tankTag); if(tankTag.hasKey("Empty")){ - // empty the tank if NBT says its empty (not default behavior of Tank.readFromNBT(...) ) + // empty the tank if NBT says its empty (not default behavior of Tank.read(...) ) getOutputTank().setFluid(null); } } if (tagRoot.hasKey("TankIn")) { - NBTTagCompound tankTag = tagRoot.getCompoundTag("TankIn"); + NBTTagCompound tankTag = tagRoot.getCompound("TankIn"); getInputTank().readFromNBT(tankTag); if(tankTag.hasKey("Empty")){ - // empty the tank if NBT says its empty (not default behavior of Tank.readFromNBT(...) ) + // empty the tank if NBT says its empty (not default behavior of Tank.read(...) ) getInputTank().setFluid(null); } } @@ -222,7 +225,7 @@ public boolean isPowerSource(ConduitType type){ } /** - * Adds "energy" as a fluid to the FluidTank returned by getTank(). This implementation ignores + * Adds "energy" as a fluid to the FluidTank returned by getTank(). This implementation ignores * all non-fluid energy types. * @param amount amount of energy/fluid to add * @param type the type of energy/fluid being added. @@ -247,9 +250,9 @@ public float addEnergy(float amount, ConduitType type){ } return super.addEnergy(amount, type); } - + /** - * Subtracts "energy" as a fluid to the FluidTank returned by getTank(). This implementation + * Subtracts "energy" as a fluid to the FluidTank returned by getTank(). This implementation * ignores all non-fluid energy types. * @param amount amount of energy/fluid to add * @param type the type of energy/fluid being added. @@ -263,10 +266,10 @@ public float subtractEnergy(float amount, ConduitType type){ @Override public PowerRequest getPowerRequest(ConduitType offer) { if(redstone) return PowerRequest.REQUEST_NOTHING; - if(Fluids.isFluidType(offer) + if(Fluids.isFluidType(offer) && DistillationRecipeRegistry.getInstance().getDistillationRecipeForFluid( Fluids.conduitTypeToFluid(offer)) != null){ if(canDistill(Fluids.conduitTypeToFluid(offer))){ - if(getInputTank().getFluidAmount() > 0 + if(getInputTank().getFluidAmount() > 0 && Fluids.conduitTypeToFluid(offer).equals(getInputTank().getFluid().getFluid()) == false) { // check that the existing fluid is compatible return PowerRequest.REQUEST_NOTHING; @@ -277,7 +280,7 @@ public PowerRequest getPowerRequest(ConduitType offer) { return request; } else { return PowerRequest.REQUEST_NOTHING; - } + } } else if(ConduitType.areSameType(offer, Power.steam_power)){ return new PowerRequest(PowerRequest.MEDIUM_PRIORITY,this.getEnergyCapacity(Power.steam_power) - this.getEnergy(Power.steam_power), this); } @@ -313,7 +316,7 @@ private void distill(){ * Determines whether this conduit is compatible with an adjacent one * @param type The type of energy in the conduit * @param blockFace The side through-which the energy is flowing - * @return true if this conduit can flow the given energy type through the given face, false + * @return true if this conduit can flow the given energy type through the given face, false * otherwise */ public boolean canAcceptType(ConduitType type, EnumFacing blockFace){ @@ -322,7 +325,7 @@ public boolean canAcceptType(ConduitType type, EnumFacing blockFace){ /** * Determines whether this conduit is compatible with a type of energy through any side * @param type The type of energy in the conduit - * @return true if this conduit can flow the given energy type through one or more of its block + * @return true if this conduit can flow the given energy type through one or more of its block * faces, false otherwise */ public boolean canAcceptType(ConduitType type){ diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamTankBlock.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamTankBlock.java similarity index 85% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamTankBlock.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamTankBlock.java index 1f92b09..114196e 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamTankBlock.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamTankBlock.java @@ -1,8 +1,8 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PoweredEntity; -import com.mcmoddev.steamadvantage.init.Power; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.tileentity.TileEntity; @@ -16,7 +16,7 @@ public SteamTankBlock(){ } @Override - public PoweredEntity createNewTileEntity(World world, int metaDataValue) { + public PoweredEntity createNewTileEntity(net.minecraft.world.IBlockReader world) { return new SteamTankTileEntity(); } diff --git a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamTankTileEntity.java b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamTankTileEntity.java similarity index 88% rename from src/main/java/com/mcmoddev/steamadvantage/machines/SteamTankTileEntity.java rename to src/main/java/zone/moddev/mc/steamadvantage/machines/SteamTankTileEntity.java index a9810aa..8ddcef0 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/machines/SteamTankTileEntity.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/machines/SteamTankTileEntity.java @@ -1,11 +1,12 @@ -package com.mcmoddev.steamadvantage.machines; +package zone.moddev.mc.steamadvantage.machines; import cyano.poweradvantage.api.ConduitType; import cyano.poweradvantage.api.PowerRequest; -import com.mcmoddev.steamadvantage.init.Power; +import cyano.poweradvantage.api.fluid.FluidTank; +import zone.moddev.mc.steamadvantage.init.Power; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; +import net.minecraft.fluid.Fluid; @SuppressWarnings("deprecation") public class SteamTankTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine { @@ -14,7 +15,7 @@ public class SteamTankTileEntity extends cyano.poweradvantage.api.simple.TileEn private final int[] dataSyncArray = new int[1]; public SteamTankTileEntity() { - super(Power.steam_power, Fluid.BUCKET_VOLUME * 10, "tile.steamadvantage.steam_tank.name"); + super(zone.moddev.mc.steamadvantage.init.Entities.STEAM_TANK, Power.steam_power, FluidTank.BUCKET_VOLUME * 10, "tile.steamadvantage.steam_tank.name"); } private boolean redstone = true; diff --git a/src/main/java/zone/moddev/mc/steamadvantage/migration/SteamLegacyMigrations.java b/src/main/java/zone/moddev/mc/steamadvantage/migration/SteamLegacyMigrations.java new file mode 100644 index 0000000..41803e8 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/migration/SteamLegacyMigrations.java @@ -0,0 +1,107 @@ +package zone.moddev.mc.steamadvantage.migration; + +import cyano.poweradvantage.api.migration.LegacyMigrationApi; +import cyano.poweradvantage.api.simple.BlockSimplePowerMachine; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import zone.moddev.mc.poweradvantage.blocks.BlockPowerSwitch; +import zone.moddev.mc.steamadvantage.SteamAdvantage; +import zone.moddev.mc.steamadvantage.blocks.PlatformBlock; +import zone.moddev.mc.steamadvantage.machines.SteamDrillBlock; + +/** Registers SteamAdvantage's 1.10 and 1.12 identities with PowerAdvantage's shared migration hook. */ +public final class SteamLegacyMigrations { + private static boolean registered; + + private SteamLegacyMigrations() {} + + public static synchronized void register() { + if (registered) return; + + LegacyMigrationApi.registerNamespace(SteamAdvantage.MODID); + for (String path : new String[] { + "steam_pipe", "steam_track", "steam_boiler_coal", "steam_boiler_electric", + "steam_boiler_geothermal", "steam_tank", "steam_furnace", "steam_crusher", + "steam_drill", "drillbit", "platform", "steam_elevator", "steam_switch", + "pump_pipe_steam", "steam_still", "steam_pump", "steam_boiler_oil" }) { + LegacyMigrationApi.registerBlockStateCodec(id(path), SteamLegacyMigrations::decodeState); + } + + registerTile("steam_boiler_coal"); + registerTile("steam_boiler_electric"); + registerTile("steam_boiler_geothermal"); + registerTile("steam_tank"); + registerTile("steam_furnace"); + registerTile("steam_crusher"); + registerTile("steam_drill"); + registerTile("steam_elevator"); + registerTile("drillbit"); + registerTile("steam_still"); + registerTile("steam_pump"); + registerTile("steam_boiler_oil"); + + LegacyMigrationApi.registerDurableItem(id("musket")); + LegacyMigrationApi.registerNbtMigration("steamadvantage:persistence_keys", + SteamLegacyMigrations::repairPersistenceKeys); + registered = true; + } + + private static void registerTile(String path) { + String current = id(path).toString(); + LegacyMigrationApi.registerTileEntityAlias(current, current); + LegacyMigrationApi.registerTileEntityAlias(SteamAdvantage.MODID + "." + path, current); + LegacyMigrationApi.registerTileEntityAlias("minecraft:" + SteamAdvantage.MODID + "." + path, current); + } + + private static IBlockState decodeState(Block block, int metadata) { + if (block instanceof SteamDrillBlock) { + return block.getDefaultState().with(SteamDrillBlock.FACING, legacyDrillFacing(metadata)); + } + if (block instanceof PlatformBlock) { + return block.getDefaultState().with(PlatformBlock.HEIGHT, + Integer.valueOf(legacyPlatformHeight(metadata))); + } + if (block instanceof BlockPowerSwitch) { + return ((BlockPowerSwitch) block).getStateFromMeta(metadata); + } + if (block instanceof BlockSimplePowerMachine) { + return ((BlockSimplePowerMachine) block).getStateFromMeta(metadata); + } + return block.getDefaultState(); + } + + static EnumFacing legacyDrillFacing(int metadata) { + return EnumFacing.byIndex(metadata % EnumFacing.values().length); + } + + static int legacyPlatformHeight(int metadata) { + return Math.min(metadata & 15, 4); + } + + static boolean repairPersistenceKeys(NBTTagCompound compound) { + String id = compound.getString("id"); + boolean changed = false; + if (isTile(id, "steam_pump") && !compound.contains("Tank", 10) && compound.contains("TankOut", 10)) { + compound.setTag("Tank", compound.getCompound("TankOut").copy()); + changed = true; + } + if (isTile(id, "steam_boiler_geothermal") + && !compound.contains("Temperature", 99) && compound.contains("Tempoerature", 99)) { + compound.setFloat("Temperature", compound.getFloat("Tempoerature")); + changed = true; + } + return changed; + } + + private static boolean isTile(String value, String path) { + return id(path).toString().equalsIgnoreCase(value) + || (SteamAdvantage.MODID + "." + path).equalsIgnoreCase(value); + } + + private static ResourceLocation id(String path) { + return new ResourceLocation(SteamAdvantage.MODID, path); + } +} diff --git a/src/main/java/zone/moddev/mc/steamadvantage/recipe/RecipeConditions.java b/src/main/java/zone/moddev/mc/steamadvantage/recipe/RecipeConditions.java new file mode 100644 index 0000000..0238fd2 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/recipe/RecipeConditions.java @@ -0,0 +1,26 @@ +package zone.moddev.mc.steamadvantage.recipe; + +import net.minecraft.util.JsonUtils; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.crafting.CraftingHelper; +import zone.moddev.mc.poweradvantage.PowerAdvantage; +import zone.moddev.mc.poweradvantage.RecipeMode; +import zone.moddev.mc.steamadvantage.SteamAdvantage; + +/** Registers the data-pack conditions used by SteamAdvantage recipes. */ +public final class RecipeConditions { + private static boolean registered; + + private RecipeConditions() {} + + public static synchronized void register() { + if (registered) return; + CraftingHelper.register(new ResourceLocation(SteamAdvantage.MODID, "recipe_mode"), json -> { + RecipeMode expected = RecipeMode.valueOf(JsonUtils.getString(json, "mode").toUpperCase()); + return () -> PowerAdvantage.recipeMode == expected; + }); + CraftingHelper.register(new ResourceLocation(SteamAdvantage.MODID, "musket_enabled"), + json -> () -> SteamAdvantage.MUSKET_ENABLE); + registered = true; + } +} diff --git a/src/main/java/zone/moddev/mc/steamadvantage/util/FurnaceFuelHelper.java b/src/main/java/zone/moddev/mc/steamadvantage/util/FurnaceFuelHelper.java new file mode 100644 index 0000000..28b8cba --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/util/FurnaceFuelHelper.java @@ -0,0 +1,21 @@ +package zone.moddev.mc.steamadvantage.util; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraftforge.event.ForgeEventFactory; + +/** Forge-aware access to the vanilla furnace fuel calculation. */ +public final class FurnaceFuelHelper { + private FurnaceFuelHelper() {} + + public static int getBurnTime(ItemStack stack) { + if (stack.isEmpty()) return 0; + Item item = stack.getItem(); + int itemBurnTime = stack.getBurnTime(); + int vanillaBurnTime = itemBurnTime == -1 + ? TileEntityFurnace.getBurnTimes().getOrDefault(item, 0) + : itemBurnTime; + return ForgeEventFactory.getItemBurnTime(stack, vanillaBurnTime); + } +} diff --git a/src/main/java/zone/moddev/mc/steamadvantage/util/LegacyFluidHandler.java b/src/main/java/zone/moddev/mc/steamadvantage/util/LegacyFluidHandler.java new file mode 100644 index 0000000..9d88309 --- /dev/null +++ b/src/main/java/zone/moddev/mc/steamadvantage/util/LegacyFluidHandler.java @@ -0,0 +1,7 @@ +package zone.moddev.mc.steamadvantage.util; + +import cyano.poweradvantage.api.fluid.IAdvantageFluidHandler; + +/** Source-compatible name backed by Power Advantage's stable 1.13 fluid API. */ +public interface LegacyFluidHandler extends IAdvantageFluidHandler { +} diff --git a/src/main/java/com/mcmoddev/steamadvantage/util/SoundHelper.java b/src/main/java/zone/moddev/mc/steamadvantage/util/SoundHelper.java similarity index 89% rename from src/main/java/com/mcmoddev/steamadvantage/util/SoundHelper.java rename to src/main/java/zone/moddev/mc/steamadvantage/util/SoundHelper.java index ea94b72..4a1c4d1 100644 --- a/src/main/java/com/mcmoddev/steamadvantage/util/SoundHelper.java +++ b/src/main/java/zone/moddev/mc/steamadvantage/util/SoundHelper.java @@ -1,4 +1,4 @@ -package com.mcmoddev.steamadvantage.util; +package zone.moddev.mc.steamadvantage.util; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.play.server.SPacketCustomSound; @@ -27,8 +27,8 @@ public static void playSoundAtPosition(double x, double y, double z, SoundEvent x - range, y - range, z - range, x + range, y + range, z + range)); for(EntityPlayerMP player : players){ - player.connection.sendPacket(new SPacketCustomSound(sound.getRegistryName().toString(), soundType, - x, y, z, (float)volume, (float)pitch)); + player.connection.sendPacket(new SPacketCustomSound(sound.getRegistryName(), soundType, + new Vec3d(x, y, z), volume, pitch)); } } @@ -39,8 +39,8 @@ public static void playBigSoundAtPosition(double x, double y, double z, SoundEve x - range, y - range, z - range, x + range, y + range, z + range)); for(EntityPlayerMP player : players){ - player.connection.sendPacket(new SPacketCustomSound(sound.getRegistryName().toString(), soundType, - x, y, z, (float)volume, (float)pitch)); + player.connection.sendPacket(new SPacketCustomSound(sound.getRegistryName(), soundType, + new Vec3d(x, y, z), volume, pitch)); } } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..f035bd6 --- /dev/null +++ b/src/main/resources/META-INF/mods.toml @@ -0,0 +1,40 @@ +modLoader="javafml" +loaderVersion="${loader_version_range}" +license="GPL-3.0-only" +issueTrackerURL="https://github.com/MinecraftModDevelopmentMods/SteamAdvantage/issues" + +[[mods]] +modId="steamadvantage" +version="${version}" +displayName="Steam Advantage" +displayURL="https://www.curseforge.com/minecraft/mc-mods/steam-advantage" +authors="DrCyano, the MMD Team" +description='''Steam-powered machines and infrastructure for the Power Advantage platform.''' + +[[dependencies.steamadvantage]] +modId="poweradvantage" +mandatory=true +versionRange="[2.4.4.113021,3.0.0)" +ordering="AFTER" +side="BOTH" + +[[dependencies.steamadvantage]] +modId="basemetals" +mandatory=false +versionRange="[3.0.1.113021,4.0.0)" +ordering="AFTER" +side="BOTH" + +[[dependencies.steamadvantage]] +modId="forge" +mandatory=true +versionRange="${forge_version_range}" +ordering="NONE" +side="BOTH" + +[[dependencies.steamadvantage]] +modId="minecraft" +mandatory=true +versionRange="${minecraft_version_range}" +ordering="NONE" +side="BOTH" diff --git a/src/main/resources/assets/steamadvantage/blockstates/drillbit.json b/src/main/resources/assets/steamadvantage/blockstates/drillbit.json index c24a259..11193f9 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/drillbit.json +++ b/src/main/resources/assets/steamadvantage/blockstates/drillbit.json @@ -1,5 +1,5 @@ { "variants": { - "normal": { "model": "steamadvantage:drillbit" } + "": { "model": "steamadvantage:block/drillbit" } } } \ No newline at end of file diff --git a/src/main/resources/assets/steamadvantage/blockstates/platform.json b/src/main/resources/assets/steamadvantage/blockstates/platform.json index afe5e15..1164d69 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/platform.json +++ b/src/main/resources/assets/steamadvantage/blockstates/platform.json @@ -1,9 +1,9 @@ -{ - "variants": { - "height=0": { "model": "steamadvantage:platform_shaft" }, - "height=1": { "model": "steamadvantage:platform1" }, - "height=2": { "model": "steamadvantage:platform2" }, - "height=3": { "model": "steamadvantage:platform3" }, - "height=4": { "model": "steamadvantage:platform4" } - } -} +{ + "variants": { + "height=0": { "model": "steamadvantage:block/platform_shaft" }, + "height=1": { "model": "steamadvantage:block/platform1" }, + "height=2": { "model": "steamadvantage:block/platform2" }, + "height=3": { "model": "steamadvantage:block/platform3" }, + "height=4": { "model": "steamadvantage:block/platform4" } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/pump_pipe_steam.json b/src/main/resources/assets/steamadvantage/blockstates/pump_pipe_steam.json index ee18552..a25407b 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/pump_pipe_steam.json +++ b/src/main/resources/assets/steamadvantage/blockstates/pump_pipe_steam.json @@ -1,5 +1,5 @@ { "variants": { - "normal": {"model": "poweradvantage:fluid_pipe_ns", "x": 90, "y": 0, "uvlock": false } + "": {"model": "poweradvantage:block/fluid_pipe_ns", "x": 90, "y": 0, "uvlock": false } } } diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_coal.json b/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_coal.json index 17325a4..fec399a 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_coal.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_coal.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_boiler_coal", "y": 90 }, - "facing=north": { "model": "steamadvantage:steam_boiler_coal" }, - "facing=south": { "model": "steamadvantage:steam_boiler_coal", "y": 180 }, - "facing=west": { "model": "steamadvantage:steam_boiler_coal", "y": 270 } - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_boiler_coal", "y": 90 }, + "facing=north": { "model": "steamadvantage:block/steam_boiler_coal" }, + "facing=south": { "model": "steamadvantage:block/steam_boiler_coal", "y": 180 }, + "facing=west": { "model": "steamadvantage:block/steam_boiler_coal", "y": 270 } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_electric.json b/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_electric.json index 67a3660..0425ce6 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_electric.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_electric.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_boiler_electric", "y": 90 }, - "facing=north": { "model": "steamadvantage:steam_boiler_electric" }, - "facing=south": { "model": "steamadvantage:steam_boiler_electric", "y": 180 }, - "facing=west": { "model": "steamadvantage:steam_boiler_electric", "y": 270 } - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_boiler_electric", "y": 90 }, + "facing=north": { "model": "steamadvantage:block/steam_boiler_electric" }, + "facing=south": { "model": "steamadvantage:block/steam_boiler_electric", "y": 180 }, + "facing=west": { "model": "steamadvantage:block/steam_boiler_electric", "y": 270 } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_geothermal.json b/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_geothermal.json index 6ad2105..5ee6510 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_geothermal.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_geothermal.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_boiler_geothermal", "y": 90 }, - "facing=north": { "model": "steamadvantage:steam_boiler_geothermal" }, - "facing=south": { "model": "steamadvantage:steam_boiler_geothermal", "y": 180 }, - "facing=west": { "model": "steamadvantage:steam_boiler_geothermal", "y": 270 } - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_boiler_geothermal", "y": 90 }, + "facing=north": { "model": "steamadvantage:block/steam_boiler_geothermal" }, + "facing=south": { "model": "steamadvantage:block/steam_boiler_geothermal", "y": 180 }, + "facing=west": { "model": "steamadvantage:block/steam_boiler_geothermal", "y": 270 } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_oil.json b/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_oil.json index 2d1855f..047758d 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_oil.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_boiler_oil.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_boiler_oil", "x":270, "y": 90 }, - "facing=north": { "model": "steamadvantage:steam_boiler_oil", "x":270 }, - "facing=south": { "model": "steamadvantage:steam_boiler_oil", "x":270, "y": 180 }, - "facing=west": { "model": "steamadvantage:steam_boiler_oil", "x":270, "y": 270 } - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_boiler_oil", "x":270, "y": 90 }, + "facing=north": { "model": "steamadvantage:block/steam_boiler_oil", "x":270 }, + "facing=south": { "model": "steamadvantage:block/steam_boiler_oil", "x":270, "y": 180 }, + "facing=west": { "model": "steamadvantage:block/steam_boiler_oil", "x":270, "y": 270 } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_crusher.json b/src/main/resources/assets/steamadvantage/blockstates/steam_crusher.json index 7aed4d1..f59a3de 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_crusher.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_crusher.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_crusher", "y": 90 }, - "facing=north": { "model": "steamadvantage:steam_crusher" }, - "facing=south": { "model": "steamadvantage:steam_crusher", "y": 180 }, - "facing=west": { "model": "steamadvantage:steam_crusher", "y": 270 } - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_crusher", "y": 90 }, + "facing=north": { "model": "steamadvantage:block/steam_crusher" }, + "facing=south": { "model": "steamadvantage:block/steam_crusher", "y": 180 }, + "facing=west": { "model": "steamadvantage:block/steam_crusher", "y": 270 } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_drill.json b/src/main/resources/assets/steamadvantage/blockstates/steam_drill.json index d1585b3..7dcd03a 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_drill.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_drill.json @@ -1,10 +1,10 @@ -{ - "variants": { - "facing=down": { "model": "steamadvantage:steam_drill", "x": 90 }, - "facing=up": { "model": "steamadvantage:steam_drill", "x": 270 }, - "facing=east": { "model": "steamadvantage:steam_drill", "y": 90 }, - "facing=north": { "model": "steamadvantage:steam_drill" }, - "facing=south": { "model": "steamadvantage:steam_drill", "y": 180 }, - "facing=west": { "model": "steamadvantage:steam_drill", "y": 270 } - } -} +{ + "variants": { + "facing=down": { "model": "steamadvantage:block/steam_drill", "x": 90 }, + "facing=up": { "model": "steamadvantage:block/steam_drill", "x": 270 }, + "facing=east": { "model": "steamadvantage:block/steam_drill", "y": 90 }, + "facing=north": { "model": "steamadvantage:block/steam_drill" }, + "facing=south": { "model": "steamadvantage:block/steam_drill", "y": 180 }, + "facing=west": { "model": "steamadvantage:block/steam_drill", "y": 270 } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_elevator.json b/src/main/resources/assets/steamadvantage/blockstates/steam_elevator.json index c98e432..43d6a7d 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_elevator.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_elevator.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_elevator", "y": 90}, - "facing=north": { "model": "steamadvantage:steam_elevator" }, - "facing=south": { "model": "steamadvantage:steam_elevator", "y": 180}, - "facing=west": { "model": "steamadvantage:steam_elevator", "y": 270} - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_elevator", "y": 90}, + "facing=north": { "model": "steamadvantage:block/steam_elevator" }, + "facing=south": { "model": "steamadvantage:block/steam_elevator", "y": 180}, + "facing=west": { "model": "steamadvantage:block/steam_elevator", "y": 270} + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_furnace.json b/src/main/resources/assets/steamadvantage/blockstates/steam_furnace.json index 145bf50..74a07fa 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_furnace.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_furnace.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_furnace", "y": 90 }, - "facing=north": { "model": "steamadvantage:steam_furnace" }, - "facing=south": { "model": "steamadvantage:steam_furnace", "y": 180 }, - "facing=west": { "model": "steamadvantage:steam_furnace", "y": 270 } - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_furnace", "y": 90 }, + "facing=north": { "model": "steamadvantage:block/steam_furnace" }, + "facing=south": { "model": "steamadvantage:block/steam_furnace", "y": 180 }, + "facing=west": { "model": "steamadvantage:block/steam_furnace", "y": 270 } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_pipe.json b/src/main/resources/assets/steamadvantage/blockstates/steam_pipe.json index da73875..26d2eee 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_pipe.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_pipe.json @@ -1,70 +1,70 @@ { - "__comment": "blockstate parameters MUST be in alphabetical order!", + "__comment": "blockstate parameters MUST be in alphabetical order!", "variants": { - "down=false,east=false,north=false,south=false,up=false,west=false": { "model": "steamadvantage:steam_pipe_ensw", "x": 0, "y": 0, "uvlock": false }, - "down=true,east=false,north=false,south=false,up=false,west=false": { "model": "steamadvantage:steam_pipe_n", "x": 90, "y": 0, "uvlock": false }, - "down=false,east=true,north=false,south=false,up=false,west=false": { "model": "steamadvantage:steam_pipe_n", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=false,north=true,south=false,up=false,west=false": { "model": "steamadvantage:steam_pipe_n", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=false,south=true,up=false,west=false": { "model": "steamadvantage:steam_pipe_n", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=false,north=false,south=false,up=true,west=false": { "model": "steamadvantage:steam_pipe_n", "x": 270, "y": 0, "uvlock": false }, - "down=false,east=false,north=false,south=false,up=false,west=true": { "model": "steamadvantage:steam_pipe_n", "x": 0, "y": 270, "uvlock": false }, - "down=true,east=true,north=false,south=false,up=false,west=false": { "model": "steamadvantage:steam_pipe_nw", "x": 90, "y": 180, "uvlock": false }, - "down=true,east=false,north=true,south=false,up=false,west=false": { "model": "steamadvantage:steam_pipe_nw", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=false,north=false,south=true,up=false,west=false": { "model": "steamadvantage:steam_pipe_nw", "x": 90, "y": 270, "uvlock": false }, - "down=true,east=false,north=false,south=false,up=true,west=false": { "model": "steamadvantage:steam_pipe_ns", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=false,south=false,up=false,west=true": { "model": "steamadvantage:steam_pipe_nw", "x": 90, "y": 0, "uvlock": false }, - "down=false,east=true,north=true,south=false,up=false,west=false": { "model": "steamadvantage:steam_pipe_nw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=false,south=true,up=false,west=false": { "model": "steamadvantage:steam_pipe_nw", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=true,north=false,south=false,up=true,west=false": { "model": "steamadvantage:steam_pipe_nw", "x": 270, "y": 180, "uvlock": false }, - "down=false,east=true,north=false,south=false,up=false,west=true": { "model": "steamadvantage:steam_pipe_ns", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=false,north=true,south=true,up=false,west=false": { "model": "steamadvantage:steam_pipe_ns", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=true,south=false,up=true,west=false": { "model": "steamadvantage:steam_pipe_nw", "x": 270, "y": 90, "uvlock": false }, - "down=false,east=false,north=true,south=false,up=false,west=true": { "model": "steamadvantage:steam_pipe_nw", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=false,south=true,up=true,west=false": { "model": "steamadvantage:steam_pipe_nw", "x": 270, "y": 270, "uvlock": false }, - "down=false,east=false,north=false,south=true,up=false,west=true": { "model": "steamadvantage:steam_pipe_nw", "x": 0, "y": 270, "uvlock": false }, - "down=false,east=false,north=false,south=false,up=true,west=true": { "model": "steamadvantage:steam_pipe_nw", "x": 270, "y": 0, "uvlock": false }, - "down=true,east=true,north=true,south=false,up=false,west=false": { "model": "steamadvantage:steam_pipe_nuw", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=true,north=false,south=true,up=false,west=false": { "model": "steamadvantage:steam_pipe_nuw", "x": 90, "y": 180, "uvlock": false }, - "down=true,east=true,north=false,south=false,up=true,west=false": { "model": "steamadvantage:steam_pipe_dnu", "x": 0, "y": 90, "uvlock": false }, - "down=true,east=true,north=false,south=false,up=false,west=true": { "model": "steamadvantage:steam_pipe_dnu", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=false,north=true,south=true,up=false,west=false": { "model": "steamadvantage:steam_pipe_dnu", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=false,up=true,west=false": { "model": "steamadvantage:steam_pipe_dnu", "x": 0, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=false,up=false,west=true": { "model": "steamadvantage:steam_pipe_nuw", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=false,south=true,up=true,west=false": { "model": "steamadvantage:steam_pipe_dnu", "x": 0, "y": 180, "uvlock": false }, - "down=true,east=false,north=false,south=true,up=false,west=true": { "model": "steamadvantage:steam_pipe_nuw", "x": 90, "y": 270, "uvlock": false }, - "down=true,east=false,north=false,south=false,up=true,west=true": { "model": "steamadvantage:steam_pipe_dnu", "x": 0, "y": 270, "uvlock": false }, - "down=false,east=true,north=true,south=true,up=false,west=false": { "model": "steamadvantage:steam_pipe_nsw", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=true,north=true,south=false,up=true,west=false": { "model": "steamadvantage:steam_pipe_nuw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=true,south=false,up=false,west=true": { "model": "steamadvantage:steam_pipe_nsw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=false,south=true,up=true,west=false": { "model": "steamadvantage:steam_pipe_nuw", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=true,north=false,south=true,up=false,west=true": { "model": "steamadvantage:steam_pipe_nsw", "x": 0, "y": 270, "uvlock": false }, - "down=false,east=true,north=false,south=false,up=true,west=true": { "model": "steamadvantage:steam_pipe_dnu", "x": 270, "y": 90, "uvlock": false }, - "down=false,east=false,north=true,south=true,up=true,west=false": { "model": "steamadvantage:steam_pipe_dnu", "x": 270, "y": 0, "uvlock": false }, - "down=false,east=false,north=true,south=true,up=false,west=true": { "model": "steamadvantage:steam_pipe_nsw", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=true,south=false,up=true,west=true": { "model": "steamadvantage:steam_pipe_nuw", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=false,south=true,up=true,west=true": { "model": "steamadvantage:steam_pipe_nuw", "x": 0, "y": 270, "uvlock": false }, - "down=true,east=true,north=true,south=true,up=false,west=false": { "model": "steamadvantage:steam_pipe_nsuw", "x": 180, "y": 180, "uvlock": false }, - "down=true,east=true,north=true,south=false,up=true,west=false": { "model": "steamadvantage:steam_pipe_nsuw", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=true,north=true,south=false,up=false,west=true": { "model": "steamadvantage:steam_pipe_nsuw", "x": 180, "y": 90, "uvlock": false }, - "down=true,east=true,north=false,south=true,up=true,west=false": { "model": "steamadvantage:steam_pipe_nsuw", "x": 90, "y": 180, "uvlock": false }, - "down=true,east=true,north=false,south=true,up=false,west=true": { "model": "steamadvantage:steam_pipe_nsuw", "x": 180, "y": 270, "uvlock": false }, - "down=true,east=true,north=false,south=false,up=true,west=true": { "model": "steamadvantage:steam_pipe_ensw", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=true,up=true,west=false": { "model": "steamadvantage:steam_pipe_ensw", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=false,north=true,south=true,up=false,west=true": { "model": "steamadvantage:steam_pipe_nsuw", "x": 180, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=false,up=true,west=true": { "model": "steamadvantage:steam_pipe_nsuw", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=false,south=true,up=true,west=true": { "model": "steamadvantage:steam_pipe_nsuw", "x": 90, "y": 270, "uvlock": false }, - "down=false,east=true,north=true,south=true,up=true,west=false": { "model": "steamadvantage:steam_pipe_nsuw", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=true,north=true,south=true,up=false,west=true": { "model": "steamadvantage:steam_pipe_ensw", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=true,north=true,south=false,up=true,west=true": { "model": "steamadvantage:steam_pipe_nsuw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=false,south=true,up=true,west=true": { "model": "steamadvantage:steam_pipe_nsuw", "x": 0, "y": 270, "uvlock": false }, - "down=false,east=false,north=true,south=true,up=true,west=true": { "model": "steamadvantage:steam_pipe_nsuw", "x": 0, "y": 0, "uvlock": false }, - "down=true,east=true,north=true,south=true,up=true,west=false": { "model": "steamadvantage:steam_pipe_desuw", "x": 0, "y": 270, "uvlock": false }, - "down=true,east=true,north=true,south=true,up=false,west=true": { "model": "steamadvantage:steam_pipe_desuw", "x": 270, "y": 0, "uvlock": false }, - "down=true,east=true,north=true,south=false,up=true,west=true": { "model": "steamadvantage:steam_pipe_desuw", "x": 0, "y": 180, "uvlock": false }, - "down=true,east=true,north=false,south=true,up=true,west=true": { "model": "steamadvantage:steam_pipe_desuw", "x": 0, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=true,up=true,west=true": { "model": "steamadvantage:steam_pipe_desuw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=true,south=true,up=true,west=true": { "model": "steamadvantage:steam_pipe_desuw", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=true,north=true,south=true,up=true,west=true": { "model": "steamadvantage:steam_pipe_densuw", "x": 0, "y": 0, "uvlock": false } - + "down=false,east=false,north=false,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_ensw", "x": 0, "y": 0, "uvlock": false }, + "down=true,east=false,north=false,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_n", "x": 90, "y": 0, "uvlock": false }, + "down=false,east=true,north=false,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_n", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=false,north=true,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_n", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=false,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_n", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=false,north=false,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_n", "x": 270, "y": 0, "uvlock": false }, + "down=false,east=false,north=false,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_n", "x": 0, "y": 270, "uvlock": false }, + "down=true,east=true,north=false,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_nw", "x": 90, "y": 180, "uvlock": false }, + "down=true,east=false,north=true,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_nw", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=false,north=false,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_nw", "x": 90, "y": 270, "uvlock": false }, + "down=true,east=false,north=false,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_ns", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=false,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nw", "x": 90, "y": 0, "uvlock": false }, + "down=false,east=true,north=true,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_nw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=false,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_nw", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=true,north=false,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_nw", "x": 270, "y": 180, "uvlock": false }, + "down=false,east=true,north=false,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_ns", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=false,north=true,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_ns", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=true,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_nw", "x": 270, "y": 90, "uvlock": false }, + "down=false,east=false,north=true,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nw", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=false,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_nw", "x": 270, "y": 270, "uvlock": false }, + "down=false,east=false,north=false,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nw", "x": 0, "y": 270, "uvlock": false }, + "down=false,east=false,north=false,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_nw", "x": 270, "y": 0, "uvlock": false }, + "down=true,east=true,north=true,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_nuw", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=true,north=false,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_nuw", "x": 90, "y": 180, "uvlock": false }, + "down=true,east=true,north=false,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_dnu", "x": 0, "y": 90, "uvlock": false }, + "down=true,east=true,north=false,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_dnu", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=false,north=true,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_dnu", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_dnu", "x": 0, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nuw", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=false,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_dnu", "x": 0, "y": 180, "uvlock": false }, + "down=true,east=false,north=false,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nuw", "x": 90, "y": 270, "uvlock": false }, + "down=true,east=false,north=false,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_dnu", "x": 0, "y": 270, "uvlock": false }, + "down=false,east=true,north=true,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_nsw", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=true,north=true,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_nuw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=true,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nsw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=false,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_nuw", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=true,north=false,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nsw", "x": 0, "y": 270, "uvlock": false }, + "down=false,east=true,north=false,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_dnu", "x": 270, "y": 90, "uvlock": false }, + "down=false,east=false,north=true,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_dnu", "x": 270, "y": 0, "uvlock": false }, + "down=false,east=false,north=true,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nsw", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=true,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_nuw", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=false,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_nuw", "x": 0, "y": 270, "uvlock": false }, + "down=true,east=true,north=true,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 180, "y": 180, "uvlock": false }, + "down=true,east=true,north=true,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=true,north=true,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 180, "y": 90, "uvlock": false }, + "down=true,east=true,north=false,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 90, "y": 180, "uvlock": false }, + "down=true,east=true,north=false,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 180, "y": 270, "uvlock": false }, + "down=true,east=true,north=false,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_ensw", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_ensw", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=false,north=true,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 180, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=false,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 90, "y": 270, "uvlock": false }, + "down=false,east=true,north=true,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=true,north=true,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_ensw", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=true,north=true,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=false,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 0, "y": 270, "uvlock": false }, + "down=false,east=false,north=true,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_nsuw", "x": 0, "y": 0, "uvlock": false }, + "down=true,east=true,north=true,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_pipe_desuw", "x": 0, "y": 270, "uvlock": false }, + "down=true,east=true,north=true,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_pipe_desuw", "x": 270, "y": 0, "uvlock": false }, + "down=true,east=true,north=true,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_desuw", "x": 0, "y": 180, "uvlock": false }, + "down=true,east=true,north=false,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_desuw", "x": 0, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_desuw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=true,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_desuw", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=true,north=true,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_pipe_densuw", "x": 0, "y": 0, "uvlock": false } + } } \ No newline at end of file diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_pump.json b/src/main/resources/assets/steamadvantage/blockstates/steam_pump.json index 19a20dd..de4ee6c 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_pump.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_pump.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_pump", "y": 90 }, - "facing=north": { "model": "steamadvantage:steam_pump" }, - "facing=south": { "model": "steamadvantage:steam_pump", "y": 180 }, - "facing=west": { "model": "steamadvantage:steam_pump", "y": 270 } - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_pump", "y": 90 }, + "facing=north": { "model": "steamadvantage:block/steam_pump" }, + "facing=south": { "model": "steamadvantage:block/steam_pump", "y": 180 }, + "facing=west": { "model": "steamadvantage:block/steam_pump", "y": 270 } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_still.json b/src/main/resources/assets/steamadvantage/blockstates/steam_still.json index b008d4e..dacd7c7 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_still.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_still.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_still", "y": 90 }, - "facing=north": { "model": "steamadvantage:steam_still" }, - "facing=south": { "model": "steamadvantage:steam_still", "y": 180 }, - "facing=west": { "model": "steamadvantage:steam_still", "y": 270 } - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_still", "y": 90 }, + "facing=north": { "model": "steamadvantage:block/steam_still" }, + "facing=south": { "model": "steamadvantage:block/steam_still", "y": 180 }, + "facing=west": { "model": "steamadvantage:block/steam_still", "y": 270 } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_switch.json b/src/main/resources/assets/steamadvantage/blockstates/steam_switch.json index 7da844b..8e68320 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_switch.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_switch.json @@ -1,6 +1,6 @@ { "variants": { - "active=false": { "model": "steamadvantage:steam_switch_off"}, - "active=true": { "model": "steamadvantage:steam_switch_on"} + "active=false": { "model": "steamadvantage:block/steam_switch_off"}, + "active=true": { "model": "steamadvantage:block/steam_switch_on"} } } diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_tank.json b/src/main/resources/assets/steamadvantage/blockstates/steam_tank.json index 72a453d..ac7be61 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_tank.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_tank.json @@ -1,8 +1,8 @@ -{ - "variants": { - "facing=east": { "model": "steamadvantage:steam_tank", "y": 90, "uvlock": true }, - "facing=north": { "model": "steamadvantage:steam_tank", "uvlock": true }, - "facing=south": { "model": "steamadvantage:steam_tank", "y": 180, "uvlock": true }, - "facing=west": { "model": "steamadvantage:steam_tank", "y": 270, "uvlock": true } - } -} +{ + "variants": { + "facing=east": { "model": "steamadvantage:block/steam_tank", "y": 90, "uvlock": true }, + "facing=north": { "model": "steamadvantage:block/steam_tank", "uvlock": true }, + "facing=south": { "model": "steamadvantage:block/steam_tank", "y": 180, "uvlock": true }, + "facing=west": { "model": "steamadvantage:block/steam_tank", "y": 270, "uvlock": true } + } +} diff --git a/src/main/resources/assets/steamadvantage/blockstates/steam_track.json b/src/main/resources/assets/steamadvantage/blockstates/steam_track.json index d24efce..a536b3e 100644 --- a/src/main/resources/assets/steamadvantage/blockstates/steam_track.json +++ b/src/main/resources/assets/steamadvantage/blockstates/steam_track.json @@ -1,70 +1,70 @@ { - "__comment": "blockstate parameters MUST be in alphabetical order!", + "__comment": "blockstate parameters MUST be in alphabetical order!", "variants": { - "down=false,east=false,north=false,south=false,up=false,west=false": { "model": "steamadvantage:steam_track_ensw", "x": 0, "y": 0, "uvlock": false }, - "down=true,east=false,north=false,south=false,up=false,west=false": { "model": "steamadvantage:steam_track_n", "x": 90, "y": 0, "uvlock": false }, - "down=false,east=true,north=false,south=false,up=false,west=false": { "model": "steamadvantage:steam_track_n", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=false,north=true,south=false,up=false,west=false": { "model": "steamadvantage:steam_track_n", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=false,south=true,up=false,west=false": { "model": "steamadvantage:steam_track_n", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=false,north=false,south=false,up=true,west=false": { "model": "steamadvantage:steam_track_n", "x": 270, "y": 0, "uvlock": false }, - "down=false,east=false,north=false,south=false,up=false,west=true": { "model": "steamadvantage:steam_track_n", "x": 0, "y": 270, "uvlock": false }, - "down=true,east=true,north=false,south=false,up=false,west=false": { "model": "steamadvantage:steam_track_nw", "x": 90, "y": 180, "uvlock": false }, - "down=true,east=false,north=true,south=false,up=false,west=false": { "model": "steamadvantage:steam_track_nw", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=false,north=false,south=true,up=false,west=false": { "model": "steamadvantage:steam_track_nw", "x": 90, "y": 270, "uvlock": false }, - "down=true,east=false,north=false,south=false,up=true,west=false": { "model": "steamadvantage:steam_track_ns", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=false,south=false,up=false,west=true": { "model": "steamadvantage:steam_track_nw", "x": 90, "y": 0, "uvlock": false }, - "down=false,east=true,north=true,south=false,up=false,west=false": { "model": "steamadvantage:steam_track_nw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=false,south=true,up=false,west=false": { "model": "steamadvantage:steam_track_nw", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=true,north=false,south=false,up=true,west=false": { "model": "steamadvantage:steam_track_nw", "x": 270, "y": 180, "uvlock": false }, - "down=false,east=true,north=false,south=false,up=false,west=true": { "model": "steamadvantage:steam_track_ns", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=false,north=true,south=true,up=false,west=false": { "model": "steamadvantage:steam_track_ns", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=true,south=false,up=true,west=false": { "model": "steamadvantage:steam_track_nw", "x": 270, "y": 90, "uvlock": false }, - "down=false,east=false,north=true,south=false,up=false,west=true": { "model": "steamadvantage:steam_track_nw", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=false,south=true,up=true,west=false": { "model": "steamadvantage:steam_track_nw", "x": 270, "y": 270, "uvlock": false }, - "down=false,east=false,north=false,south=true,up=false,west=true": { "model": "steamadvantage:steam_track_nw", "x": 0, "y": 270, "uvlock": false }, - "down=false,east=false,north=false,south=false,up=true,west=true": { "model": "steamadvantage:steam_track_nw", "x": 270, "y": 0, "uvlock": false }, - "down=true,east=true,north=true,south=false,up=false,west=false": { "model": "steamadvantage:steam_track_nuw", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=true,north=false,south=true,up=false,west=false": { "model": "steamadvantage:steam_track_nuw", "x": 90, "y": 180, "uvlock": false }, - "down=true,east=true,north=false,south=false,up=true,west=false": { "model": "steamadvantage:steam_track_dnu", "x": 0, "y": 90, "uvlock": false }, - "down=true,east=true,north=false,south=false,up=false,west=true": { "model": "steamadvantage:steam_track_dnu", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=false,north=true,south=true,up=false,west=false": { "model": "steamadvantage:steam_track_dnu", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=false,up=true,west=false": { "model": "steamadvantage:steam_track_dnu", "x": 0, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=false,up=false,west=true": { "model": "steamadvantage:steam_track_nuw", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=false,south=true,up=true,west=false": { "model": "steamadvantage:steam_track_dnu", "x": 0, "y": 180, "uvlock": false }, - "down=true,east=false,north=false,south=true,up=false,west=true": { "model": "steamadvantage:steam_track_nuw", "x": 90, "y": 270, "uvlock": false }, - "down=true,east=false,north=false,south=false,up=true,west=true": { "model": "steamadvantage:steam_track_dnu", "x": 0, "y": 270, "uvlock": false }, - "down=false,east=true,north=true,south=true,up=false,west=false": { "model": "steamadvantage:steam_track_nsw", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=true,north=true,south=false,up=true,west=false": { "model": "steamadvantage:steam_track_nuw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=true,south=false,up=false,west=true": { "model": "steamadvantage:steam_track_nsw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=false,south=true,up=true,west=false": { "model": "steamadvantage:steam_track_nuw", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=true,north=false,south=true,up=false,west=true": { "model": "steamadvantage:steam_track_nsw", "x": 0, "y": 270, "uvlock": false }, - "down=false,east=true,north=false,south=false,up=true,west=true": { "model": "steamadvantage:steam_track_dnu", "x": 270, "y": 90, "uvlock": false }, - "down=false,east=false,north=true,south=true,up=true,west=false": { "model": "steamadvantage:steam_track_dnu", "x": 270, "y": 0, "uvlock": false }, - "down=false,east=false,north=true,south=true,up=false,west=true": { "model": "steamadvantage:steam_track_nsw", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=true,south=false,up=true,west=true": { "model": "steamadvantage:steam_track_nuw", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=false,north=false,south=true,up=true,west=true": { "model": "steamadvantage:steam_track_nuw", "x": 0, "y": 270, "uvlock": false }, - "down=true,east=true,north=true,south=true,up=false,west=false": { "model": "steamadvantage:steam_track_nsuw", "x": 180, "y": 180, "uvlock": false }, - "down=true,east=true,north=true,south=false,up=true,west=false": { "model": "steamadvantage:steam_track_nsuw", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=true,north=true,south=false,up=false,west=true": { "model": "steamadvantage:steam_track_nsuw", "x": 180, "y": 90, "uvlock": false }, - "down=true,east=true,north=false,south=true,up=true,west=false": { "model": "steamadvantage:steam_track_nsuw", "x": 90, "y": 180, "uvlock": false }, - "down=true,east=true,north=false,south=true,up=false,west=true": { "model": "steamadvantage:steam_track_nsuw", "x": 180, "y": 270, "uvlock": false }, - "down=true,east=true,north=false,south=false,up=true,west=true": { "model": "steamadvantage:steam_track_ensw", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=true,up=true,west=false": { "model": "steamadvantage:steam_track_ensw", "x": 90, "y": 90, "uvlock": false }, - "down=true,east=false,north=true,south=true,up=false,west=true": { "model": "steamadvantage:steam_track_nsuw", "x": 180, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=false,up=true,west=true": { "model": "steamadvantage:steam_track_nsuw", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=false,north=false,south=true,up=true,west=true": { "model": "steamadvantage:steam_track_nsuw", "x": 90, "y": 270, "uvlock": false }, - "down=false,east=true,north=true,south=true,up=true,west=false": { "model": "steamadvantage:steam_track_nsuw", "x": 0, "y": 180, "uvlock": false }, - "down=false,east=true,north=true,south=true,up=false,west=true": { "model": "steamadvantage:steam_track_ensw", "x": 0, "y": 0, "uvlock": false }, - "down=false,east=true,north=true,south=false,up=true,west=true": { "model": "steamadvantage:steam_track_nsuw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=false,south=true,up=true,west=true": { "model": "steamadvantage:steam_track_nsuw", "x": 0, "y": 270, "uvlock": false }, - "down=false,east=false,north=true,south=true,up=true,west=true": { "model": "steamadvantage:steam_track_nsuw", "x": 0, "y": 0, "uvlock": false }, - "down=true,east=true,north=true,south=true,up=true,west=false": { "model": "steamadvantage:steam_track_desuw", "x": 0, "y": 270, "uvlock": false }, - "down=true,east=true,north=true,south=true,up=false,west=true": { "model": "steamadvantage:steam_track_desuw", "x": 270, "y": 0, "uvlock": false }, - "down=true,east=true,north=true,south=false,up=true,west=true": { "model": "steamadvantage:steam_track_desuw", "x": 0, "y": 180, "uvlock": false }, - "down=true,east=true,north=false,south=true,up=true,west=true": { "model": "steamadvantage:steam_track_desuw", "x": 0, "y": 0, "uvlock": false }, - "down=true,east=false,north=true,south=true,up=true,west=true": { "model": "steamadvantage:steam_track_desuw", "x": 0, "y": 90, "uvlock": false }, - "down=false,east=true,north=true,south=true,up=true,west=true": { "model": "steamadvantage:steam_track_desuw", "x": 90, "y": 0, "uvlock": false }, - "down=true,east=true,north=true,south=true,up=true,west=true": { "model": "steamadvantage:steam_track_densuw", "x": 0, "y": 0, "uvlock": false } - + "down=false,east=false,north=false,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_track_ensw", "x": 0, "y": 0, "uvlock": false }, + "down=true,east=false,north=false,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_track_n", "x": 90, "y": 0, "uvlock": false }, + "down=false,east=true,north=false,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_track_n", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=false,north=true,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_track_n", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=false,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_track_n", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=false,north=false,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_track_n", "x": 270, "y": 0, "uvlock": false }, + "down=false,east=false,north=false,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_track_n", "x": 0, "y": 270, "uvlock": false }, + "down=true,east=true,north=false,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_track_nw", "x": 90, "y": 180, "uvlock": false }, + "down=true,east=false,north=true,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_track_nw", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=false,north=false,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_track_nw", "x": 90, "y": 270, "uvlock": false }, + "down=true,east=false,north=false,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_track_ns", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=false,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_track_nw", "x": 90, "y": 0, "uvlock": false }, + "down=false,east=true,north=true,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_track_nw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=false,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_track_nw", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=true,north=false,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_track_nw", "x": 270, "y": 180, "uvlock": false }, + "down=false,east=true,north=false,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_track_ns", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=false,north=true,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_track_ns", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=true,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_track_nw", "x": 270, "y": 90, "uvlock": false }, + "down=false,east=false,north=true,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_track_nw", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=false,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_track_nw", "x": 270, "y": 270, "uvlock": false }, + "down=false,east=false,north=false,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_track_nw", "x": 0, "y": 270, "uvlock": false }, + "down=false,east=false,north=false,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_track_nw", "x": 270, "y": 0, "uvlock": false }, + "down=true,east=true,north=true,south=false,up=false,west=false": { "model": "steamadvantage:block/steam_track_nuw", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=true,north=false,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_track_nuw", "x": 90, "y": 180, "uvlock": false }, + "down=true,east=true,north=false,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_track_dnu", "x": 0, "y": 90, "uvlock": false }, + "down=true,east=true,north=false,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_track_dnu", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=false,north=true,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_track_dnu", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_track_dnu", "x": 0, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_track_nuw", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=false,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_track_dnu", "x": 0, "y": 180, "uvlock": false }, + "down=true,east=false,north=false,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_track_nuw", "x": 90, "y": 270, "uvlock": false }, + "down=true,east=false,north=false,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_track_dnu", "x": 0, "y": 270, "uvlock": false }, + "down=false,east=true,north=true,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_track_nsw", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=true,north=true,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_track_nuw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=true,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_track_nsw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=false,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_track_nuw", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=true,north=false,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_track_nsw", "x": 0, "y": 270, "uvlock": false }, + "down=false,east=true,north=false,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_track_dnu", "x": 270, "y": 90, "uvlock": false }, + "down=false,east=false,north=true,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_track_dnu", "x": 270, "y": 0, "uvlock": false }, + "down=false,east=false,north=true,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_track_nsw", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=true,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_track_nuw", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=false,north=false,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_track_nuw", "x": 0, "y": 270, "uvlock": false }, + "down=true,east=true,north=true,south=true,up=false,west=false": { "model": "steamadvantage:block/steam_track_nsuw", "x": 180, "y": 180, "uvlock": false }, + "down=true,east=true,north=true,south=false,up=true,west=false": { "model": "steamadvantage:block/steam_track_nsuw", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=true,north=true,south=false,up=false,west=true": { "model": "steamadvantage:block/steam_track_nsuw", "x": 180, "y": 90, "uvlock": false }, + "down=true,east=true,north=false,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_track_nsuw", "x": 90, "y": 180, "uvlock": false }, + "down=true,east=true,north=false,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_track_nsuw", "x": 180, "y": 270, "uvlock": false }, + "down=true,east=true,north=false,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_track_ensw", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_track_ensw", "x": 90, "y": 90, "uvlock": false }, + "down=true,east=false,north=true,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_track_nsuw", "x": 180, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_track_nsuw", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=false,north=false,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_track_nsuw", "x": 90, "y": 270, "uvlock": false }, + "down=false,east=true,north=true,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_track_nsuw", "x": 0, "y": 180, "uvlock": false }, + "down=false,east=true,north=true,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_track_ensw", "x": 0, "y": 0, "uvlock": false }, + "down=false,east=true,north=true,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_track_nsuw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=false,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_track_nsuw", "x": 0, "y": 270, "uvlock": false }, + "down=false,east=false,north=true,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_track_nsuw", "x": 0, "y": 0, "uvlock": false }, + "down=true,east=true,north=true,south=true,up=true,west=false": { "model": "steamadvantage:block/steam_track_desuw", "x": 0, "y": 270, "uvlock": false }, + "down=true,east=true,north=true,south=true,up=false,west=true": { "model": "steamadvantage:block/steam_track_desuw", "x": 270, "y": 0, "uvlock": false }, + "down=true,east=true,north=true,south=false,up=true,west=true": { "model": "steamadvantage:block/steam_track_desuw", "x": 0, "y": 180, "uvlock": false }, + "down=true,east=true,north=false,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_track_desuw", "x": 0, "y": 0, "uvlock": false }, + "down=true,east=false,north=true,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_track_desuw", "x": 0, "y": 90, "uvlock": false }, + "down=false,east=true,north=true,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_track_desuw", "x": 90, "y": 0, "uvlock": false }, + "down=true,east=true,north=true,south=true,up=true,west=true": { "model": "steamadvantage:block/steam_track_densuw", "x": 0, "y": 0, "uvlock": false } + } } \ No newline at end of file diff --git a/src/main/resources/assets/steamadvantage/lang/de_de.json b/src/main/resources/assets/steamadvantage/lang/de_de.json new file mode 100644 index 0000000..e32d5ae --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/de_de.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Dampfkraft Steuerventil", + "tile.steamadvantage.steam_pipe.name": "Dampfrohr", + "tile.steamadvantage.steam_boiler_coal.name": "Dampfkraft Kessel", + "tile.steamadvantage.steam_tank.name": "Dampftank", + "tile.steamadvantage.steam_furnace.name": "Dampfkraft Ofen", + "tile.steamadvantage.steam_crusher.name": "Dampfkraft Steinbrecher", + "tile.steamadvantage.drillbit.name": "Bohrer", + "tile.steamadvantage.steam_drill.name": "Dampfkraft Bohrmaschine", + "item.steamadvantage.steam_drill_bit.name": "Bohrer", + "death.attack.steam_machine": "%1$s wurde zwischen die Zahnräder einer Maschine geschliffen", + "death.attack.steam_machine.player": "%1$s wurde zwischen die Zahnräder einer Maschine von %2$s geschliffen", + "tile.steamadvantage.steam_elevator.name": "Dampfkraft Aufzug", + "tile.steamadvantage.platform.name": "Dampfkraft Aufzugplattform", + "death.attack.musket": "%1$s wurde angeschossen", + "death.attack.musket.player": "%1$s schuss %2$s tot", + "item.steamadvantage.blackpowder_cartridge.name": "Schießpulver Patrone", + "item.steamadvantage.musket.name": "Schießpulver Muskete", + "tooltip.musket.damage": "Shot befasst %x Schäden", + "tooltip.musket.ammo": "Erfordert %x zu laden", + "tooltip.musket.loaded": "Geladen", + "tooltip.musket.unloaded": "Nicht geladen", + "enchantment.powderless": "Unendlich Munition", + "enchantment.rapid_reload": "Schnell neu laden", + "enchantment.high_explosive": "Bombe", + "enchantment.recoil": "Rückstoß", + "tile.steamadvantage.steam_track.name": "Dampfkraftzug", + "tile.steamadvantage.steam_boiler_electric.name": "Elektro-Dampfkessel", + "tile.steamadvantage.steam_boiler_geothermal.name": "Geothermische Dampfkessel", + "tile.steamadvantage.steam_switch.name": "Dampfventil", + "tile.steamadvantage.steam_still.name": "Dampfkraft Brennerei", + "tile.steamadvantage.steam_pump.name": "Dampfkraft Pumpe", + "tile.steamadvantage.steam_boiler_oil.name": "Ölfeuerung Dampfkraft Kessel", + "tile.steamadvantage.pump_pipe_steam.name": "Pumpenrohr", + "item.steamadvantage.steam_governor": "Dampfkraft Steuerventil", + "block.steamadvantage.steam_pipe": "Dampfrohr", + "block.steamadvantage.steam_boiler_coal": "Dampfkraft Kessel", + "block.steamadvantage.steam_tank": "Dampftank", + "block.steamadvantage.steam_furnace": "Dampfkraft Ofen", + "block.steamadvantage.steam_crusher": "Dampfkraft Steinbrecher", + "block.steamadvantage.drillbit": "Bohrer", + "block.steamadvantage.steam_drill": "Dampfkraft Bohrmaschine", + "item.steamadvantage.steam_drill_bit": "Bohrer", + "block.steamadvantage.steam_elevator": "Dampfkraft Aufzug", + "block.steamadvantage.platform": "Dampfkraft Aufzugplattform", + "item.steamadvantage.blackpowder_cartridge": "Schießpulver Patrone", + "item.steamadvantage.musket": "Schießpulver Muskete", + "block.steamadvantage.steam_track": "Dampfkraftzug", + "block.steamadvantage.steam_boiler_electric": "Elektro-Dampfkessel", + "block.steamadvantage.steam_boiler_geothermal": "Geothermische Dampfkessel", + "block.steamadvantage.steam_switch": "Dampfventil", + "block.steamadvantage.steam_still": "Dampfkraft Brennerei", + "block.steamadvantage.steam_pump": "Dampfkraft Pumpe", + "block.steamadvantage.steam_boiler_oil": "Ölfeuerung Dampfkraft Kessel", + "block.steamadvantage.pump_pipe_steam": "Pumpenrohr" +} diff --git a/src/main/resources/assets/steamadvantage/lang/de_de.lang b/src/main/resources/assets/steamadvantage/lang/de_de.lang deleted file mode 100644 index 67fb3f3..0000000 --- a/src/main/resources/assets/steamadvantage/lang/de_de.lang +++ /dev/null @@ -1,43 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Dampfkraft Steuerventil - -tile.steamadvantage.steam_pipe.name=Dampfrohr -tile.steamadvantage.steam_boiler_coal.name=Dampfkraft Kessel -tile.steamadvantage.steam_tank.name=Dampftank -tile.steamadvantage.steam_furnace.name=Dampfkraft Ofen -tile.steamadvantage.steam_crusher.name=Dampfkraft Steinbrecher - - -tile.steamadvantage.drillbit.name=Bohrer -tile.steamadvantage.steam_drill.name=Dampfkraft Bohrmaschine -item.steamadvantage.steam_drill_bit.name=Bohrer -death.attack.steam_machine=%1$s wurde zwischen die Zahnräder einer Maschine geschliffen -death.attack.steam_machine.player=%1$s wurde zwischen die Zahnräder einer Maschine von %2$s geschliffen - -tile.steamadvantage.steam_elevator.name=Dampfkraft Aufzug -tile.steamadvantage.platform.name=Dampfkraft Aufzugplattform -death.attack.musket=%1$s wurde angeschossen -death.attack.musket.player=%1$s schuss %2$s tot -item.steamadvantage.blackpowder_cartridge.name=Schießpulver Patrone -item.steamadvantage.musket.name=Schießpulver Muskete -tooltip.musket.damage=Shot befasst %x Schäden -tooltip.musket.ammo=Erfordert %x zu laden -tooltip.musket.loaded=Geladen -tooltip.musket.unloaded=Nicht geladen -enchantment.powderless=Unendlich Munition -enchantment.rapid_reload=Schnell neu laden -enchantment.high_explosive=Bombe -enchantment.recoil=Rückstoß -tile.steamadvantage.steam_track.name=Dampfkraftzug - - - -tile.steamadvantage.steam_boiler_electric.name=Elektro-Dampfkessel -tile.steamadvantage.steam_boiler_geothermal.name=Geothermische Dampfkessel - -tile.steamadvantage.steam_switch.name=Dampfventil -tile.steamadvantage.steam_still.name=Dampfkraft Brennerei -tile.steamadvantage.steam_pump.name=Dampfkraft Pumpe -tile.steamadvantage.steam_boiler_oil.name=Ölfeuerung Dampfkraft Kessel -tile.steamadvantage.pump_pipe_steam.name=Pumpenrohr diff --git a/src/main/resources/assets/steamadvantage/lang/en_au.json b/src/main/resources/assets/steamadvantage/lang/en_au.json new file mode 100644 index 0000000..1b47053 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/en_au.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Steam Governor", + "tile.steamadvantage.steam_pipe.name": "Brass Steam Pipe", + "tile.steamadvantage.steam_boiler_coal.name": "Coal-Fired Steam Boiler", + "tile.steamadvantage.steam_tank.name": "Steam Boiler Tank", + "tile.steamadvantage.steam_furnace.name": "Steam-Powered Furnace", + "tile.steamadvantage.steam_crusher.name": "Steam-Powered Rock Crusher", + "tile.steamadvantage.drillbit.name": "Drill", + "tile.steamadvantage.steam_drill.name": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit.name": "Drill Bit", + "death.attack.steam_machine": "%1$s was ground between the gears of a machine", + "death.attack.steam_machine.player": "%1$s was fed into the gears of a machine by %2$s", + "tile.steamadvantage.steam_elevator.name": "Steam-Powered Elevator", + "tile.steamadvantage.platform.name": "Steam Elevator Platform", + "death.attack.musket": "%1$s got shot", + "death.attack.musket.player": "%2$s shot %1$s dead", + "item.steamadvantage.blackpowder_cartridge.name": "Black-Powder Cartridge", + "item.steamadvantage.musket.name": "Black-Powder Musket", + "tooltip.musket.damage": "Shot deals %x damage", + "tooltip.musket.ammo": "Requires %x to reload", + "tooltip.musket.loaded": "Loaded", + "tooltip.musket.unloaded": "Not loaded", + "enchantment.powderless": "Powderless", + "enchantment.rapid_reload": "Quick Reload", + "enchantment.high_explosive": "High-Explosive", + "enchantment.recoil": "Recoil", + "tile.steamadvantage.steam_track.name": "Steam Track", + "tile.steamadvantage.steam_boiler_electric.name": "Electric Steam Boiler", + "tile.steamadvantage.steam_boiler_geothermal.name": "Geothermal Steam Boiler", + "tile.steamadvantage.steam_switch.name": "Steam Switch Valve", + "tile.steamadvantage.steam_still.name": "Steam-Powered Still", + "tile.steamadvantage.steam_pump.name": "Steam-Powered Pump", + "tile.steamadvantage.steam_boiler_oil.name": "Oil-Burning Steam Boiler", + "tile.steamadvantage.pump_pipe_steam.name": "Pump Pipe", + "item.steamadvantage.steam_governor": "Steam Governor", + "block.steamadvantage.steam_pipe": "Brass Steam Pipe", + "block.steamadvantage.steam_boiler_coal": "Coal-Fired Steam Boiler", + "block.steamadvantage.steam_tank": "Steam Boiler Tank", + "block.steamadvantage.steam_furnace": "Steam-Powered Furnace", + "block.steamadvantage.steam_crusher": "Steam-Powered Rock Crusher", + "block.steamadvantage.drillbit": "Drill", + "block.steamadvantage.steam_drill": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit": "Drill Bit", + "block.steamadvantage.steam_elevator": "Steam-Powered Elevator", + "block.steamadvantage.platform": "Steam Elevator Platform", + "item.steamadvantage.blackpowder_cartridge": "Black-Powder Cartridge", + "item.steamadvantage.musket": "Black-Powder Musket", + "block.steamadvantage.steam_track": "Steam Track", + "block.steamadvantage.steam_boiler_electric": "Electric Steam Boiler", + "block.steamadvantage.steam_boiler_geothermal": "Geothermal Steam Boiler", + "block.steamadvantage.steam_switch": "Steam Switch Valve", + "block.steamadvantage.steam_still": "Steam-Powered Still", + "block.steamadvantage.steam_pump": "Steam-Powered Pump", + "block.steamadvantage.steam_boiler_oil": "Oil-Burning Steam Boiler", + "block.steamadvantage.pump_pipe_steam": "Pump Pipe" +} diff --git a/src/main/resources/assets/steamadvantage/lang/en_au.lang b/src/main/resources/assets/steamadvantage/lang/en_au.lang deleted file mode 100644 index 0ec440b..0000000 --- a/src/main/resources/assets/steamadvantage/lang/en_au.lang +++ /dev/null @@ -1,43 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Steam Governor - -tile.steamadvantage.steam_pipe.name=Brass Steam Pipe -tile.steamadvantage.steam_boiler_coal.name=Coal-Fired Steam Boiler -tile.steamadvantage.steam_tank.name=Steam Boiler Tank -tile.steamadvantage.steam_furnace.name=Steam-Powered Furnace -tile.steamadvantage.steam_crusher.name=Steam-Powered Rock Crusher - - -tile.steamadvantage.drillbit.name=Drill -tile.steamadvantage.steam_drill.name=Steam-Powered Drill -item.steamadvantage.steam_drill_bit.name=Drill Bit -death.attack.steam_machine=%1$s was ground between the gears of a machine -death.attack.steam_machine.player=%1$s was fed into the gears of a machine by %2$s - - -tile.steamadvantage.steam_elevator.name=Steam-Powered Elevator -tile.steamadvantage.platform.name=Steam Elevator Platform -death.attack.musket=%1$s got shot -death.attack.musket.player=%2$s shot %1$s dead -item.steamadvantage.blackpowder_cartridge.name=Black-Powder Cartridge -item.steamadvantage.musket.name=Black-Powder Musket -tooltip.musket.damage=Shot deals %x damage -tooltip.musket.ammo=Requires %x to reload -tooltip.musket.loaded=Loaded -tooltip.musket.unloaded=Not loaded -enchantment.powderless=Powderless -enchantment.rapid_reload=Quick Reload -enchantment.high_explosive=High-Explosive -enchantment.recoil=Recoil -tile.steamadvantage.steam_track.name=Steam Track - - -tile.steamadvantage.steam_boiler_electric.name=Electric Steam Boiler -tile.steamadvantage.steam_boiler_geothermal.name=Geothermal Steam Boiler - -tile.steamadvantage.steam_switch.name=Steam Switch Valve -tile.steamadvantage.steam_still.name=Steam-Powered Still -tile.steamadvantage.steam_pump.name=Steam-Powered Pump -tile.steamadvantage.steam_boiler_oil.name=Oil-Burning Steam Boiler -tile.steamadvantage.pump_pipe_steam.name=Pump Pipe diff --git a/src/main/resources/assets/steamadvantage/lang/en_ca.json b/src/main/resources/assets/steamadvantage/lang/en_ca.json new file mode 100644 index 0000000..5c66bc3 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/en_ca.json @@ -0,0 +1,56 @@ +{ + "item.steamadvantage.steam_governor.name": "Steam Governor", + "tile.steamadvantage.steam_pipe.name": "Brass Steam Pipe", + "tile.steamadvantage.steam_boiler_coal.name": "Coal-Fired Steam Boiler", + "tile.steamadvantage.steam_tank.name": "Steam Boiler Tank", + "tile.steamadvantage.steam_furnace.name": "Steam-Powered Furnace", + "tile.steamadvantage.steam_crusher.name": "Steam-Powered Rock Crusher", + "tile.steamadvantage.drillbit.name": "Drill", + "tile.steamadvantage.steam_drill.name": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit.name": "Drill Bit", + "death.attack.steam_machine": "%1$s was ground between the gears of a machine", + "death.attack.steam_machine.player": "%1$s was fed into the gears of a machine by %2$s", + "tile.steamadvantage.steam_elevator.name": "Steam-Powered Elevator", + "tile.steamadvantage.platform.name": "Steam Elevator Platform", + "death.attack.musket": "%1$s got shot", + "death.attack.musket.player": "%2$s shot %1$s dead", + "item.steamadvantage.blackpowder_cartridge.name": "Black-Powder Cartridge", + "item.steamadvantage.musket.name": "Black-Powder Musket", + "tooltip.musket.damage": "Shot deals %x damage", + "tooltip.musket.ammo": "Requires %x to reload", + "tooltip.musket.loaded": "Loaded", + "tooltip.musket.unloaded": "Not loaded", + "enchantment.powderless": "Powderless", + "enchantment.rapid_reload": "Quick Reload", + "enchantment.high_explosive": "High-Explosive", + "enchantment.recoil": "Recoil", + "tile.steamadvantage.steam_track.name": "Steam Track", + "tile.steamadvantage.steam_boiler_electric.name": "Electric Steam Boiler", + "tile.steamadvantage.steam_boiler_geothermal.name": "Geothermal Steam Boiler", + "tile.steamadvantage.steam_switch.name": "Steam Switch Valve", + "tile.steamadvantage.steam_still.name": "Steam-Powered Still", + "tile.steamadvantage.steam_pump.name": "Steam-Powered Pump", + "tile.steamadvantage.steam_boiler_oil.name": "Oil-Burning Steam Boiler", + "tile.steamadvantage.pump_pipe_steam.name": "Pump Pipe", + "item.steamadvantage.steam_governor": "Steam Governor", + "block.steamadvantage.steam_pipe": "Brass Steam Pipe", + "block.steamadvantage.steam_boiler_coal": "Coal-Fired Steam Boiler", + "block.steamadvantage.steam_tank": "Steam Boiler Tank", + "block.steamadvantage.steam_furnace": "Steam-Powered Furnace", + "block.steamadvantage.steam_crusher": "Steam-Powered Rock Crusher", + "block.steamadvantage.drillbit": "Drill", + "block.steamadvantage.steam_drill": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit": "Drill Bit", + "block.steamadvantage.steam_elevator": "Steam-Powered Elevator", + "block.steamadvantage.platform": "Steam Elevator Platform", + "item.steamadvantage.blackpowder_cartridge": "Black-Powder Cartridge", + "item.steamadvantage.musket": "Black-Powder Musket", + "block.steamadvantage.steam_track": "Steam Track", + "block.steamadvantage.steam_boiler_electric": "Electric Steam Boiler", + "block.steamadvantage.steam_boiler_geothermal": "Geothermal Steam Boiler", + "block.steamadvantage.steam_switch": "Steam Switch Valve", + "block.steamadvantage.steam_still": "Steam-Powered Still", + "block.steamadvantage.steam_pump": "Steam-Powered Pump", + "block.steamadvantage.steam_boiler_oil": "Oil-Burning Steam Boiler", + "block.steamadvantage.pump_pipe_steam": "Pump Pipe" +} diff --git a/src/main/resources/assets/steamadvantage/lang/en_ca.lang b/src/main/resources/assets/steamadvantage/lang/en_ca.lang deleted file mode 100644 index c4a6f78..0000000 --- a/src/main/resources/assets/steamadvantage/lang/en_ca.lang +++ /dev/null @@ -1,42 +0,0 @@ - -item.steamadvantage.steam_governor.name=Steam Governor - -tile.steamadvantage.steam_pipe.name=Brass Steam Pipe -tile.steamadvantage.steam_boiler_coal.name=Coal-Fired Steam Boiler -tile.steamadvantage.steam_tank.name=Steam Boiler Tank -tile.steamadvantage.steam_furnace.name=Steam-Powered Furnace -tile.steamadvantage.steam_crusher.name=Steam-Powered Rock Crusher - - -tile.steamadvantage.drillbit.name=Drill -tile.steamadvantage.steam_drill.name=Steam-Powered Drill -item.steamadvantage.steam_drill_bit.name=Drill Bit -death.attack.steam_machine=%1$s was ground between the gears of a machine -death.attack.steam_machine.player=%1$s was fed into the gears of a machine by %2$s - - -tile.steamadvantage.steam_elevator.name=Steam-Powered Elevator -tile.steamadvantage.platform.name=Steam Elevator Platform -death.attack.musket=%1$s got shot -death.attack.musket.player=%2$s shot %1$s dead -item.steamadvantage.blackpowder_cartridge.name=Black-Powder Cartridge -item.steamadvantage.musket.name=Black-Powder Musket -tooltip.musket.damage=Shot deals %x damage -tooltip.musket.ammo=Requires %x to reload -tooltip.musket.loaded=Loaded -tooltip.musket.unloaded=Not loaded -enchantment.powderless=Powderless -enchantment.rapid_reload=Quick Reload -enchantment.high_explosive=High-Explosive -enchantment.recoil=Recoil -tile.steamadvantage.steam_track.name=Steam Track - - -tile.steamadvantage.steam_boiler_electric.name=Electric Steam Boiler -tile.steamadvantage.steam_boiler_geothermal.name=Geothermal Steam Boiler - -tile.steamadvantage.steam_switch.name=Steam Switch Valve -tile.steamadvantage.steam_still.name=Steam-Powered Still -tile.steamadvantage.steam_pump.name=Steam-Powered Pump -tile.steamadvantage.steam_boiler_oil.name=Oil-Burning Steam Boiler -tile.steamadvantage.pump_pipe_steam.name=Pump Pipe diff --git a/src/main/resources/assets/steamadvantage/lang/en_en.json b/src/main/resources/assets/steamadvantage/lang/en_en.json new file mode 100644 index 0000000..5c66bc3 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/en_en.json @@ -0,0 +1,56 @@ +{ + "item.steamadvantage.steam_governor.name": "Steam Governor", + "tile.steamadvantage.steam_pipe.name": "Brass Steam Pipe", + "tile.steamadvantage.steam_boiler_coal.name": "Coal-Fired Steam Boiler", + "tile.steamadvantage.steam_tank.name": "Steam Boiler Tank", + "tile.steamadvantage.steam_furnace.name": "Steam-Powered Furnace", + "tile.steamadvantage.steam_crusher.name": "Steam-Powered Rock Crusher", + "tile.steamadvantage.drillbit.name": "Drill", + "tile.steamadvantage.steam_drill.name": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit.name": "Drill Bit", + "death.attack.steam_machine": "%1$s was ground between the gears of a machine", + "death.attack.steam_machine.player": "%1$s was fed into the gears of a machine by %2$s", + "tile.steamadvantage.steam_elevator.name": "Steam-Powered Elevator", + "tile.steamadvantage.platform.name": "Steam Elevator Platform", + "death.attack.musket": "%1$s got shot", + "death.attack.musket.player": "%2$s shot %1$s dead", + "item.steamadvantage.blackpowder_cartridge.name": "Black-Powder Cartridge", + "item.steamadvantage.musket.name": "Black-Powder Musket", + "tooltip.musket.damage": "Shot deals %x damage", + "tooltip.musket.ammo": "Requires %x to reload", + "tooltip.musket.loaded": "Loaded", + "tooltip.musket.unloaded": "Not loaded", + "enchantment.powderless": "Powderless", + "enchantment.rapid_reload": "Quick Reload", + "enchantment.high_explosive": "High-Explosive", + "enchantment.recoil": "Recoil", + "tile.steamadvantage.steam_track.name": "Steam Track", + "tile.steamadvantage.steam_boiler_electric.name": "Electric Steam Boiler", + "tile.steamadvantage.steam_boiler_geothermal.name": "Geothermal Steam Boiler", + "tile.steamadvantage.steam_switch.name": "Steam Switch Valve", + "tile.steamadvantage.steam_still.name": "Steam-Powered Still", + "tile.steamadvantage.steam_pump.name": "Steam-Powered Pump", + "tile.steamadvantage.steam_boiler_oil.name": "Oil-Burning Steam Boiler", + "tile.steamadvantage.pump_pipe_steam.name": "Pump Pipe", + "item.steamadvantage.steam_governor": "Steam Governor", + "block.steamadvantage.steam_pipe": "Brass Steam Pipe", + "block.steamadvantage.steam_boiler_coal": "Coal-Fired Steam Boiler", + "block.steamadvantage.steam_tank": "Steam Boiler Tank", + "block.steamadvantage.steam_furnace": "Steam-Powered Furnace", + "block.steamadvantage.steam_crusher": "Steam-Powered Rock Crusher", + "block.steamadvantage.drillbit": "Drill", + "block.steamadvantage.steam_drill": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit": "Drill Bit", + "block.steamadvantage.steam_elevator": "Steam-Powered Elevator", + "block.steamadvantage.platform": "Steam Elevator Platform", + "item.steamadvantage.blackpowder_cartridge": "Black-Powder Cartridge", + "item.steamadvantage.musket": "Black-Powder Musket", + "block.steamadvantage.steam_track": "Steam Track", + "block.steamadvantage.steam_boiler_electric": "Electric Steam Boiler", + "block.steamadvantage.steam_boiler_geothermal": "Geothermal Steam Boiler", + "block.steamadvantage.steam_switch": "Steam Switch Valve", + "block.steamadvantage.steam_still": "Steam-Powered Still", + "block.steamadvantage.steam_pump": "Steam-Powered Pump", + "block.steamadvantage.steam_boiler_oil": "Oil-Burning Steam Boiler", + "block.steamadvantage.pump_pipe_steam": "Pump Pipe" +} diff --git a/src/main/resources/assets/steamadvantage/lang/en_en.lang b/src/main/resources/assets/steamadvantage/lang/en_en.lang deleted file mode 100644 index c4a6f78..0000000 --- a/src/main/resources/assets/steamadvantage/lang/en_en.lang +++ /dev/null @@ -1,42 +0,0 @@ - -item.steamadvantage.steam_governor.name=Steam Governor - -tile.steamadvantage.steam_pipe.name=Brass Steam Pipe -tile.steamadvantage.steam_boiler_coal.name=Coal-Fired Steam Boiler -tile.steamadvantage.steam_tank.name=Steam Boiler Tank -tile.steamadvantage.steam_furnace.name=Steam-Powered Furnace -tile.steamadvantage.steam_crusher.name=Steam-Powered Rock Crusher - - -tile.steamadvantage.drillbit.name=Drill -tile.steamadvantage.steam_drill.name=Steam-Powered Drill -item.steamadvantage.steam_drill_bit.name=Drill Bit -death.attack.steam_machine=%1$s was ground between the gears of a machine -death.attack.steam_machine.player=%1$s was fed into the gears of a machine by %2$s - - -tile.steamadvantage.steam_elevator.name=Steam-Powered Elevator -tile.steamadvantage.platform.name=Steam Elevator Platform -death.attack.musket=%1$s got shot -death.attack.musket.player=%2$s shot %1$s dead -item.steamadvantage.blackpowder_cartridge.name=Black-Powder Cartridge -item.steamadvantage.musket.name=Black-Powder Musket -tooltip.musket.damage=Shot deals %x damage -tooltip.musket.ammo=Requires %x to reload -tooltip.musket.loaded=Loaded -tooltip.musket.unloaded=Not loaded -enchantment.powderless=Powderless -enchantment.rapid_reload=Quick Reload -enchantment.high_explosive=High-Explosive -enchantment.recoil=Recoil -tile.steamadvantage.steam_track.name=Steam Track - - -tile.steamadvantage.steam_boiler_electric.name=Electric Steam Boiler -tile.steamadvantage.steam_boiler_geothermal.name=Geothermal Steam Boiler - -tile.steamadvantage.steam_switch.name=Steam Switch Valve -tile.steamadvantage.steam_still.name=Steam-Powered Still -tile.steamadvantage.steam_pump.name=Steam-Powered Pump -tile.steamadvantage.steam_boiler_oil.name=Oil-Burning Steam Boiler -tile.steamadvantage.pump_pipe_steam.name=Pump Pipe diff --git a/src/main/resources/assets/steamadvantage/lang/en_gb.json b/src/main/resources/assets/steamadvantage/lang/en_gb.json new file mode 100644 index 0000000..5c66bc3 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/en_gb.json @@ -0,0 +1,56 @@ +{ + "item.steamadvantage.steam_governor.name": "Steam Governor", + "tile.steamadvantage.steam_pipe.name": "Brass Steam Pipe", + "tile.steamadvantage.steam_boiler_coal.name": "Coal-Fired Steam Boiler", + "tile.steamadvantage.steam_tank.name": "Steam Boiler Tank", + "tile.steamadvantage.steam_furnace.name": "Steam-Powered Furnace", + "tile.steamadvantage.steam_crusher.name": "Steam-Powered Rock Crusher", + "tile.steamadvantage.drillbit.name": "Drill", + "tile.steamadvantage.steam_drill.name": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit.name": "Drill Bit", + "death.attack.steam_machine": "%1$s was ground between the gears of a machine", + "death.attack.steam_machine.player": "%1$s was fed into the gears of a machine by %2$s", + "tile.steamadvantage.steam_elevator.name": "Steam-Powered Elevator", + "tile.steamadvantage.platform.name": "Steam Elevator Platform", + "death.attack.musket": "%1$s got shot", + "death.attack.musket.player": "%2$s shot %1$s dead", + "item.steamadvantage.blackpowder_cartridge.name": "Black-Powder Cartridge", + "item.steamadvantage.musket.name": "Black-Powder Musket", + "tooltip.musket.damage": "Shot deals %x damage", + "tooltip.musket.ammo": "Requires %x to reload", + "tooltip.musket.loaded": "Loaded", + "tooltip.musket.unloaded": "Not loaded", + "enchantment.powderless": "Powderless", + "enchantment.rapid_reload": "Quick Reload", + "enchantment.high_explosive": "High-Explosive", + "enchantment.recoil": "Recoil", + "tile.steamadvantage.steam_track.name": "Steam Track", + "tile.steamadvantage.steam_boiler_electric.name": "Electric Steam Boiler", + "tile.steamadvantage.steam_boiler_geothermal.name": "Geothermal Steam Boiler", + "tile.steamadvantage.steam_switch.name": "Steam Switch Valve", + "tile.steamadvantage.steam_still.name": "Steam-Powered Still", + "tile.steamadvantage.steam_pump.name": "Steam-Powered Pump", + "tile.steamadvantage.steam_boiler_oil.name": "Oil-Burning Steam Boiler", + "tile.steamadvantage.pump_pipe_steam.name": "Pump Pipe", + "item.steamadvantage.steam_governor": "Steam Governor", + "block.steamadvantage.steam_pipe": "Brass Steam Pipe", + "block.steamadvantage.steam_boiler_coal": "Coal-Fired Steam Boiler", + "block.steamadvantage.steam_tank": "Steam Boiler Tank", + "block.steamadvantage.steam_furnace": "Steam-Powered Furnace", + "block.steamadvantage.steam_crusher": "Steam-Powered Rock Crusher", + "block.steamadvantage.drillbit": "Drill", + "block.steamadvantage.steam_drill": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit": "Drill Bit", + "block.steamadvantage.steam_elevator": "Steam-Powered Elevator", + "block.steamadvantage.platform": "Steam Elevator Platform", + "item.steamadvantage.blackpowder_cartridge": "Black-Powder Cartridge", + "item.steamadvantage.musket": "Black-Powder Musket", + "block.steamadvantage.steam_track": "Steam Track", + "block.steamadvantage.steam_boiler_electric": "Electric Steam Boiler", + "block.steamadvantage.steam_boiler_geothermal": "Geothermal Steam Boiler", + "block.steamadvantage.steam_switch": "Steam Switch Valve", + "block.steamadvantage.steam_still": "Steam-Powered Still", + "block.steamadvantage.steam_pump": "Steam-Powered Pump", + "block.steamadvantage.steam_boiler_oil": "Oil-Burning Steam Boiler", + "block.steamadvantage.pump_pipe_steam": "Pump Pipe" +} diff --git a/src/main/resources/assets/steamadvantage/lang/en_gb.lang b/src/main/resources/assets/steamadvantage/lang/en_gb.lang deleted file mode 100644 index c4a6f78..0000000 --- a/src/main/resources/assets/steamadvantage/lang/en_gb.lang +++ /dev/null @@ -1,42 +0,0 @@ - -item.steamadvantage.steam_governor.name=Steam Governor - -tile.steamadvantage.steam_pipe.name=Brass Steam Pipe -tile.steamadvantage.steam_boiler_coal.name=Coal-Fired Steam Boiler -tile.steamadvantage.steam_tank.name=Steam Boiler Tank -tile.steamadvantage.steam_furnace.name=Steam-Powered Furnace -tile.steamadvantage.steam_crusher.name=Steam-Powered Rock Crusher - - -tile.steamadvantage.drillbit.name=Drill -tile.steamadvantage.steam_drill.name=Steam-Powered Drill -item.steamadvantage.steam_drill_bit.name=Drill Bit -death.attack.steam_machine=%1$s was ground between the gears of a machine -death.attack.steam_machine.player=%1$s was fed into the gears of a machine by %2$s - - -tile.steamadvantage.steam_elevator.name=Steam-Powered Elevator -tile.steamadvantage.platform.name=Steam Elevator Platform -death.attack.musket=%1$s got shot -death.attack.musket.player=%2$s shot %1$s dead -item.steamadvantage.blackpowder_cartridge.name=Black-Powder Cartridge -item.steamadvantage.musket.name=Black-Powder Musket -tooltip.musket.damage=Shot deals %x damage -tooltip.musket.ammo=Requires %x to reload -tooltip.musket.loaded=Loaded -tooltip.musket.unloaded=Not loaded -enchantment.powderless=Powderless -enchantment.rapid_reload=Quick Reload -enchantment.high_explosive=High-Explosive -enchantment.recoil=Recoil -tile.steamadvantage.steam_track.name=Steam Track - - -tile.steamadvantage.steam_boiler_electric.name=Electric Steam Boiler -tile.steamadvantage.steam_boiler_geothermal.name=Geothermal Steam Boiler - -tile.steamadvantage.steam_switch.name=Steam Switch Valve -tile.steamadvantage.steam_still.name=Steam-Powered Still -tile.steamadvantage.steam_pump.name=Steam-Powered Pump -tile.steamadvantage.steam_boiler_oil.name=Oil-Burning Steam Boiler -tile.steamadvantage.pump_pipe_steam.name=Pump Pipe diff --git a/src/main/resources/assets/steamadvantage/lang/en_pt.json b/src/main/resources/assets/steamadvantage/lang/en_pt.json new file mode 100644 index 0000000..d3723f4 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/en_pt.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Steam Gov'ner", + "tile.steamadvantage.steam_pipe.name": "Brass Pipe", + "tile.steamadvantage.steam_boiler_coal.name": "Boiler", + "tile.steamadvantage.steam_tank.name": "Clockwerk Boiler Tank", + "tile.steamadvantage.steam_furnace.name": "Clockwerk Furnace", + "tile.steamadvantage.steam_crusher.name": "Clockwerk Stone-Chewer", + "tile.steamadvantage.drillbit.name": "Drill", + "tile.steamadvantage.steam_drill.name": "Clockwerk Drill", + "item.steamadvantage.steam_drill_bit.name": "Drill Bit", + "death.attack.steam_machine": "%1$s kissed the iron maiden", + "death.attack.steam_machine.player": "%1$s convinced %2$s to kiss the iron maiden", + "tile.steamadvantage.steam_elevator.name": "Clockwerk Plank-Raiser", + "tile.steamadvantage.platform.name": "Mecha-Plank", + "death.attack.musket": "%1$s got shot", + "death.attack.musket.player": "%2$s filled %1$s full of daylight", + "item.steamadvantage.blackpowder_cartridge.name": "Death Ball", + "item.steamadvantage.musket.name": "Blunderbuss", + "tooltip.musket.damage": "Shot deals %x damage", + "tooltip.musket.ammo": "Requires %x to reload", + "tooltip.musket.loaded": "Loaded", + "tooltip.musket.unloaded": "Not loaded", + "enchantment.powderless": "Unending Glory", + "enchantment.rapid_reload": "Faster Blaster", + "enchantment.high_explosive": "Big Boom", + "enchantment.recoil": "Kickback", + "tile.steamadvantage.steam_track.name": "Steam Path", + "tile.steamadvantage.steam_boiler_electric.name": "Lightnin' Boiler", + "tile.steamadvantage.steam_boiler_geothermal.name": "Lava Boiler", + "tile.steamadvantage.steam_switch.name": "Steam Valve", + "tile.steamadvantage.steam_still.name": "Clockwerk 'Stillery", + "tile.steamadvantage.steam_pump.name": "Clockwerk Bilge Pump", + "tile.steamadvantage.steam_boiler_oil.name": "Oil Boiler", + "tile.steamadvantage.pump_pipe_steam.name": "Pump Pipe", + "item.steamadvantage.steam_governor": "Steam Gov'ner", + "block.steamadvantage.steam_pipe": "Brass Pipe", + "block.steamadvantage.steam_boiler_coal": "Boiler", + "block.steamadvantage.steam_tank": "Clockwerk Boiler Tank", + "block.steamadvantage.steam_furnace": "Clockwerk Furnace", + "block.steamadvantage.steam_crusher": "Clockwerk Stone-Chewer", + "block.steamadvantage.drillbit": "Drill", + "block.steamadvantage.steam_drill": "Clockwerk Drill", + "item.steamadvantage.steam_drill_bit": "Drill Bit", + "block.steamadvantage.steam_elevator": "Clockwerk Plank-Raiser", + "block.steamadvantage.platform": "Mecha-Plank", + "item.steamadvantage.blackpowder_cartridge": "Death Ball", + "item.steamadvantage.musket": "Blunderbuss", + "block.steamadvantage.steam_track": "Steam Path", + "block.steamadvantage.steam_boiler_electric": "Lightnin' Boiler", + "block.steamadvantage.steam_boiler_geothermal": "Lava Boiler", + "block.steamadvantage.steam_switch": "Steam Valve", + "block.steamadvantage.steam_still": "Clockwerk 'Stillery", + "block.steamadvantage.steam_pump": "Clockwerk Bilge Pump", + "block.steamadvantage.steam_boiler_oil": "Oil Boiler", + "block.steamadvantage.pump_pipe_steam": "Pump Pipe" +} diff --git a/src/main/resources/assets/steamadvantage/lang/en_pt.lang b/src/main/resources/assets/steamadvantage/lang/en_pt.lang deleted file mode 100644 index 96edf74..0000000 --- a/src/main/resources/assets/steamadvantage/lang/en_pt.lang +++ /dev/null @@ -1,44 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Steam Gov'ner - -tile.steamadvantage.steam_pipe.name=Brass Pipe -tile.steamadvantage.steam_boiler_coal.name=Boiler -tile.steamadvantage.steam_tank.name=Clockwerk Boiler Tank -tile.steamadvantage.steam_furnace.name=Clockwerk Furnace -tile.steamadvantage.steam_crusher.name=Clockwerk Stone-Chewer - - -tile.steamadvantage.drillbit.name=Drill -tile.steamadvantage.steam_drill.name=Clockwerk Drill -item.steamadvantage.steam_drill_bit.name=Drill Bit -death.attack.steam_machine=%1$s kissed the iron maiden -death.attack.steam_machine.player=%1$s convinced %2$s to kiss the iron maiden - - -tile.steamadvantage.steam_elevator.name=Clockwerk Plank-Raiser -tile.steamadvantage.platform.name=Mecha-Plank -death.attack.musket=%1$s got shot -death.attack.musket.player=%2$s filled %1$s full of daylight -item.steamadvantage.blackpowder_cartridge.name=Death Ball -item.steamadvantage.musket.name=Blunderbuss -tooltip.musket.damage=Shot deals %x damage -tooltip.musket.ammo=Requires %x to reload -tooltip.musket.loaded=Loaded -tooltip.musket.unloaded=Not loaded -enchantment.powderless=Unending Glory -enchantment.rapid_reload=Faster Blaster -enchantment.high_explosive=Big Boom -enchantment.recoil=Kickback -tile.steamadvantage.steam_track.name=Steam Path - - - -tile.steamadvantage.steam_boiler_electric.name=Lightnin' Boiler -tile.steamadvantage.steam_boiler_geothermal.name=Lava Boiler - -tile.steamadvantage.steam_switch.name=Steam Valve -tile.steamadvantage.steam_still.name=Clockwerk 'Stillery -tile.steamadvantage.steam_pump.name=Clockwerk Bilge Pump -tile.steamadvantage.steam_boiler_oil.name=Oil Boiler -tile.steamadvantage.pump_pipe_steam.name=Pump Pipe diff --git a/src/main/resources/assets/steamadvantage/lang/en_us.json b/src/main/resources/assets/steamadvantage/lang/en_us.json new file mode 100644 index 0000000..1b47053 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/en_us.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Steam Governor", + "tile.steamadvantage.steam_pipe.name": "Brass Steam Pipe", + "tile.steamadvantage.steam_boiler_coal.name": "Coal-Fired Steam Boiler", + "tile.steamadvantage.steam_tank.name": "Steam Boiler Tank", + "tile.steamadvantage.steam_furnace.name": "Steam-Powered Furnace", + "tile.steamadvantage.steam_crusher.name": "Steam-Powered Rock Crusher", + "tile.steamadvantage.drillbit.name": "Drill", + "tile.steamadvantage.steam_drill.name": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit.name": "Drill Bit", + "death.attack.steam_machine": "%1$s was ground between the gears of a machine", + "death.attack.steam_machine.player": "%1$s was fed into the gears of a machine by %2$s", + "tile.steamadvantage.steam_elevator.name": "Steam-Powered Elevator", + "tile.steamadvantage.platform.name": "Steam Elevator Platform", + "death.attack.musket": "%1$s got shot", + "death.attack.musket.player": "%2$s shot %1$s dead", + "item.steamadvantage.blackpowder_cartridge.name": "Black-Powder Cartridge", + "item.steamadvantage.musket.name": "Black-Powder Musket", + "tooltip.musket.damage": "Shot deals %x damage", + "tooltip.musket.ammo": "Requires %x to reload", + "tooltip.musket.loaded": "Loaded", + "tooltip.musket.unloaded": "Not loaded", + "enchantment.powderless": "Powderless", + "enchantment.rapid_reload": "Quick Reload", + "enchantment.high_explosive": "High-Explosive", + "enchantment.recoil": "Recoil", + "tile.steamadvantage.steam_track.name": "Steam Track", + "tile.steamadvantage.steam_boiler_electric.name": "Electric Steam Boiler", + "tile.steamadvantage.steam_boiler_geothermal.name": "Geothermal Steam Boiler", + "tile.steamadvantage.steam_switch.name": "Steam Switch Valve", + "tile.steamadvantage.steam_still.name": "Steam-Powered Still", + "tile.steamadvantage.steam_pump.name": "Steam-Powered Pump", + "tile.steamadvantage.steam_boiler_oil.name": "Oil-Burning Steam Boiler", + "tile.steamadvantage.pump_pipe_steam.name": "Pump Pipe", + "item.steamadvantage.steam_governor": "Steam Governor", + "block.steamadvantage.steam_pipe": "Brass Steam Pipe", + "block.steamadvantage.steam_boiler_coal": "Coal-Fired Steam Boiler", + "block.steamadvantage.steam_tank": "Steam Boiler Tank", + "block.steamadvantage.steam_furnace": "Steam-Powered Furnace", + "block.steamadvantage.steam_crusher": "Steam-Powered Rock Crusher", + "block.steamadvantage.drillbit": "Drill", + "block.steamadvantage.steam_drill": "Steam-Powered Drill", + "item.steamadvantage.steam_drill_bit": "Drill Bit", + "block.steamadvantage.steam_elevator": "Steam-Powered Elevator", + "block.steamadvantage.platform": "Steam Elevator Platform", + "item.steamadvantage.blackpowder_cartridge": "Black-Powder Cartridge", + "item.steamadvantage.musket": "Black-Powder Musket", + "block.steamadvantage.steam_track": "Steam Track", + "block.steamadvantage.steam_boiler_electric": "Electric Steam Boiler", + "block.steamadvantage.steam_boiler_geothermal": "Geothermal Steam Boiler", + "block.steamadvantage.steam_switch": "Steam Switch Valve", + "block.steamadvantage.steam_still": "Steam-Powered Still", + "block.steamadvantage.steam_pump": "Steam-Powered Pump", + "block.steamadvantage.steam_boiler_oil": "Oil-Burning Steam Boiler", + "block.steamadvantage.pump_pipe_steam": "Pump Pipe" +} diff --git a/src/main/resources/assets/steamadvantage/lang/en_us.lang b/src/main/resources/assets/steamadvantage/lang/en_us.lang deleted file mode 100644 index 0ec440b..0000000 --- a/src/main/resources/assets/steamadvantage/lang/en_us.lang +++ /dev/null @@ -1,43 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Steam Governor - -tile.steamadvantage.steam_pipe.name=Brass Steam Pipe -tile.steamadvantage.steam_boiler_coal.name=Coal-Fired Steam Boiler -tile.steamadvantage.steam_tank.name=Steam Boiler Tank -tile.steamadvantage.steam_furnace.name=Steam-Powered Furnace -tile.steamadvantage.steam_crusher.name=Steam-Powered Rock Crusher - - -tile.steamadvantage.drillbit.name=Drill -tile.steamadvantage.steam_drill.name=Steam-Powered Drill -item.steamadvantage.steam_drill_bit.name=Drill Bit -death.attack.steam_machine=%1$s was ground between the gears of a machine -death.attack.steam_machine.player=%1$s was fed into the gears of a machine by %2$s - - -tile.steamadvantage.steam_elevator.name=Steam-Powered Elevator -tile.steamadvantage.platform.name=Steam Elevator Platform -death.attack.musket=%1$s got shot -death.attack.musket.player=%2$s shot %1$s dead -item.steamadvantage.blackpowder_cartridge.name=Black-Powder Cartridge -item.steamadvantage.musket.name=Black-Powder Musket -tooltip.musket.damage=Shot deals %x damage -tooltip.musket.ammo=Requires %x to reload -tooltip.musket.loaded=Loaded -tooltip.musket.unloaded=Not loaded -enchantment.powderless=Powderless -enchantment.rapid_reload=Quick Reload -enchantment.high_explosive=High-Explosive -enchantment.recoil=Recoil -tile.steamadvantage.steam_track.name=Steam Track - - -tile.steamadvantage.steam_boiler_electric.name=Electric Steam Boiler -tile.steamadvantage.steam_boiler_geothermal.name=Geothermal Steam Boiler - -tile.steamadvantage.steam_switch.name=Steam Switch Valve -tile.steamadvantage.steam_still.name=Steam-Powered Still -tile.steamadvantage.steam_pump.name=Steam-Powered Pump -tile.steamadvantage.steam_boiler_oil.name=Oil-Burning Steam Boiler -tile.steamadvantage.pump_pipe_steam.name=Pump Pipe diff --git a/src/main/resources/assets/steamadvantage/lang/es_es.json b/src/main/resources/assets/steamadvantage/lang/es_es.json new file mode 100644 index 0000000..76dbcb9 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/es_es.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Controlar de Vapor", + "tile.steamadvantage.steam_pipe.name": "Latón Tubo de Vapor", + "tile.steamadvantage.steam_boiler_coal.name": "Caldera de Vapor con Carbón", + "tile.steamadvantage.steam_tank.name": "Tanque de Vapor", + "tile.steamadvantage.steam_furnace.name": "Vapor del Horno Accionado", + "tile.steamadvantage.steam_crusher.name": "Vapor Trituradora de Piedra Accionado", + "tile.steamadvantage.drillbit.name": "Broca", + "tile.steamadvantage.steam_drill.name": "Vapor Taladro Accionado", + "item.steamadvantage.steam_drill_bit.name": "Broca", + "death.attack.steam_machine": "%1$s se molió entre los engranajes de una máquina", + "death.attack.steam_machine.player": "%1$s se molió entre los engranajes de una máquina de %2$s", + "tile.steamadvantage.steam_elevator.name": "Ascensor a Vapor", + "tile.steamadvantage.platform.name": "Vapor Plataforma Ascensor", + "death.attack.musket": "%1$s recibió un disparo", + "death.attack.musket.player": "%2$s tiro %1$s muertos", + "item.steamadvantage.blackpowder_cartridge.name": "Cartucho de Pólvora", + "item.steamadvantage.musket.name": "Mosquete", + "tooltip.musket.damage": "Disparo trata %x daños", + "tooltip.musket.ammo": "Requiere %x para recargar", + "tooltip.musket.loaded": "Cargado", + "tooltip.musket.unloaded": "No cargado", + "enchantment.powderless": "Munición Infinita", + "enchantment.rapid_reload": "Rápidamente Actualizar", + "enchantment.high_explosive": "Bomba", + "enchantment.recoil": "Retroceso", + "tile.steamadvantage.steam_track.name": "Vía a Vapor", + "tile.steamadvantage.steam_boiler_electric.name": "Caldera de Vapor Eléctrica", + "tile.steamadvantage.steam_boiler_geothermal.name": "Caldera de Vapor Geotérmico", + "tile.steamadvantage.steam_switch.name": "Válvula de Vapor", + "tile.steamadvantage.steam_still.name": "Vapor Destilería", + "tile.steamadvantage.steam_pump.name": "Vapor de la Bomba Accionada", + "tile.steamadvantage.steam_boiler_oil.name": "Caldera de Vapor con Aceite", + "tile.steamadvantage.pump_pipe_steam.name": "Tubería de la Bomba", + "item.steamadvantage.steam_governor": "Controlar de Vapor", + "block.steamadvantage.steam_pipe": "Latón Tubo de Vapor", + "block.steamadvantage.steam_boiler_coal": "Caldera de Vapor con Carbón", + "block.steamadvantage.steam_tank": "Tanque de Vapor", + "block.steamadvantage.steam_furnace": "Vapor del Horno Accionado", + "block.steamadvantage.steam_crusher": "Vapor Trituradora de Piedra Accionado", + "block.steamadvantage.drillbit": "Broca", + "block.steamadvantage.steam_drill": "Vapor Taladro Accionado", + "item.steamadvantage.steam_drill_bit": "Broca", + "block.steamadvantage.steam_elevator": "Ascensor a Vapor", + "block.steamadvantage.platform": "Vapor Plataforma Ascensor", + "item.steamadvantage.blackpowder_cartridge": "Cartucho de Pólvora", + "item.steamadvantage.musket": "Mosquete", + "block.steamadvantage.steam_track": "Vía a Vapor", + "block.steamadvantage.steam_boiler_electric": "Caldera de Vapor Eléctrica", + "block.steamadvantage.steam_boiler_geothermal": "Caldera de Vapor Geotérmico", + "block.steamadvantage.steam_switch": "Válvula de Vapor", + "block.steamadvantage.steam_still": "Vapor Destilería", + "block.steamadvantage.steam_pump": "Vapor de la Bomba Accionada", + "block.steamadvantage.steam_boiler_oil": "Caldera de Vapor con Aceite", + "block.steamadvantage.pump_pipe_steam": "Tubería de la Bomba" +} diff --git a/src/main/resources/assets/steamadvantage/lang/es_es.lang b/src/main/resources/assets/steamadvantage/lang/es_es.lang deleted file mode 100644 index c29b19b..0000000 --- a/src/main/resources/assets/steamadvantage/lang/es_es.lang +++ /dev/null @@ -1,43 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Controlar de Vapor - -tile.steamadvantage.steam_pipe.name=Latón Tubo de Vapor -tile.steamadvantage.steam_boiler_coal.name=Caldera de Vapor con Carbón -tile.steamadvantage.steam_tank.name=Tanque de Vapor -tile.steamadvantage.steam_furnace.name=Vapor del Horno Accionado -tile.steamadvantage.steam_crusher.name=Vapor Trituradora de Piedra Accionado - - -tile.steamadvantage.drillbit.name=Broca -tile.steamadvantage.steam_drill.name=Vapor Taladro Accionado -item.steamadvantage.steam_drill_bit.name=Broca -death.attack.steam_machine=%1$s se molió entre los engranajes de una máquina -death.attack.steam_machine.player=%1$s se molió entre los engranajes de una máquina de %2$s - - -tile.steamadvantage.steam_elevator.name=Ascensor a Vapor -tile.steamadvantage.platform.name=Vapor Plataforma Ascensor -death.attack.musket=%1$s recibió un disparo -death.attack.musket.player=%2$s tiro %1$s muertos -item.steamadvantage.blackpowder_cartridge.name=Cartucho de Pólvora -item.steamadvantage.musket.name=Mosquete -tooltip.musket.damage=Disparo trata %x daños -tooltip.musket.ammo=Requiere %x para recargar -tooltip.musket.loaded=Cargado -tooltip.musket.unloaded=No cargado -enchantment.powderless=Munición Infinita -enchantment.rapid_reload=Rápidamente Actualizar -enchantment.high_explosive=Bomba -enchantment.recoil=Retroceso -tile.steamadvantage.steam_track.name=Vía a Vapor - - -tile.steamadvantage.steam_boiler_electric.name=Caldera de Vapor Eléctrica -tile.steamadvantage.steam_boiler_geothermal.name=Caldera de Vapor Geotérmico - -tile.steamadvantage.steam_switch.name=Válvula de Vapor -tile.steamadvantage.steam_still.name=Vapor Destilería -tile.steamadvantage.steam_pump.name=Vapor de la Bomba Accionada -tile.steamadvantage.steam_boiler_oil.name=Caldera de Vapor con Aceite -tile.steamadvantage.pump_pipe_steam.name=Tubería de la Bomba diff --git a/src/main/resources/assets/steamadvantage/lang/es_mx.json b/src/main/resources/assets/steamadvantage/lang/es_mx.json new file mode 100644 index 0000000..76dbcb9 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/es_mx.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Controlar de Vapor", + "tile.steamadvantage.steam_pipe.name": "Latón Tubo de Vapor", + "tile.steamadvantage.steam_boiler_coal.name": "Caldera de Vapor con Carbón", + "tile.steamadvantage.steam_tank.name": "Tanque de Vapor", + "tile.steamadvantage.steam_furnace.name": "Vapor del Horno Accionado", + "tile.steamadvantage.steam_crusher.name": "Vapor Trituradora de Piedra Accionado", + "tile.steamadvantage.drillbit.name": "Broca", + "tile.steamadvantage.steam_drill.name": "Vapor Taladro Accionado", + "item.steamadvantage.steam_drill_bit.name": "Broca", + "death.attack.steam_machine": "%1$s se molió entre los engranajes de una máquina", + "death.attack.steam_machine.player": "%1$s se molió entre los engranajes de una máquina de %2$s", + "tile.steamadvantage.steam_elevator.name": "Ascensor a Vapor", + "tile.steamadvantage.platform.name": "Vapor Plataforma Ascensor", + "death.attack.musket": "%1$s recibió un disparo", + "death.attack.musket.player": "%2$s tiro %1$s muertos", + "item.steamadvantage.blackpowder_cartridge.name": "Cartucho de Pólvora", + "item.steamadvantage.musket.name": "Mosquete", + "tooltip.musket.damage": "Disparo trata %x daños", + "tooltip.musket.ammo": "Requiere %x para recargar", + "tooltip.musket.loaded": "Cargado", + "tooltip.musket.unloaded": "No cargado", + "enchantment.powderless": "Munición Infinita", + "enchantment.rapid_reload": "Rápidamente Actualizar", + "enchantment.high_explosive": "Bomba", + "enchantment.recoil": "Retroceso", + "tile.steamadvantage.steam_track.name": "Vía a Vapor", + "tile.steamadvantage.steam_boiler_electric.name": "Caldera de Vapor Eléctrica", + "tile.steamadvantage.steam_boiler_geothermal.name": "Caldera de Vapor Geotérmico", + "tile.steamadvantage.steam_switch.name": "Válvula de Vapor", + "tile.steamadvantage.steam_still.name": "Vapor Destilería", + "tile.steamadvantage.steam_pump.name": "Vapor de la Bomba Accionada", + "tile.steamadvantage.steam_boiler_oil.name": "Caldera de Vapor con Aceite", + "tile.steamadvantage.pump_pipe_steam.name": "Tubería de la Bomba", + "item.steamadvantage.steam_governor": "Controlar de Vapor", + "block.steamadvantage.steam_pipe": "Latón Tubo de Vapor", + "block.steamadvantage.steam_boiler_coal": "Caldera de Vapor con Carbón", + "block.steamadvantage.steam_tank": "Tanque de Vapor", + "block.steamadvantage.steam_furnace": "Vapor del Horno Accionado", + "block.steamadvantage.steam_crusher": "Vapor Trituradora de Piedra Accionado", + "block.steamadvantage.drillbit": "Broca", + "block.steamadvantage.steam_drill": "Vapor Taladro Accionado", + "item.steamadvantage.steam_drill_bit": "Broca", + "block.steamadvantage.steam_elevator": "Ascensor a Vapor", + "block.steamadvantage.platform": "Vapor Plataforma Ascensor", + "item.steamadvantage.blackpowder_cartridge": "Cartucho de Pólvora", + "item.steamadvantage.musket": "Mosquete", + "block.steamadvantage.steam_track": "Vía a Vapor", + "block.steamadvantage.steam_boiler_electric": "Caldera de Vapor Eléctrica", + "block.steamadvantage.steam_boiler_geothermal": "Caldera de Vapor Geotérmico", + "block.steamadvantage.steam_switch": "Válvula de Vapor", + "block.steamadvantage.steam_still": "Vapor Destilería", + "block.steamadvantage.steam_pump": "Vapor de la Bomba Accionada", + "block.steamadvantage.steam_boiler_oil": "Caldera de Vapor con Aceite", + "block.steamadvantage.pump_pipe_steam": "Tubería de la Bomba" +} diff --git a/src/main/resources/assets/steamadvantage/lang/es_mx.lang b/src/main/resources/assets/steamadvantage/lang/es_mx.lang deleted file mode 100644 index dfdffdd..0000000 --- a/src/main/resources/assets/steamadvantage/lang/es_mx.lang +++ /dev/null @@ -1,46 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Controlar de Vapor - -tile.steamadvantage.steam_pipe.name=Latón Tubo de Vapor -tile.steamadvantage.steam_boiler_coal.name=Caldera de Vapor con Carbón -tile.steamadvantage.steam_tank.name=Tanque de Vapor -tile.steamadvantage.steam_furnace.name=Vapor del Horno Accionado -tile.steamadvantage.steam_crusher.name=Vapor Trituradora de Piedra Accionado - - -tile.steamadvantage.drillbit.name=Broca -tile.steamadvantage.steam_drill.name=Vapor Taladro Accionado -item.steamadvantage.steam_drill_bit.name=Broca -death.attack.steam_machine=%1$s se molió entre los engranajes de una máquina -death.attack.steam_machine.player=%1$s se molió entre los engranajes de una máquina de %2$s - - - -tile.steamadvantage.steam_elevator.name=Ascensor a Vapor -tile.steamadvantage.platform.name=Vapor Plataforma Ascensor -death.attack.musket=%1$s recibió un disparo -death.attack.musket.player=%2$s tiro %1$s muertos -item.steamadvantage.blackpowder_cartridge.name=Cartucho de Pólvora -item.steamadvantage.musket.name=Mosquete -tooltip.musket.damage=Disparo trata %x daños -tooltip.musket.ammo=Requiere %x para recargar -tooltip.musket.loaded=Cargado -tooltip.musket.unloaded=No cargado -enchantment.powderless=Munición Infinita -enchantment.rapid_reload=Rápidamente Actualizar -enchantment.high_explosive=Bomba -enchantment.recoil=Retroceso -tile.steamadvantage.steam_track.name=Vía a Vapor - - - - -tile.steamadvantage.steam_boiler_electric.name=Caldera de Vapor Eléctrica -tile.steamadvantage.steam_boiler_geothermal.name=Caldera de Vapor Geotérmico - -tile.steamadvantage.steam_switch.name=Válvula de Vapor -tile.steamadvantage.steam_still.name=Vapor Destilería -tile.steamadvantage.steam_pump.name=Vapor de la Bomba Accionada -tile.steamadvantage.steam_boiler_oil.name=Caldera de Vapor con Aceite -tile.steamadvantage.pump_pipe_steam.name=Tubería de la Bomba diff --git a/src/main/resources/assets/steamadvantage/lang/fr_ca.json b/src/main/resources/assets/steamadvantage/lang/fr_ca.json new file mode 100644 index 0000000..35a5f1a --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/fr_ca.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), french (fr_FR,fr_CA), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Régulateur de vapeur", + "tile.steamadvantage.steam_pipe.name": "Tuyau de vapeur en laiton", + "tile.steamadvantage.steam_boiler_coal.name": "Chaudière à vapeur bois-charbon", + "tile.steamadvantage.steam_tank.name": "Réservoir de chaudière à vapeur", + "tile.steamadvantage.steam_furnace.name": "Four alimenté à la vapeur", + "tile.steamadvantage.steam_crusher.name": "Broyeur de roches alimenté à la vapeur", + "tile.steamadvantage.drillbit.name": "Foret", + "tile.steamadvantage.steam_drill.name": "Foret alimenté à la vapeur", + "item.steamadvantage.steam_drill_bit.name": "Morceau de foret", + "death.attack.steam_machine": "%1$s a été écrasé dans les engrenages d'une machine", + "death.attack.steam_machine.player": "%1$s a été poussé dans les engrenages d'une machine par %2$s", + "tile.steamadvantage.steam_elevator.name": "Ascenseur alimenté à la vapeur", + "tile.steamadvantage.platform.name": "Plate-forme ascenceur à vapeur", + "death.attack.musket": "%1$s got shot", + "death.attack.musket.player": "%2$s shot %1$s dead", + "item.steamadvantage.blackpowder_cartridge.name": "Cartouche de poudre noire", + "item.steamadvantage.musket.name": "Mousquet à poudre noire", + "tooltip.musket.damage": "Le tir provoque %x dégats", + "tooltip.musket.ammo": "Demande %x pour recharger", + "tooltip.musket.loaded": "Chargé", + "tooltip.musket.unloaded": "Non chargé", + "enchantment.powderless": "Sans poudre", + "enchantment.rapid_reload": "Rechargement rapide", + "enchantment.high_explosive": "High-Explosif", + "enchantment.recoil": "Recul", + "tile.steamadvantage.steam_track.name": "Trace de vapeur", + "tile.steamadvantage.steam_boiler_electric.name": "Chaudière à Vapeur Électrique", + "tile.steamadvantage.steam_boiler_geothermal.name": "Chaudière à Vapeur Géothermique", + "tile.steamadvantage.steam_switch.name": "Soupape de vapeur", + "tile.steamadvantage.steam_still.name": "Vapeur distillerie alimenté", + "tile.steamadvantage.steam_pump.name": "Vapeur pompe alimentée", + "tile.steamadvantage.steam_boiler_oil.name": "Chaudière à l'huile", + "tile.steamadvantage.pump_pipe_steam.name": "Tubería de la Bomba", + "item.steamadvantage.steam_governor": "Régulateur de vapeur", + "block.steamadvantage.steam_pipe": "Tuyau de vapeur en laiton", + "block.steamadvantage.steam_boiler_coal": "Chaudière à vapeur bois-charbon", + "block.steamadvantage.steam_tank": "Réservoir de chaudière à vapeur", + "block.steamadvantage.steam_furnace": "Four alimenté à la vapeur", + "block.steamadvantage.steam_crusher": "Broyeur de roches alimenté à la vapeur", + "block.steamadvantage.drillbit": "Foret", + "block.steamadvantage.steam_drill": "Foret alimenté à la vapeur", + "item.steamadvantage.steam_drill_bit": "Morceau de foret", + "block.steamadvantage.steam_elevator": "Ascenseur alimenté à la vapeur", + "block.steamadvantage.platform": "Plate-forme ascenceur à vapeur", + "item.steamadvantage.blackpowder_cartridge": "Cartouche de poudre noire", + "item.steamadvantage.musket": "Mousquet à poudre noire", + "block.steamadvantage.steam_track": "Trace de vapeur", + "block.steamadvantage.steam_boiler_electric": "Chaudière à Vapeur Électrique", + "block.steamadvantage.steam_boiler_geothermal": "Chaudière à Vapeur Géothermique", + "block.steamadvantage.steam_switch": "Soupape de vapeur", + "block.steamadvantage.steam_still": "Vapeur distillerie alimenté", + "block.steamadvantage.steam_pump": "Vapeur pompe alimentée", + "block.steamadvantage.steam_boiler_oil": "Chaudière à l'huile", + "block.steamadvantage.pump_pipe_steam": "Tubería de la Bomba" +} diff --git a/src/main/resources/assets/steamadvantage/lang/fr_ca.lang b/src/main/resources/assets/steamadvantage/lang/fr_ca.lang deleted file mode 100644 index 965481f..0000000 --- a/src/main/resources/assets/steamadvantage/lang/fr_ca.lang +++ /dev/null @@ -1,43 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), french (fr_FR,fr_CA), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Régulateur de vapeur - -tile.steamadvantage.steam_pipe.name=Tuyau de vapeur en laiton -tile.steamadvantage.steam_boiler_coal.name=Chaudière à vapeur bois-charbon -tile.steamadvantage.steam_tank.name=Réservoir de chaudière à vapeur -tile.steamadvantage.steam_furnace.name=Four alimenté à la vapeur -tile.steamadvantage.steam_crusher.name=Broyeur de roches alimenté à la vapeur - - -tile.steamadvantage.drillbit.name=Foret -tile.steamadvantage.steam_drill.name=Foret alimenté à la vapeur -item.steamadvantage.steam_drill_bit.name=Morceau de foret -death.attack.steam_machine=%1$s a été écrasé dans les engrenages d'une machine -death.attack.steam_machine.player=%1$s a été poussé dans les engrenages d'une machine par %2$s - - -tile.steamadvantage.steam_elevator.name=Ascenseur alimenté à la vapeur -tile.steamadvantage.platform.name=Plate-forme ascenceur à vapeur -death.attack.musket=%1$s got shot -death.attack.musket.player=%2$s shot %1$s dead -item.steamadvantage.blackpowder_cartridge.name=Cartouche de poudre noire -item.steamadvantage.musket.name=Mousquet à poudre noire -tooltip.musket.damage=Le tir provoque %x dégats -tooltip.musket.ammo=Demande %x pour recharger -tooltip.musket.loaded=Chargé -tooltip.musket.unloaded=Non chargé -enchantment.powderless=Sans poudre -enchantment.rapid_reload=Rechargement rapide -enchantment.high_explosive=High-Explosif -enchantment.recoil=Recul -tile.steamadvantage.steam_track.name=Trace de vapeur - - -tile.steamadvantage.steam_boiler_electric.name=Chaudière à Vapeur Électrique -tile.steamadvantage.steam_boiler_geothermal.name=Chaudière à Vapeur Géothermique - -tile.steamadvantage.steam_switch.name=Soupape de vapeur -tile.steamadvantage.steam_still.name=Vapeur distillerie alimenté -tile.steamadvantage.steam_pump.name=Vapeur pompe alimentée -tile.steamadvantage.steam_boiler_oil.name=Chaudière à l'huile -tile.steamadvantage.pump_pipe_steam.name=Tubería de la Bomba diff --git a/src/main/resources/assets/steamadvantage/lang/fr_fr.json b/src/main/resources/assets/steamadvantage/lang/fr_fr.json new file mode 100644 index 0000000..35a5f1a --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/fr_fr.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), french (fr_FR,fr_CA), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Régulateur de vapeur", + "tile.steamadvantage.steam_pipe.name": "Tuyau de vapeur en laiton", + "tile.steamadvantage.steam_boiler_coal.name": "Chaudière à vapeur bois-charbon", + "tile.steamadvantage.steam_tank.name": "Réservoir de chaudière à vapeur", + "tile.steamadvantage.steam_furnace.name": "Four alimenté à la vapeur", + "tile.steamadvantage.steam_crusher.name": "Broyeur de roches alimenté à la vapeur", + "tile.steamadvantage.drillbit.name": "Foret", + "tile.steamadvantage.steam_drill.name": "Foret alimenté à la vapeur", + "item.steamadvantage.steam_drill_bit.name": "Morceau de foret", + "death.attack.steam_machine": "%1$s a été écrasé dans les engrenages d'une machine", + "death.attack.steam_machine.player": "%1$s a été poussé dans les engrenages d'une machine par %2$s", + "tile.steamadvantage.steam_elevator.name": "Ascenseur alimenté à la vapeur", + "tile.steamadvantage.platform.name": "Plate-forme ascenceur à vapeur", + "death.attack.musket": "%1$s got shot", + "death.attack.musket.player": "%2$s shot %1$s dead", + "item.steamadvantage.blackpowder_cartridge.name": "Cartouche de poudre noire", + "item.steamadvantage.musket.name": "Mousquet à poudre noire", + "tooltip.musket.damage": "Le tir provoque %x dégats", + "tooltip.musket.ammo": "Demande %x pour recharger", + "tooltip.musket.loaded": "Chargé", + "tooltip.musket.unloaded": "Non chargé", + "enchantment.powderless": "Sans poudre", + "enchantment.rapid_reload": "Rechargement rapide", + "enchantment.high_explosive": "High-Explosif", + "enchantment.recoil": "Recul", + "tile.steamadvantage.steam_track.name": "Trace de vapeur", + "tile.steamadvantage.steam_boiler_electric.name": "Chaudière à Vapeur Électrique", + "tile.steamadvantage.steam_boiler_geothermal.name": "Chaudière à Vapeur Géothermique", + "tile.steamadvantage.steam_switch.name": "Soupape de vapeur", + "tile.steamadvantage.steam_still.name": "Vapeur distillerie alimenté", + "tile.steamadvantage.steam_pump.name": "Vapeur pompe alimentée", + "tile.steamadvantage.steam_boiler_oil.name": "Chaudière à l'huile", + "tile.steamadvantage.pump_pipe_steam.name": "Tubería de la Bomba", + "item.steamadvantage.steam_governor": "Régulateur de vapeur", + "block.steamadvantage.steam_pipe": "Tuyau de vapeur en laiton", + "block.steamadvantage.steam_boiler_coal": "Chaudière à vapeur bois-charbon", + "block.steamadvantage.steam_tank": "Réservoir de chaudière à vapeur", + "block.steamadvantage.steam_furnace": "Four alimenté à la vapeur", + "block.steamadvantage.steam_crusher": "Broyeur de roches alimenté à la vapeur", + "block.steamadvantage.drillbit": "Foret", + "block.steamadvantage.steam_drill": "Foret alimenté à la vapeur", + "item.steamadvantage.steam_drill_bit": "Morceau de foret", + "block.steamadvantage.steam_elevator": "Ascenseur alimenté à la vapeur", + "block.steamadvantage.platform": "Plate-forme ascenceur à vapeur", + "item.steamadvantage.blackpowder_cartridge": "Cartouche de poudre noire", + "item.steamadvantage.musket": "Mousquet à poudre noire", + "block.steamadvantage.steam_track": "Trace de vapeur", + "block.steamadvantage.steam_boiler_electric": "Chaudière à Vapeur Électrique", + "block.steamadvantage.steam_boiler_geothermal": "Chaudière à Vapeur Géothermique", + "block.steamadvantage.steam_switch": "Soupape de vapeur", + "block.steamadvantage.steam_still": "Vapeur distillerie alimenté", + "block.steamadvantage.steam_pump": "Vapeur pompe alimentée", + "block.steamadvantage.steam_boiler_oil": "Chaudière à l'huile", + "block.steamadvantage.pump_pipe_steam": "Tubería de la Bomba" +} diff --git a/src/main/resources/assets/steamadvantage/lang/fr_fr.lang b/src/main/resources/assets/steamadvantage/lang/fr_fr.lang deleted file mode 100644 index 59bf38d..0000000 --- a/src/main/resources/assets/steamadvantage/lang/fr_fr.lang +++ /dev/null @@ -1,44 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), french (fr_FR,fr_CA), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Régulateur de vapeur - -tile.steamadvantage.steam_pipe.name=Tuyau de vapeur en laiton -tile.steamadvantage.steam_boiler_coal.name=Chaudière à vapeur bois-charbon -tile.steamadvantage.steam_tank.name=Réservoir de chaudière à vapeur -tile.steamadvantage.steam_furnace.name=Four alimenté à la vapeur -tile.steamadvantage.steam_crusher.name=Broyeur de roches alimenté à la vapeur - - -tile.steamadvantage.drillbit.name=Foret -tile.steamadvantage.steam_drill.name=Foret alimenté à la vapeur -item.steamadvantage.steam_drill_bit.name=Morceau de foret -death.attack.steam_machine=%1$s a été écrasé dans les engrenages d'une machine -death.attack.steam_machine.player=%1$s a été poussé dans les engrenages d'une machine par %2$s - - -tile.steamadvantage.steam_elevator.name=Ascenseur alimenté à la vapeur -tile.steamadvantage.platform.name=Plate-forme ascenceur à vapeur -death.attack.musket=%1$s got shot -death.attack.musket.player=%2$s shot %1$s dead -item.steamadvantage.blackpowder_cartridge.name=Cartouche de poudre noire -item.steamadvantage.musket.name=Mousquet à poudre noire -tooltip.musket.damage=Le tir provoque %x dégats -tooltip.musket.ammo=Demande %x pour recharger -tooltip.musket.loaded=Chargé -tooltip.musket.unloaded=Non chargé -enchantment.powderless=Sans poudre -enchantment.rapid_reload=Rechargement rapide -enchantment.high_explosive=High-Explosif -enchantment.recoil=Recul -tile.steamadvantage.steam_track.name=Trace de vapeur - - - -tile.steamadvantage.steam_boiler_electric.name=Chaudière à Vapeur Électrique -tile.steamadvantage.steam_boiler_geothermal.name=Chaudière à Vapeur Géothermique - -tile.steamadvantage.steam_switch.name=Soupape de vapeur -tile.steamadvantage.steam_still.name=Vapeur distillerie alimenté -tile.steamadvantage.steam_pump.name=Vapeur pompe alimentée -tile.steamadvantage.steam_boiler_oil.name=Chaudière à l'huile -tile.steamadvantage.pump_pipe_steam.name=Tubería de la Bomba diff --git a/src/main/resources/assets/steamadvantage/lang/it_it.json b/src/main/resources/assets/steamadvantage/lang/it_it.json new file mode 100644 index 0000000..e5a9066 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/it_it.json @@ -0,0 +1,56 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Valvola di Controllo", + "tile.steamadvantage.steam_pipe.name": "Ottone Tubo di Vapore", + "tile.steamadvantage.steam_boiler_coal.name": "Caldaia di Vapore", + "tile.steamadvantage.steam_tank.name": "Carro a Vapore", + "tile.steamadvantage.steam_furnace.name": "Forno a Vapore Alimentata", + "tile.steamadvantage.steam_crusher.name": "Polverizzatore Masso a Vapore Alimentata", + "tile.steamadvantage.drillbit.name": "Trapano", + "tile.steamadvantage.steam_drill.name": "Trapano a Vapore", + "item.steamadvantage.steam_drill_bit.name": "Trapano", + "death.attack.steam_machine": "%1$s è stato macinato tra gli ingranaggi di una macchina", + "death.attack.steam_machine.player": "%1$s è stato macinato tra gli ingranaggi di una macchina di %2$s", + "tile.steamadvantage.steam_elevator.name": "Ascensore a Vapore", + "tile.steamadvantage.platform.name": "Ascensore a Vapore Piattaforma", + "death.attack.musket": "%1$s hanno sparato", + "death.attack.musket.player": "%2$s colpo %1$s morti", + "item.steamadvantage.blackpowder_cartridge.name": "Cartuccia Polvere da Sparo", + "item.steamadvantage.musket.name": "Moschetto", + "tooltip.musket.damage": "Girato occupa %x danni", + "tooltip.musket.ammo": "Richiede %x per ricaricare", + "tooltip.musket.loaded": "Caricato", + "tooltip.musket.unloaded": "Non caricato", + "enchantment.powderless": "Munizioni Infinite", + "enchantment.rapid_reload": "Rapidamente Reload", + "enchantment.high_explosive": "Bomba", + "enchantment.recoil": "Rinculo", + "tile.steamadvantage.steam_track.name": "Pista a Vapore", + "tile.steamadvantage.steam_boiler_electric.name": "Caldaia a Vapore Elettrica", + "tile.steamadvantage.steam_boiler_geothermal.name": "Caldaia a Vapore Geotermico", + "tile.steamadvantage.steam_switch.name": "Valvola del Vapore", + "tile.steamadvantage.steam_still.name": "A Vapore Alimentata Distilleria", + "tile.steamadvantage.steam_pump.name": "Pompa Alimentata a Vapore", + "tile.steamadvantage.steam_boiler_oil.name": "Caldaia ad Olio Combustibile", + "tile.electricadvantage.pump_pipe_steam.name": "Tubo Pompa", + "item.steamadvantage.steam_governor": "Valvola di Controllo", + "block.steamadvantage.steam_pipe": "Ottone Tubo di Vapore", + "block.steamadvantage.steam_boiler_coal": "Caldaia di Vapore", + "block.steamadvantage.steam_tank": "Carro a Vapore", + "block.steamadvantage.steam_furnace": "Forno a Vapore Alimentata", + "block.steamadvantage.steam_crusher": "Polverizzatore Masso a Vapore Alimentata", + "block.steamadvantage.drillbit": "Trapano", + "block.steamadvantage.steam_drill": "Trapano a Vapore", + "item.steamadvantage.steam_drill_bit": "Trapano", + "block.steamadvantage.steam_elevator": "Ascensore a Vapore", + "block.steamadvantage.platform": "Ascensore a Vapore Piattaforma", + "item.steamadvantage.blackpowder_cartridge": "Cartuccia Polvere da Sparo", + "item.steamadvantage.musket": "Moschetto", + "block.steamadvantage.steam_track": "Pista a Vapore", + "block.steamadvantage.steam_boiler_electric": "Caldaia a Vapore Elettrica", + "block.steamadvantage.steam_boiler_geothermal": "Caldaia a Vapore Geotermico", + "block.steamadvantage.steam_switch": "Valvola del Vapore", + "block.steamadvantage.steam_still": "A Vapore Alimentata Distilleria", + "block.steamadvantage.steam_pump": "Pompa Alimentata a Vapore", + "block.steamadvantage.steam_boiler_oil": "Caldaia ad Olio Combustibile" +} diff --git a/src/main/resources/assets/steamadvantage/lang/it_it.lang b/src/main/resources/assets/steamadvantage/lang/it_it.lang deleted file mode 100644 index 66856aa..0000000 --- a/src/main/resources/assets/steamadvantage/lang/it_it.lang +++ /dev/null @@ -1,44 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Valvola di Controllo - -tile.steamadvantage.steam_pipe.name=Ottone Tubo di Vapore -tile.steamadvantage.steam_boiler_coal.name=Caldaia di Vapore -tile.steamadvantage.steam_tank.name=Carro a Vapore -tile.steamadvantage.steam_furnace.name=Forno a Vapore Alimentata -tile.steamadvantage.steam_crusher.name=Polverizzatore Masso a Vapore Alimentata - -tile.steamadvantage.drillbit.name=Trapano -tile.steamadvantage.steam_drill.name=Trapano a Vapore -item.steamadvantage.steam_drill_bit.name=Trapano -death.attack.steam_machine=%1$s è stato macinato tra gli ingranaggi di una macchina -death.attack.steam_machine.player=%1$s è stato macinato tra gli ingranaggi di una macchina di %2$s - - -tile.steamadvantage.steam_elevator.name=Ascensore a Vapore -tile.steamadvantage.platform.name=Ascensore a Vapore Piattaforma -death.attack.musket=%1$s hanno sparato -death.attack.musket.player=%2$s colpo %1$s morti -item.steamadvantage.blackpowder_cartridge.name=Cartuccia Polvere da Sparo -item.steamadvantage.musket.name=Moschetto -tooltip.musket.damage=Girato occupa %x danni -tooltip.musket.ammo=Richiede %x per ricaricare -tooltip.musket.loaded=Caricato -tooltip.musket.unloaded=Non caricato -enchantment.powderless=Munizioni Infinite -enchantment.rapid_reload=Rapidamente Reload -enchantment.high_explosive=Bomba -enchantment.recoil=Rinculo -tile.steamadvantage.steam_track.name=Pista a Vapore - - - - -tile.steamadvantage.steam_boiler_electric.name=Caldaia a Vapore Elettrica -tile.steamadvantage.steam_boiler_geothermal.name=Caldaia a Vapore Geotermico - -tile.steamadvantage.steam_switch.name=Valvola del Vapore -tile.steamadvantage.steam_still.name=A Vapore Alimentata Distilleria -tile.steamadvantage.steam_pump.name=Pompa Alimentata a Vapore -tile.steamadvantage.steam_boiler_oil.name=Caldaia ad Olio Combustibile -tile.electricadvantage.pump_pipe_steam.name=Tubo Pompa diff --git a/src/main/resources/assets/steamadvantage/lang/ja_jp.json b/src/main/resources/assets/steamadvantage/lang/ja_jp.json new file mode 100644 index 0000000..17f11dd --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/ja_jp.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "コントロールバルブスチーム", + "tile.steamadvantage.steam_pipe.name": "真鍮蒸気管", + "tile.steamadvantage.steam_boiler_coal.name": "蒸気ボイラ", + "tile.steamadvantage.steam_tank.name": "スチームタンク", + "tile.steamadvantage.steam_furnace.name": "蒸気動力炉", + "tile.steamadvantage.steam_crusher.name": "スチームパワードロッククラッシャー", + "tile.steamadvantage.drillbit.name": "ドリルビット", + "tile.steamadvantage.steam_drill.name": "蒸気ドリル", + "item.steamadvantage.steam_drill_bit.name": "ドリルビット", + "death.attack.steam_machine": "%1$s 機械の歯車の間に粉砕しました", + "death.attack.steam_machine.player": "%1$s %2$s による機械の歯車の間に粉砕し、", + "tile.steamadvantage.steam_elevator.name": "スチームパワードエレベーター", + "tile.steamadvantage.platform.name": "エレベータープラットフォームスチーム", + "death.attack.musket": "%1$sは撃たれました", + "death.attack.musket.player": "%2$sのショット%1$sの死", + "item.steamadvantage.blackpowder_cartridge.name": "火薬カートリッジ", + "item.steamadvantage.musket.name": "マスケット銃", + "tooltip.musket.damage": "ショットは、%x点のダメージを与えます", + "tooltip.musket.ammo": "リロードするには、%xを必要とし", + "tooltip.musket.loaded": "ロードされました", + "tooltip.musket.unloaded": "ロードされていません", + "enchantment.powderless": "無限の弾薬", + "enchantment.rapid_reload": "素早くリロード", + "enchantment.high_explosive": "爆弾", + "enchantment.recoil": "リコイル", + "tile.steamadvantage.steam_track.name": "蒸気トレース", + "tile.steamadvantage.steam_boiler_electric.name": "電気蒸気ボイラ", + "tile.steamadvantage.steam_boiler_geothermal.name": "地熱蒸気ボイラー", + "tile.steamadvantage.steam_switch.name": "蒸気弁", + "tile.steamadvantage.steam_still.name": "蒸気駆動の蒸留所", + "tile.steamadvantage.steam_pump.name": "蒸気駆動のポンプ", + "tile.steamadvantage.steam_boiler_oil.name": "石油燃焼ボイラー", + "tile.steamadvantage.pump_pipe_steam.name": "ポンプ配管", + "item.steamadvantage.steam_governor": "コントロールバルブスチーム", + "block.steamadvantage.steam_pipe": "真鍮蒸気管", + "block.steamadvantage.steam_boiler_coal": "蒸気ボイラ", + "block.steamadvantage.steam_tank": "スチームタンク", + "block.steamadvantage.steam_furnace": "蒸気動力炉", + "block.steamadvantage.steam_crusher": "スチームパワードロッククラッシャー", + "block.steamadvantage.drillbit": "ドリルビット", + "block.steamadvantage.steam_drill": "蒸気ドリル", + "item.steamadvantage.steam_drill_bit": "ドリルビット", + "block.steamadvantage.steam_elevator": "スチームパワードエレベーター", + "block.steamadvantage.platform": "エレベータープラットフォームスチーム", + "item.steamadvantage.blackpowder_cartridge": "火薬カートリッジ", + "item.steamadvantage.musket": "マスケット銃", + "block.steamadvantage.steam_track": "蒸気トレース", + "block.steamadvantage.steam_boiler_electric": "電気蒸気ボイラ", + "block.steamadvantage.steam_boiler_geothermal": "地熱蒸気ボイラー", + "block.steamadvantage.steam_switch": "蒸気弁", + "block.steamadvantage.steam_still": "蒸気駆動の蒸留所", + "block.steamadvantage.steam_pump": "蒸気駆動のポンプ", + "block.steamadvantage.steam_boiler_oil": "石油燃焼ボイラー", + "block.steamadvantage.pump_pipe_steam": "ポンプ配管" +} diff --git a/src/main/resources/assets/steamadvantage/lang/ja_jp.lang b/src/main/resources/assets/steamadvantage/lang/ja_jp.lang deleted file mode 100644 index ecb2cc9..0000000 --- a/src/main/resources/assets/steamadvantage/lang/ja_jp.lang +++ /dev/null @@ -1,45 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=コントロールバルブスチーム - -tile.steamadvantage.steam_pipe.name=真鍮蒸気管 -tile.steamadvantage.steam_boiler_coal.name=蒸気ボイラ -tile.steamadvantage.steam_tank.name=スチームタンク -tile.steamadvantage.steam_furnace.name=蒸気動力炉 -tile.steamadvantage.steam_crusher.name=スチームパワードロッククラッシャー - - -tile.steamadvantage.drillbit.name=ドリルビット -tile.steamadvantage.steam_drill.name=蒸気ドリル -item.steamadvantage.steam_drill_bit.name=ドリルビット -death.attack.steam_machine=%1$s 機械の歯車の間に粉砕しました -death.attack.steam_machine.player=%1$s %2$s による機械の歯車の間に粉砕し、 - - -tile.steamadvantage.steam_elevator.name=スチームパワードエレベーター -tile.steamadvantage.platform.name=エレベータープラットフォームスチーム -death.attack.musket=%1$sは撃たれました -death.attack.musket.player=%2$sのショット%1$sの死 -item.steamadvantage.blackpowder_cartridge.name=火薬カートリッジ -item.steamadvantage.musket.name=マスケット銃 -tooltip.musket.damage=ショットは、%x点のダメージを与えます -tooltip.musket.ammo=リロードするには、%xを必要とし -tooltip.musket.loaded=ロードされました -tooltip.musket.unloaded=ロードされていません -enchantment.powderless=無限の弾薬 -enchantment.rapid_reload=素早くリロード -enchantment.high_explosive=爆弾 -enchantment.recoil=リコイル -tile.steamadvantage.steam_track.name=蒸気トレース - - - - -tile.steamadvantage.steam_boiler_electric.name=電気蒸気ボイラ -tile.steamadvantage.steam_boiler_geothermal.name=地熱蒸気ボイラー - -tile.steamadvantage.steam_switch.name=蒸気弁 -tile.steamadvantage.steam_still.name=蒸気駆動の蒸留所 -tile.steamadvantage.steam_pump.name=蒸気駆動のポンプ -tile.steamadvantage.steam_boiler_oil.name=石油燃焼ボイラー -tile.steamadvantage.pump_pipe_steam.name=ポンプ配管 diff --git a/src/main/resources/assets/steamadvantage/lang/ko_kr.json b/src/main/resources/assets/steamadvantage/lang/ko_kr.json new file mode 100644 index 0000000..5572ab0 --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/ko_kr.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "제어 밸브 증기", + "tile.steamadvantage.steam_pipe.name": "황동 증기 파이프", + "tile.steamadvantage.steam_boiler_coal.name": "증기 보일러", + "tile.steamadvantage.steam_tank.name": "스팀 탱크", + "tile.steamadvantage.steam_furnace.name": "증기 구동 전기로", + "tile.steamadvantage.steam_crusher.name": "증기 구동 록 크러셔", + "tile.steamadvantage.drillbit.name": "드릴 비트", + "tile.steamadvantage.steam_drill.name": "증기 구동 드릴", + "item.steamadvantage.steam_drill_bit.name": "드릴 비트", + "death.attack.steam_machine": "%1$s 기계의 기어 사이 분쇄", + "death.attack.steam_machine.player": "%1$s %2$s 에 의해 기계의 기어 사이에 분쇄", + "tile.steamadvantage.steam_elevator.name": "증기 구동 엘리베이터", + "tile.steamadvantage.platform.name": "엘리베이터 플랫폼 스팀", + "death.attack.musket": "%1$s는 총에 맞았", + "death.attack.musket.player": "%2$s 샷% %1$s죽은", + "item.steamadvantage.blackpowder_cartridge.name": "화약 카트리지", + "item.steamadvantage.musket.name": "구식 보병 총", + "tooltip.musket.damage": "총 의 %x의 피해를", + "tooltip.musket.ammo": "다시로드 %x를 필요", + "tooltip.musket.loaded": "로드", + "tooltip.musket.unloaded": "로드되지", + "enchantment.powderless": "무한 탄약", + "enchantment.rapid_reload": "신속하게 다시로드", + "enchantment.high_explosive": "폭탄", + "enchantment.recoil": "뒷걸음질", + "tile.steamadvantage.steam_track.name": "증기 선로", + "tile.steamadvantage.steam_boiler_electric.name": "전기 스팀 보일러", + "tile.steamadvantage.steam_boiler_geothermal.name": "지열 증기 보일러", + "tile.steamadvantage.steam_switch.name": "스팀 밸브", + "tile.steamadvantage.steam_still.name": "증기 구동 증류소", + "tile.steamadvantage.steam_pump.name": "증기 구동 펌프", + "tile.steamadvantage.steam_boiler_oil.name": "기름 연소 보일러", + "tile.steamadvantage.pump_pipe_steam.name": "펌프 파이프", + "item.steamadvantage.steam_governor": "제어 밸브 증기", + "block.steamadvantage.steam_pipe": "황동 증기 파이프", + "block.steamadvantage.steam_boiler_coal": "증기 보일러", + "block.steamadvantage.steam_tank": "스팀 탱크", + "block.steamadvantage.steam_furnace": "증기 구동 전기로", + "block.steamadvantage.steam_crusher": "증기 구동 록 크러셔", + "block.steamadvantage.drillbit": "드릴 비트", + "block.steamadvantage.steam_drill": "증기 구동 드릴", + "item.steamadvantage.steam_drill_bit": "드릴 비트", + "block.steamadvantage.steam_elevator": "증기 구동 엘리베이터", + "block.steamadvantage.platform": "엘리베이터 플랫폼 스팀", + "item.steamadvantage.blackpowder_cartridge": "화약 카트리지", + "item.steamadvantage.musket": "구식 보병 총", + "block.steamadvantage.steam_track": "증기 선로", + "block.steamadvantage.steam_boiler_electric": "전기 스팀 보일러", + "block.steamadvantage.steam_boiler_geothermal": "지열 증기 보일러", + "block.steamadvantage.steam_switch": "스팀 밸브", + "block.steamadvantage.steam_still": "증기 구동 증류소", + "block.steamadvantage.steam_pump": "증기 구동 펌프", + "block.steamadvantage.steam_boiler_oil": "기름 연소 보일러", + "block.steamadvantage.pump_pipe_steam": "펌프 파이프" +} diff --git a/src/main/resources/assets/steamadvantage/lang/ko_kr.lang b/src/main/resources/assets/steamadvantage/lang/ko_kr.lang deleted file mode 100644 index bd4c1fa..0000000 --- a/src/main/resources/assets/steamadvantage/lang/ko_kr.lang +++ /dev/null @@ -1,46 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=제어 밸브 증기 - -tile.steamadvantage.steam_pipe.name=황동 증기 파이프 -tile.steamadvantage.steam_boiler_coal.name=증기 보일러 -tile.steamadvantage.steam_tank.name=스팀 탱크 -tile.steamadvantage.steam_furnace.name=증기 구동 전기로 -tile.steamadvantage.steam_crusher.name=증기 구동 록 크러셔 - - -tile.steamadvantage.drillbit.name=드릴 비트 -tile.steamadvantage.steam_drill.name=증기 구동 드릴 -item.steamadvantage.steam_drill_bit.name=드릴 비트 -death.attack.steam_machine=%1$s 기계의 기어 사이 분쇄 -death.attack.steam_machine.player=%1$s %2$s 에 의해 기계의 기어 사이에 분쇄 - - -tile.steamadvantage.steam_elevator.name=증기 구동 엘리베이터 -tile.steamadvantage.platform.name=엘리베이터 플랫폼 스팀 -death.attack.musket=%1$s는 총에 맞았 -death.attack.musket.player=%2$s 샷% %1$s죽은 -item.steamadvantage.blackpowder_cartridge.name=화약 카트리지 -item.steamadvantage.musket.name=구식 보병 총 -tooltip.musket.damage=총 의 %x의 피해를 -tooltip.musket.ammo=다시로드 %x를 필요 -tooltip.musket.loaded=로드 -tooltip.musket.unloaded=로드되지 -enchantment.powderless=무한 탄약 -enchantment.rapid_reload=신속하게 다시로드 -enchantment.high_explosive=폭탄 -enchantment.recoil=뒷걸음질 -tile.steamadvantage.steam_track.name=증기 선로 - - - - - -tile.steamadvantage.steam_boiler_electric.name=전기 스팀 보일러 -tile.steamadvantage.steam_boiler_geothermal.name=지열 증기 보일러 - -tile.steamadvantage.steam_switch.name=스팀 밸브 -tile.steamadvantage.steam_still.name=증기 구동 증류소 -tile.steamadvantage.steam_pump.name=증기 구동 펌프 -tile.steamadvantage.steam_boiler_oil.name=기름 연소 보일러 -tile.steamadvantage.pump_pipe_steam.name=펌프 파이프 diff --git a/src/main/resources/assets/steamadvantage/lang/pt_br.json b/src/main/resources/assets/steamadvantage/lang/pt_br.json new file mode 100644 index 0000000..5f8396c --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/pt_br.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "Válvula de Controle de Vapor", + "tile.steamadvantage.steam_pipe.name": "Latão Tubo de Vapor", + "tile.steamadvantage.steam_boiler_coal.name": "Caldeira a Vapor", + "tile.steamadvantage.steam_tank.name": "Tanque Vapor", + "tile.steamadvantage.steam_furnace.name": "Psto Vapor Forno", + "tile.steamadvantage.steam_crusher.name": "Psto Vapor Rocha Afiador", + "tile.steamadvantage.drillbit.name": "Broca", + "tile.steamadvantage.steam_drill.name": "Psto Vapor Broca", + "item.steamadvantage.steam_drill_bit.name": "Broca", + "death.attack.steam_machine": "%1$s was ground between the gears of a machine", + "death.attack.steam_machine.player": "%1$s was fed into the gears of a machine by %2$s", + "tile.steamadvantage.steam_elevator.name": "Vapor Elevador Alimentado", + "tile.steamadvantage.platform.name": "Vapor Elevador Plataforma", + "death.attack.musket": "%1$s foi baleado", + "death.attack.musket.player": "%2$s tiro %1$s mortos", + "item.steamadvantage.blackpowder_cartridge.name": "Pólvora Cartridge", + "item.steamadvantage.musket.name": "Mosquete", + "tooltip.musket.damage": "Plano lida %x danos", + "tooltip.musket.ammo": "Requer %x para recarregar", + "tooltip.musket.loaded": "Carregado", + "tooltip.musket.unloaded": "Não loaded", + "enchantment.powderless": "Infinito Munições", + "enchantment.rapid_reload": "Rapidamente Reload", + "enchantment.high_explosive": "Bomba", + "enchantment.recoil": "Recuo", + "tile.steamadvantage.steam_track.name": "Pista de Vapor", + "tile.steamadvantage.steam_boiler_electric.name": "Caldeira de Vapor Elétrica", + "tile.steamadvantage.steam_boiler_geothermal.name": "Caldeira a Vapor de Lava", + "tile.steamadvantage.steam_switch.name": "Válvula de Vapor", + "tile.steamadvantage.steam_still.name": "Destilaria vapor Alimentado", + "tile.steamadvantage.steam_pump.name": "Pomba de Vapor Alimentado", + "tile.steamadvantage.steam_boiler_oil.name": "Óleo de Caldeira Ardente", + "tile.steamadvantage.pump_pipe_steam.name": "Tubo de Bomba", + "item.steamadvantage.steam_governor": "Válvula de Controle de Vapor", + "block.steamadvantage.steam_pipe": "Latão Tubo de Vapor", + "block.steamadvantage.steam_boiler_coal": "Caldeira a Vapor", + "block.steamadvantage.steam_tank": "Tanque Vapor", + "block.steamadvantage.steam_furnace": "Psto Vapor Forno", + "block.steamadvantage.steam_crusher": "Psto Vapor Rocha Afiador", + "block.steamadvantage.drillbit": "Broca", + "block.steamadvantage.steam_drill": "Psto Vapor Broca", + "item.steamadvantage.steam_drill_bit": "Broca", + "block.steamadvantage.steam_elevator": "Vapor Elevador Alimentado", + "block.steamadvantage.platform": "Vapor Elevador Plataforma", + "item.steamadvantage.blackpowder_cartridge": "Pólvora Cartridge", + "item.steamadvantage.musket": "Mosquete", + "block.steamadvantage.steam_track": "Pista de Vapor", + "block.steamadvantage.steam_boiler_electric": "Caldeira de Vapor Elétrica", + "block.steamadvantage.steam_boiler_geothermal": "Caldeira a Vapor de Lava", + "block.steamadvantage.steam_switch": "Válvula de Vapor", + "block.steamadvantage.steam_still": "Destilaria vapor Alimentado", + "block.steamadvantage.steam_pump": "Pomba de Vapor Alimentado", + "block.steamadvantage.steam_boiler_oil": "Óleo de Caldeira Ardente", + "block.steamadvantage.pump_pipe_steam": "Tubo de Bomba" +} diff --git a/src/main/resources/assets/steamadvantage/lang/pt_br.lang b/src/main/resources/assets/steamadvantage/lang/pt_br.lang deleted file mode 100644 index 581cd6d..0000000 --- a/src/main/resources/assets/steamadvantage/lang/pt_br.lang +++ /dev/null @@ -1,46 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=Válvula de Controle de Vapor - -tile.steamadvantage.steam_pipe.name=Latão Tubo de Vapor -tile.steamadvantage.steam_boiler_coal.name=Caldeira a Vapor -tile.steamadvantage.steam_tank.name=Tanque Vapor -tile.steamadvantage.steam_furnace.name=Psto Vapor Forno -tile.steamadvantage.steam_crusher.name=Psto Vapor Rocha Afiador - - -tile.steamadvantage.drillbit.name=Broca -tile.steamadvantage.steam_drill.name=Psto Vapor Broca -item.steamadvantage.steam_drill_bit.name=Broca -death.attack.steam_machine=%1$s was ground between the gears of a machine -death.attack.steam_machine.player=%1$s was fed into the gears of a machine by %2$s - - - -tile.steamadvantage.steam_elevator.name=Vapor Elevador Alimentado -tile.steamadvantage.platform.name=Vapor Elevador Plataforma -death.attack.musket=%1$s foi baleado -death.attack.musket.player=%2$s tiro %1$s mortos -item.steamadvantage.blackpowder_cartridge.name=Pólvora Cartridge -item.steamadvantage.musket.name=Mosquete -tooltip.musket.damage=Plano lida %x danos -tooltip.musket.ammo=Requer %x para recarregar -tooltip.musket.loaded=Carregado -tooltip.musket.unloaded=Não loaded -enchantment.powderless=Infinito Munições -enchantment.rapid_reload=Rapidamente Reload -enchantment.high_explosive=Bomba -enchantment.recoil=Recuo -tile.steamadvantage.steam_track.name=Pista de Vapor - - - - -tile.steamadvantage.steam_boiler_electric.name=Caldeira de Vapor Elétrica -tile.steamadvantage.steam_boiler_geothermal.name=Caldeira a Vapor de Lava - -tile.steamadvantage.steam_switch.name=Válvula de Vapor -tile.steamadvantage.steam_still.name=Destilaria vapor Alimentado -tile.steamadvantage.steam_pump.name=Pomba de Vapor Alimentado -tile.steamadvantage.steam_boiler_oil.name=Óleo de Caldeira Ardente -tile.steamadvantage.pump_pipe_steam.name=Tubo de Bomba diff --git a/src/main/resources/assets/steamadvantage/lang/zh_cn.json b/src/main/resources/assets/steamadvantage/lang/zh_cn.json new file mode 100644 index 0000000..cec439c --- /dev/null +++ b/src/main/resources/assets/steamadvantage/lang/zh_cn.json @@ -0,0 +1,57 @@ +{ + "language_support_goals": "english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR)", + "item.steamadvantage.steam_governor.name": "蒸汽調節閥", + "tile.steamadvantage.steam_pipe.name": "黃銅蒸汽管", + "tile.steamadvantage.steam_boiler_coal.name": "蒸汽鍋爐", + "tile.steamadvantage.steam_tank.name": "蒸汽坦克", + "tile.steamadvantage.steam_furnace.name": "蒸汽動力爐", + "tile.steamadvantage.steam_crusher.name": "蒸汽動力岩石破碎機", + "tile.steamadvantage.drillbit.name": "鑽頭", + "tile.steamadvantage.steam_drill.name": "蒸汽動鑽", + "item.steamadvantage.steam_drill_bit.name": "鑽頭", + "death.attack.steam_machine": "%1$s是一台機器的齒輪之間的地面", + "death.attack.steam_machine.player": "%1$s是一機多用%2$s齒輪之間的地面", + "tile.steamadvantage.steam_elevator.name": "蒸汽動力電梯", + "tile.steamadvantage.platform.name": "蒸汽電梯平台", + "death.attack.musket": "%1$s被射殺", + "death.attack.musket.player": "%2$s射門%1$s死了", + "item.steamadvantage.blackpowder_cartridge.name": "火藥盒", + "item.steamadvantage.musket.name": "滑膛槍", + "tooltip.musket.damage": "射擊涉及%x點傷害", + "tooltip.musket.ammo": "需要%x重裝", + "tooltip.musket.loaded": "加載", + "tooltip.musket.unloaded": "未加載", + "enchantment.powderless": "無限彈藥", + "enchantment.rapid_reload": "快速刷新", + "enchantment.high_explosive": "炸彈", + "enchantment.recoil": "後坐力", + "tile.steamadvantage.steam_track.name": "蒸汽路径", + "tile.steamadvantage.steam_boiler_electric.name": "電熱蒸汽鍋爐", + "tile.steamadvantage.steam_boiler_geothermal.name": "地熱蒸汽鍋爐", + "tile.steamadvantage.steam_switch.name": "蒸汽閥", + "tile.steamadvantage.steam_still.name": "蒸汽動力酒廠", + "tile.steamadvantage.steam_pump.name": "蒸汽動力泵", + "tile.steamadvantage.steam_boiler_oil.name": "燃油鍋爐", + "tile.steamadvantage.pump_pipe_steam.name": "泵管", + "item.steamadvantage.steam_governor": "蒸汽調節閥", + "block.steamadvantage.steam_pipe": "黃銅蒸汽管", + "block.steamadvantage.steam_boiler_coal": "蒸汽鍋爐", + "block.steamadvantage.steam_tank": "蒸汽坦克", + "block.steamadvantage.steam_furnace": "蒸汽動力爐", + "block.steamadvantage.steam_crusher": "蒸汽動力岩石破碎機", + "block.steamadvantage.drillbit": "鑽頭", + "block.steamadvantage.steam_drill": "蒸汽動鑽", + "item.steamadvantage.steam_drill_bit": "鑽頭", + "block.steamadvantage.steam_elevator": "蒸汽動力電梯", + "block.steamadvantage.platform": "蒸汽電梯平台", + "item.steamadvantage.blackpowder_cartridge": "火藥盒", + "item.steamadvantage.musket": "滑膛槍", + "block.steamadvantage.steam_track": "蒸汽路径", + "block.steamadvantage.steam_boiler_electric": "電熱蒸汽鍋爐", + "block.steamadvantage.steam_boiler_geothermal": "地熱蒸汽鍋爐", + "block.steamadvantage.steam_switch": "蒸汽閥", + "block.steamadvantage.steam_still": "蒸汽動力酒廠", + "block.steamadvantage.steam_pump": "蒸汽動力泵", + "block.steamadvantage.steam_boiler_oil": "燃油鍋爐", + "block.steamadvantage.pump_pipe_steam": "泵管" +} diff --git a/src/main/resources/assets/steamadvantage/lang/zh_cn.lang b/src/main/resources/assets/steamadvantage/lang/zh_cn.lang deleted file mode 100644 index c5f2680..0000000 --- a/src/main/resources/assets/steamadvantage/lang/zh_cn.lang +++ /dev/null @@ -1,45 +0,0 @@ -language_support_goals=english (en_US,en_EN,en_CA,en_GB, en_AU, en_PT), spanish (es_MX,es_ES), chinese (zh_CN), japanese (ja_JA), portugese (pt_BR), german (de_DE), italian (it_IT), korean (ko_KR) - -item.steamadvantage.steam_governor.name=蒸汽調節閥 - -tile.steamadvantage.steam_pipe.name=黃銅蒸汽管 -tile.steamadvantage.steam_boiler_coal.name=蒸汽鍋爐 -tile.steamadvantage.steam_tank.name=蒸汽坦克 -tile.steamadvantage.steam_furnace.name=蒸汽動力爐 -tile.steamadvantage.steam_crusher.name=蒸汽動力岩石破碎機 - - -tile.steamadvantage.drillbit.name=鑽頭 -tile.steamadvantage.steam_drill.name=蒸汽動鑽 -item.steamadvantage.steam_drill_bit.name=鑽頭 -death.attack.steam_machine=%1$s是一台機器的齒輪之間的地面 -death.attack.steam_machine.player=%1$s是一機多用%2$s齒輪之間的地面 - - -tile.steamadvantage.steam_elevator.name=蒸汽動力電梯 -tile.steamadvantage.platform.name=蒸汽電梯平台 -death.attack.musket=%1$s被射殺 -death.attack.musket.player=%2$s射門%1$s死了 -item.steamadvantage.blackpowder_cartridge.name=火藥盒 -item.steamadvantage.musket.name=滑膛槍 -tooltip.musket.damage=射擊涉及%x點傷害 -tooltip.musket.ammo=需要%x重裝 -tooltip.musket.loaded=加載 -tooltip.musket.unloaded=未加載 -enchantment.powderless=無限彈藥 -enchantment.rapid_reload=快速刷新 -enchantment.high_explosive=炸彈 -enchantment.recoil=後坐力 -tile.steamadvantage.steam_track.name=蒸汽路径 - - - - -tile.steamadvantage.steam_boiler_electric.name=電熱蒸汽鍋爐 -tile.steamadvantage.steam_boiler_geothermal.name=地熱蒸汽鍋爐 - -tile.steamadvantage.steam_switch.name=蒸汽閥 -tile.steamadvantage.steam_still.name=蒸汽動力酒廠 -tile.steamadvantage.steam_pump.name=蒸汽動力泵 -tile.steamadvantage.steam_boiler_oil.name=燃油鍋爐 -tile.steamadvantage.pump_pipe_steam.name=泵管 diff --git a/src/main/resources/assets/steamadvantage/recipes/_factories.json b/src/main/resources/assets/steamadvantage/recipes/_factories.json deleted file mode 100644 index f14f3ce..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/_factories.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "conditions": { - "recipe_mode": "com.mcmoddev.steamadvantage.recipe.condition.RecipeModeConditionFactory", - "musket_enabled": "com.mcmoddev.steamadvantage.recipe.condition.MusketEnabledConditionFactory" - } -} diff --git a/src/main/resources/assets/steamadvantage/recipes/blackpowder_cartridge.json b/src/main/resources/assets/steamadvantage/recipes/blackpowder_cartridge.json deleted file mode 100644 index 71ec2ba..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/blackpowder_cartridge.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "L", - "g", - "p" - ], - "key": { - "L": { - "type": "forge:ore_dict", - "ore": "nuggetLead" - }, - "g": { - "item": "minecraft:gunpowder" - }, - "p": { - "item": "minecraft:paper" - } - }, - "result": { - "item": "steamadvantage:blackpowder_cartridge" - }, - "group": "weapons" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/musket_left_normal.json b/src/main/resources/assets/steamadvantage/recipes/musket_left_normal.json deleted file mode 100644 index ea0125c..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/musket_left_normal.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "fss", - "w " - ], - "key": { - "f": { - "item": "minecraft:flint_and_steel" - }, - "s": { - "type": "forge:ore_dict", - "ore": "ingotSteel" - }, - "w": { - "type": "forge:ore_dict", - "ore": "plankWood" - } - }, - "result": { - "item": "steamadvantage:musket" - }, - "conditions": [ - { - "type": "steamadvantage:recipe_mode", - "mode": "NORMAL" - }, - { - "type": "steamadvantage:musket_enabled" - } - ], - "group": "weapons" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/musket_left_tech.json b/src/main/resources/assets/steamadvantage/recipes/musket_left_tech.json deleted file mode 100644 index 9c4590c..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/musket_left_tech.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "fss", - "w " - ], - "key": { - "f": { - "item": "minecraft:flint_and_steel" - }, - "s": { - "type": "forge:ore_dict", - "ore": "ingotSteel" - }, - "w": { - "type": "forge:ore_dict", - "ore": "plankWood" - } - }, - "result": { - "item": "steamadvantage:musket" - }, - "conditions": [ - { - "type": "steamadvantage:recipe_mode", - "mode": "TECH_PROGRESSION" - }, - { - "type": "steamadvantage:musket_enabled" - } - ], - "group": "weapons" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/musket_right_normal.json b/src/main/resources/assets/steamadvantage/recipes/musket_right_normal.json deleted file mode 100644 index 176192c..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/musket_right_normal.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "ssf", - " w" - ], - "key": { - "f": { - "item": "minecraft:flint_and_steel" - }, - "s": { - "type": "forge:ore_dict", - "ore": "ingotSteel" - }, - "w": { - "type": "forge:ore_dict", - "ore": "plankWood" - } - }, - "result": { - "item": "steamadvantage:musket" - }, - "conditions": [ - { - "type": "steamadvantage:recipe_mode", - "mode": "NORMAL" - }, - { - "type": "steamadvantage:musket_enabled" - } - ], - "group": "weapons" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/musket_right_tech.json b/src/main/resources/assets/steamadvantage/recipes/musket_right_tech.json deleted file mode 100644 index 781dcfd..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/musket_right_tech.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "ssf", - " w" - ], - "key": { - "f": { - "item": "minecraft:flint_and_steel" - }, - "s": { - "type": "forge:ore_dict", - "ore": "ingotSteel" - }, - "w": { - "type": "forge:ore_dict", - "ore": "plankWood" - } - }, - "result": { - "item": "steamadvantage:musket" - }, - "conditions": [ - { - "type": "steamadvantage:recipe_mode", - "mode": "TECH_PROGRESSION" - }, - { - "type": "steamadvantage:musket_enabled" - } - ], - "group": "weapons" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_boiler_coal.json b/src/main/resources/assets/steamadvantage/recipes/steam_boiler_coal.json deleted file mode 100644 index 885dbd3..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_boiler_coal.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "gXg", - "pmp" - ], - "key": { - "X": { - "type": "forge:ore_dict", - "ore": "conduitSteam" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_boiler_coal" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_boiler_electric.json b/src/main/resources/assets/steamadvantage/recipes/steam_boiler_electric.json deleted file mode 100644 index 0122f67..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_boiler_electric.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " Y ", - "gXg", - "pmp" - ], - "key": { - "X": { - "type": "forge:ore_dict", - "ore": "wire" - }, - "Y": { - "item": "minecraft:bucket" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_boiler_electric" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_boiler_geothermal.json b/src/main/resources/assets/steamadvantage/recipes/steam_boiler_geothermal.json deleted file mode 100644 index e58a957..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_boiler_geothermal.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " Y ", - "gXg", - "pmp" - ], - "key": { - "X": { - "type": "forge:ore_dict", - "ore": "conduitSteam" - }, - "Y": { - "item": "minecraft:obsidian" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_boiler_geothermal" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_boiler_oil.json b/src/main/resources/assets/steamadvantage/recipes/steam_boiler_oil.json deleted file mode 100644 index e3e4d26..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_boiler_oil.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " Y ", - "gXg", - "pmp" - ], - "key": { - "X": { - "item": "minecraft:furnace" - }, - "Y": { - "item": "minecraft:bucket" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_boiler_oil" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_crusher.json b/src/main/resources/assets/steamadvantage/recipes/steam_crusher.json deleted file mode 100644 index 19f80f8..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_crusher.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " Y ", - "gXg", - "pmp" - ], - "key": { - "X": { - "item": "minecraft:piston" - }, - "Y": { - "type": "forge:ore_dict", - "ore": "blockSteel" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_crusher" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_drill.json b/src/main/resources/assets/steamadvantage/recipes/steam_drill.json deleted file mode 100644 index 981351c..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_drill.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "gXg", - "pmp" - ], - "key": { - "X": { - "item": "steamadvantage:steam_drill_bit" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_drill" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_drill_bit.json b/src/main/resources/assets/steamadvantage/recipes/steam_drill_bit.json deleted file mode 100644 index 51c2f82..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_drill_bit.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " g ", - " i ", - "did" - ], - "key": { - "g": { - "type": "forge:ore_dict", - "ore": "sprocket" - }, - "i": { - "type": "forge:ore_dict", - "ore": "ingotSteel" - }, - "d": { - "type": "forge:ore_dict", - "ore": "gemDiamond" - } - }, - "result": { - "item": "steamadvantage:steam_drill_bit" - }, - "group": "parts" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_drill_diamond_pickaxe_normal.json b/src/main/resources/assets/steamadvantage/recipes/steam_drill_diamond_pickaxe_normal.json deleted file mode 100644 index baf00a4..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_drill_diamond_pickaxe_normal.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "gXg", - "pmp" - ], - "key": { - "X": { - "item": "minecraft:diamond_pickaxe" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_drill" - }, - "conditions": [ - { - "type": "steamadvantage:recipe_mode", - "mode": "NORMAL" - } - ], - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_elevator.json b/src/main/resources/assets/steamadvantage/recipes/steam_elevator.json deleted file mode 100644 index b885f67..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_elevator.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " Y ", - "gXg", - "pmp" - ], - "key": { - "X": { - "item": "minecraft:piston" - }, - "Y": { - "type": "forge:ore_dict", - "ore": "sprocket" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_elevator" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_furnace.json b/src/main/resources/assets/steamadvantage/recipes/steam_furnace.json deleted file mode 100644 index 951063c..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_furnace.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "gXg", - "pmp" - ], - "key": { - "X": { - "item": "minecraft:furnace" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_furnace" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_governor_apocalyptic.json b/src/main/resources/assets/steamadvantage/recipes/steam_governor_apocalyptic.json deleted file mode 100644 index bc6468c..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_governor_apocalyptic.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " t ", - "srs", - "btb" - ], - "key": { - "t": { - "type": "forge:ore_dict", - "ore": "sprocket" - }, - "s": { - "type": "forge:ore_dict", - "ore": "rod" - }, - "r": { - "type": "forge:ore_dict", - "ore": "rod" - }, - "b": { - "type": "forge:ore_dict", - "ore": "ingotBrass" - } - }, - "result": { - "item": "steamadvantage:steam_governor" - }, - "conditions": [ - { - "type": "steamadvantage:recipe_mode", - "mode": "APOCALYPTIC" - } - ], - "group": "parts" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_governor_normal.json b/src/main/resources/assets/steamadvantage/recipes/steam_governor_normal.json deleted file mode 100644 index 6367cc9..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_governor_normal.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " t ", - "srs", - "btb" - ], - "key": { - "t": { - "type": "forge:ore_dict", - "ore": "nuggetIron" - }, - "s": { - "item": "minecraft:stick" - }, - "r": { - "item": "minecraft:stick" - }, - "b": { - "type": "forge:ore_dict", - "ore": "ingotBrass" - } - }, - "result": { - "item": "steamadvantage:steam_governor" - }, - "conditions": [ - { - "type": "steamadvantage:recipe_mode", - "mode": "NORMAL" - } - ], - "group": "parts" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_governor_tech.json b/src/main/resources/assets/steamadvantage/recipes/steam_governor_tech.json deleted file mode 100644 index c68d19a..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_governor_tech.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " t ", - "srs", - "btb" - ], - "key": { - "t": { - "type": "forge:ore_dict", - "ore": "sprocket" - }, - "s": { - "type": "forge:ore_dict", - "ore": "rod" - }, - "r": { - "type": "forge:ore_dict", - "ore": "rod" - }, - "b": { - "type": "forge:ore_dict", - "ore": "ingotBrass" - } - }, - "result": { - "item": "steamadvantage:steam_governor" - }, - "conditions": [ - { - "type": "steamadvantage:recipe_mode", - "mode": "TECH_PROGRESSION" - } - ], - "group": "parts" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_pipe.json b/src/main/resources/assets/steamadvantage/recipes/steam_pipe.json deleted file mode 100644 index 29da7f3..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_pipe.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "xxx", - " ", - "xxx" - ], - "key": { - "x": { - "type": "forge:ore_dict", - "ore": "ingotBrass" - } - }, - "result": { - "item": "steamadvantage:steam_pipe", - "count": 6 - }, - "group": "pipes" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_pump.json b/src/main/resources/assets/steamadvantage/recipes/steam_pump.json deleted file mode 100644 index e93712f..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_pump.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " Y ", - "gXg", - "pmp" - ], - "key": { - "X": { - "item": "minecraft:piston" - }, - "Y": { - "item": "minecraft:bucket" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_pump" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_still.json b/src/main/resources/assets/steamadvantage/recipes/steam_still.json deleted file mode 100644 index 6cad9a5..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_still.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " Y ", - "gXg", - "pmp" - ], - "key": { - "X": { - "item": "minecraft:bucket" - }, - "Y": { - "item": "minecraft:bucket" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - }, - "p": { - "type": "forge:ore_dict", - "ore": "plateIron" - }, - "m": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_still" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_switch.json b/src/main/resources/assets/steamadvantage/recipes/steam_switch.json deleted file mode 100644 index 6aad0c9..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_switch.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - " L ", - "pfp" - ], - "key": { - "L": { - "item": "minecraft:lever" - }, - "p": { - "type": "forge:ore_dict", - "ore": "conduitSteam" - }, - "f": { - "type": "forge:ore_dict", - "ore": "frameSteel" - } - }, - "result": { - "item": "steamadvantage:steam_switch" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_tank.json b/src/main/resources/assets/steamadvantage/recipes/steam_tank.json deleted file mode 100644 index 75008f3..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_tank.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "type": "forge:ore_shaped", - "pattern": [ - "xgx", - "xpx", - "xxx" - ], - "key": { - "x": { - "type": "forge:ore_dict", - "ore": "plateCopper" - }, - "p": { - "type": "forge:ore_dict", - "ore": "conduitSteam" - }, - "g": { - "type": "forge:ore_dict", - "ore": "governor" - } - }, - "result": { - "item": "steamadvantage:steam_tank" - }, - "group": "steam_machines" -} diff --git a/src/main/resources/assets/steamadvantage/recipes/steam_track.json b/src/main/resources/assets/steamadvantage/recipes/steam_track.json deleted file mode 100644 index 102da53..0000000 --- a/src/main/resources/assets/steamadvantage/recipes/steam_track.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "forge:ore_shapeless", - "ingredients": [ - { - "item": "steamadvantage:steam_pipe" - }, - { - "item": "poweradvantage:steel_frame" - } - ], - "result": { - "item": "steamadvantage:steam_track" - }, - "group": "tracks" -} diff --git a/src/main/resources/data/forge/tags/items/ammo/blackpowder.json b/src/main/resources/data/forge/tags/items/ammo/blackpowder.json new file mode 100644 index 0000000..db1807c --- /dev/null +++ b/src/main/resources/data/forge/tags/items/ammo/blackpowder.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": ["steamadvantage:blackpowder_cartridge"] +} diff --git a/src/main/resources/data/forge/tags/items/conduits/steam.json b/src/main/resources/data/forge/tags/items/conduits/steam.json new file mode 100644 index 0000000..28868b7 --- /dev/null +++ b/src/main/resources/data/forge/tags/items/conduits/steam.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": ["steamadvantage:steam_pipe"] +} diff --git a/src/main/resources/data/forge/tags/items/governors.json b/src/main/resources/data/forge/tags/items/governors.json new file mode 100644 index 0000000..65572c8 --- /dev/null +++ b/src/main/resources/data/forge/tags/items/governors.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": ["#forge:governors/brass"] +} diff --git a/src/main/resources/data/forge/tags/items/governors/brass.json b/src/main/resources/data/forge/tags/items/governors/brass.json new file mode 100644 index 0000000..1997d16 --- /dev/null +++ b/src/main/resources/data/forge/tags/items/governors/brass.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": ["steamadvantage:steam_governor"] +} diff --git a/src/main/resources/data/forge/tags/items/guns.json b/src/main/resources/data/forge/tags/items/guns.json new file mode 100644 index 0000000..ac2e893 --- /dev/null +++ b/src/main/resources/data/forge/tags/items/guns.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": ["steamadvantage:musket"] +} diff --git a/src/main/resources/data/forge/tags/items/wires.json b/src/main/resources/data/forge/tags/items/wires.json new file mode 100644 index 0000000..5d341ba --- /dev/null +++ b/src/main/resources/data/forge/tags/items/wires.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/blackpowder_cartridge.json b/src/main/resources/data/steamadvantage/advancements/recipes/blackpowder_cartridge.json new file mode 100644 index 0000000..87fc6e3 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/blackpowder_cartridge.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:nuggets/lead" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:gunpowder" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:paper" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:blackpowder_cartridge" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:blackpowder_cartridge" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/musket_left_normal.json b/src/main/resources/data/steamadvantage/advancements/recipes/musket_left_normal.json new file mode 100644 index 0000000..904b751 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/musket_left_normal.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:flint_and_steel" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/steel" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "minecraft:planks" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:musket_left_normal" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:musket_left_normal" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/musket_left_tech.json b/src/main/resources/data/steamadvantage/advancements/recipes/musket_left_tech.json new file mode 100644 index 0000000..225dfd3 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/musket_left_tech.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:flint_and_steel" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/steel" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "minecraft:planks" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:musket_left_tech" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:musket_left_tech" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/musket_right_normal.json b/src/main/resources/data/steamadvantage/advancements/recipes/musket_right_normal.json new file mode 100644 index 0000000..d18e04c --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/musket_right_normal.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:flint_and_steel" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/steel" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "minecraft:planks" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:musket_right_normal" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:musket_right_normal" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/musket_right_tech.json b/src/main/resources/data/steamadvantage/advancements/recipes/musket_right_tech.json new file mode 100644 index 0000000..7ad1324 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/musket_right_tech.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:flint_and_steel" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/steel" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "minecraft:planks" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:musket_right_tech" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:musket_right_tech" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_coal.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_coal.json new file mode 100644 index 0000000..5c8cd8d --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_coal.json @@ -0,0 +1,65 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:conduits/steam" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_boiler_coal" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_boiler_coal" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_electric.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_electric.json new file mode 100644 index 0000000..d4256dd --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_electric.json @@ -0,0 +1,76 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:wires" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:bucket" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_5": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_boiler_electric" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_ingredient_5", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_boiler_electric" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_geothermal.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_geothermal.json new file mode 100644 index 0000000..5b5241b --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_geothermal.json @@ -0,0 +1,76 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:conduits/steam" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:obsidian" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_5": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_boiler_geothermal" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_ingredient_5", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_boiler_geothermal" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_oil.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_oil.json new file mode 100644 index 0000000..81655b4 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_boiler_oil.json @@ -0,0 +1,76 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:furnace" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:bucket" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_5": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_boiler_oil" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_ingredient_5", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_boiler_oil" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_crusher.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_crusher.json new file mode 100644 index 0000000..877473f --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_crusher.json @@ -0,0 +1,76 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:piston" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:storage_blocks/steel" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_5": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_crusher" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_ingredient_5", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_crusher" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_drill.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_drill.json new file mode 100644 index 0000000..31bd734 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_drill.json @@ -0,0 +1,65 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "steamadvantage:steam_drill_bit" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_drill" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_drill" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_drill_bit.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_drill_bit.json new file mode 100644 index 0000000..7d79943 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_drill_bit.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:sprockets" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/steel" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:gems/diamond" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_drill_bit" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_drill_bit" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_drill_diamond_pickaxe_normal.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_drill_diamond_pickaxe_normal.json new file mode 100644 index 0000000..1c10065 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_drill_diamond_pickaxe_normal.json @@ -0,0 +1,65 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:diamond_pickaxe" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_drill_diamond_pickaxe_normal" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_drill_diamond_pickaxe_normal" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_elevator.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_elevator.json new file mode 100644 index 0000000..eda9c30 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_elevator.json @@ -0,0 +1,76 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:piston" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:sprockets" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_5": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_elevator" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_ingredient_5", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_elevator" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_furnace.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_furnace.json new file mode 100644 index 0000000..7bb33ff --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_furnace.json @@ -0,0 +1,65 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:furnace" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_furnace" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_furnace" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_governor_apocalyptic.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_governor_apocalyptic.json new file mode 100644 index 0000000..7b08fae --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_governor_apocalyptic.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:sprockets" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:rods" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/brass" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_governor_apocalyptic" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_governor_apocalyptic" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_governor_normal.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_governor_normal.json new file mode 100644 index 0000000..a743e6a --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_governor_normal.json @@ -0,0 +1,43 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:nuggets/iron" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/brass" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_governor_normal" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_governor_normal" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_governor_tech.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_governor_tech.json new file mode 100644 index 0000000..c4fa9fc --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_governor_tech.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:sprockets" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:rods" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/brass" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_governor_tech" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_governor_tech" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_pipe.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_pipe.json new file mode 100644 index 0000000..128ed3e --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_pipe.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/brass" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_pipe" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_pipe" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_pump.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_pump.json new file mode 100644 index 0000000..3e83c88 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_pump.json @@ -0,0 +1,76 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:piston" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:bucket" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_5": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_pump" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_ingredient_5", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_pump" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_still.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_still.json new file mode 100644 index 0000000..bff7fde --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_still.json @@ -0,0 +1,65 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:bucket" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/iron" + } + ] + } + }, + "has_ingredient_4": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_still" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_ingredient_4", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_still" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_switch.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_switch.json new file mode 100644 index 0000000..6cfb907 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_switch.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:lever" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:conduits/steam" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:frames/steel" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_switch" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_switch" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_tank.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_tank.json new file mode 100644 index 0000000..ad0c1e8 --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_tank.json @@ -0,0 +1,54 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:plates/copper" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:conduits/steam" + } + ] + } + }, + "has_ingredient_3": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:governors" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_tank" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_ingredient_3", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_tank" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/advancements/recipes/steam_track.json b/src/main/resources/data/steamadvantage/advancements/recipes/steam_track.json new file mode 100644 index 0000000..86b973b --- /dev/null +++ b/src/main/resources/data/steamadvantage/advancements/recipes/steam_track.json @@ -0,0 +1,43 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ingredient_1": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "steamadvantage:steam_pipe" + } + ] + } + }, + "has_ingredient_2": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "poweradvantage:steel_frame" + } + ] + } + }, + "has_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "steamadvantage:steam_track" + } + } + }, + "requirements": [ + [ + "has_ingredient_1", + "has_ingredient_2", + "has_recipe" + ] + ], + "rewards": { + "recipes": [ + "steamadvantage:steam_track" + ] + } +} diff --git a/src/main/resources/data/steamadvantage/loot_tables/chests/advantage_parts.json b/src/main/resources/data/steamadvantage/loot_tables/chests/advantage_parts.json new file mode 100644 index 0000000..0edf0a3 --- /dev/null +++ b/src/main/resources/data/steamadvantage/loot_tables/chests/advantage_parts.json @@ -0,0 +1,76 @@ +{ + "pools": [ + { + "__comment": "25% chance of a Steam Advantage item", + "rolls": 1, + "entries": [ + { + "type": "empty", + "weight": 135 + }, + { + "type": "item", + "name": "steamadvantage:steam_governor", + "weight": 50, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 6 + } + } + ] + }, + { + "type": "item", + "name": "steamadvantage:steam_pipe", + "weight": 25, + "functions": [ + { + "function": "set_count", + "count": { + "min": 3, + "max": 6 + } + } + ] + }, + { + "type": "item", + "name": "steamadvantage:blackpowder_cartridge", + "weight": 50, + "functions": [ + { + "function": "set_count", + "count": { + "min": 5, + "max": 15 + } + } + ] + }, + { + "type": "item", + "name": "steamadvantage:musket", + "entryName": "steamadvantage:musket_plain", + "weight": 18 + }, + { + "type": "item", + "name": "steamadvantage:musket", + "entryName": "steamadvantage:musket_enchanted", + "weight": 2, + "functions": [ + { + "function": "minecraft:enchant_with_levels", + "levels": 10, + "treasure": true + } + ] + } + ], + "name": "steamadvantage_legacy_parts_0" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/blackpowder_cartridge.json b/src/main/resources/data/steamadvantage/recipes/blackpowder_cartridge.json new file mode 100644 index 0000000..f677e54 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/blackpowder_cartridge.json @@ -0,0 +1,29 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "L", + "g", + "p" + ], + "key": { + "L": { + "tag": "forge:nuggets/lead" + }, + "g": { + "item": "minecraft:gunpowder" + }, + "p": { + "item": "minecraft:paper" + } + }, + "result": { + "item": "steamadvantage:blackpowder_cartridge" + }, + "group": "steamadvantage:blackpowder_cartridge", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:nuggets/lead" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/crushing_steam_boiler_coal.json b/src/main/resources/data/steamadvantage/recipes/crushing_steam_boiler_coal.json new file mode 100644 index 0000000..ea3b7af --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/crushing_steam_boiler_coal.json @@ -0,0 +1,6 @@ +{ + "type": "basemetals:crushing", + "ingredient": { "item": "steamadvantage:steam_boiler_coal" }, + "result": { "item": "steamadvantage:steam_governor", "count": 2 }, + "conditions": [{ "type": "steamadvantage:recipe_mode", "mode": "APOCALYPTIC" }] +} diff --git a/src/main/resources/data/steamadvantage/recipes/crushing_steam_boiler_electric.json b/src/main/resources/data/steamadvantage/recipes/crushing_steam_boiler_electric.json new file mode 100644 index 0000000..e5db1e1 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/crushing_steam_boiler_electric.json @@ -0,0 +1,6 @@ +{ + "type": "basemetals:crushing", + "ingredient": { "item": "steamadvantage:steam_boiler_electric" }, + "result": { "item": "steamadvantage:steam_governor", "count": 2 }, + "conditions": [{ "type": "steamadvantage:recipe_mode", "mode": "APOCALYPTIC" }] +} diff --git a/src/main/resources/data/steamadvantage/recipes/crushing_steam_boiler_geothermal.json b/src/main/resources/data/steamadvantage/recipes/crushing_steam_boiler_geothermal.json new file mode 100644 index 0000000..eb383af --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/crushing_steam_boiler_geothermal.json @@ -0,0 +1,6 @@ +{ + "type": "basemetals:crushing", + "ingredient": { "item": "steamadvantage:steam_boiler_geothermal" }, + "result": { "item": "steamadvantage:steam_governor", "count": 2 }, + "conditions": [{ "type": "steamadvantage:recipe_mode", "mode": "APOCALYPTIC" }] +} diff --git a/src/main/resources/data/steamadvantage/recipes/crushing_steam_crusher.json b/src/main/resources/data/steamadvantage/recipes/crushing_steam_crusher.json new file mode 100644 index 0000000..ab487f9 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/crushing_steam_crusher.json @@ -0,0 +1,6 @@ +{ + "type": "basemetals:crushing", + "ingredient": { "item": "steamadvantage:steam_crusher" }, + "result": { "item": "steamadvantage:steam_governor", "count": 2 }, + "conditions": [{ "type": "steamadvantage:recipe_mode", "mode": "APOCALYPTIC" }] +} diff --git a/src/main/resources/data/steamadvantage/recipes/crushing_steam_drill.json b/src/main/resources/data/steamadvantage/recipes/crushing_steam_drill.json new file mode 100644 index 0000000..033ddb1 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/crushing_steam_drill.json @@ -0,0 +1,6 @@ +{ + "type": "basemetals:crushing", + "ingredient": { "item": "steamadvantage:steam_drill" }, + "result": { "item": "steamadvantage:steam_governor", "count": 2 }, + "conditions": [{ "type": "steamadvantage:recipe_mode", "mode": "APOCALYPTIC" }] +} diff --git a/src/main/resources/data/steamadvantage/recipes/crushing_steam_elevator.json b/src/main/resources/data/steamadvantage/recipes/crushing_steam_elevator.json new file mode 100644 index 0000000..edc587d --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/crushing_steam_elevator.json @@ -0,0 +1,6 @@ +{ + "type": "basemetals:crushing", + "ingredient": { "item": "steamadvantage:steam_elevator" }, + "result": { "item": "steamadvantage:steam_governor", "count": 3 }, + "conditions": [{ "type": "steamadvantage:recipe_mode", "mode": "APOCALYPTIC" }] +} diff --git a/src/main/resources/data/steamadvantage/recipes/crushing_steam_furnace.json b/src/main/resources/data/steamadvantage/recipes/crushing_steam_furnace.json new file mode 100644 index 0000000..17389fd --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/crushing_steam_furnace.json @@ -0,0 +1,6 @@ +{ + "type": "basemetals:crushing", + "ingredient": { "item": "steamadvantage:steam_furnace" }, + "result": { "item": "steamadvantage:steam_governor", "count": 2 }, + "conditions": [{ "type": "steamadvantage:recipe_mode", "mode": "APOCALYPTIC" }] +} diff --git a/src/main/resources/data/steamadvantage/recipes/crushing_steam_governor.json b/src/main/resources/data/steamadvantage/recipes/crushing_steam_governor.json new file mode 100644 index 0000000..2c95255 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/crushing_steam_governor.json @@ -0,0 +1,6 @@ +{ + "type": "basemetals:crushing", + "ingredient": { "item": "steamadvantage:steam_governor" }, + "result": { "item": "poweradvantage:sprocket", "count": 2 }, + "conditions": [{ "type": "steamadvantage:recipe_mode", "mode": "APOCALYPTIC" }] +} diff --git a/src/main/resources/data/steamadvantage/recipes/crushing_steam_tank.json b/src/main/resources/data/steamadvantage/recipes/crushing_steam_tank.json new file mode 100644 index 0000000..5cadc84 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/crushing_steam_tank.json @@ -0,0 +1,6 @@ +{ + "type": "basemetals:crushing", + "ingredient": { "item": "steamadvantage:steam_tank" }, + "result": { "item": "steamadvantage:steam_governor" }, + "conditions": [{ "type": "steamadvantage:recipe_mode", "mode": "APOCALYPTIC" }] +} diff --git a/src/main/resources/data/steamadvantage/recipes/musket_left_normal.json b/src/main/resources/data/steamadvantage/recipes/musket_left_normal.json new file mode 100644 index 0000000..372ce23 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/musket_left_normal.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "fss", + "w " + ], + "key": { + "f": { + "item": "minecraft:flint_and_steel" + }, + "s": { + "tag": "forge:ingots/steel" + }, + "w": { + "tag": "minecraft:planks" + } + }, + "result": { + "item": "steamadvantage:musket" + }, + "conditions": [ + { + "type": "steamadvantage:recipe_mode", + "mode": "NORMAL" + }, + { + "type": "steamadvantage:musket_enabled" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:ingots/steel" + } + ], + "group": "steamadvantage:musket" +} diff --git a/src/main/resources/data/steamadvantage/recipes/musket_left_tech.json b/src/main/resources/data/steamadvantage/recipes/musket_left_tech.json new file mode 100644 index 0000000..86eaea3 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/musket_left_tech.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "fss", + "w " + ], + "key": { + "f": { + "item": "minecraft:flint_and_steel" + }, + "s": { + "tag": "forge:ingots/steel" + }, + "w": { + "tag": "minecraft:planks" + } + }, + "result": { + "item": "steamadvantage:musket" + }, + "conditions": [ + { + "type": "steamadvantage:recipe_mode", + "mode": "TECH_PROGRESSION" + }, + { + "type": "steamadvantage:musket_enabled" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:ingots/steel" + } + ], + "group": "steamadvantage:musket" +} diff --git a/src/main/resources/data/steamadvantage/recipes/musket_right_normal.json b/src/main/resources/data/steamadvantage/recipes/musket_right_normal.json new file mode 100644 index 0000000..f5a9303 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/musket_right_normal.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "ssf", + " w" + ], + "key": { + "f": { + "item": "minecraft:flint_and_steel" + }, + "s": { + "tag": "forge:ingots/steel" + }, + "w": { + "tag": "minecraft:planks" + } + }, + "result": { + "item": "steamadvantage:musket" + }, + "conditions": [ + { + "type": "steamadvantage:recipe_mode", + "mode": "NORMAL" + }, + { + "type": "steamadvantage:musket_enabled" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:ingots/steel" + } + ], + "group": "steamadvantage:musket" +} diff --git a/src/main/resources/data/steamadvantage/recipes/musket_right_tech.json b/src/main/resources/data/steamadvantage/recipes/musket_right_tech.json new file mode 100644 index 0000000..2ba3b46 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/musket_right_tech.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "ssf", + " w" + ], + "key": { + "f": { + "item": "minecraft:flint_and_steel" + }, + "s": { + "tag": "forge:ingots/steel" + }, + "w": { + "tag": "minecraft:planks" + } + }, + "result": { + "item": "steamadvantage:musket" + }, + "conditions": [ + { + "type": "steamadvantage:recipe_mode", + "mode": "TECH_PROGRESSION" + }, + { + "type": "steamadvantage:musket_enabled" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:ingots/steel" + } + ], + "group": "steamadvantage:musket" +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_boiler_coal.json b/src/main/resources/data/steamadvantage/recipes/steam_boiler_coal.json new file mode 100644 index 0000000..6db646b --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_boiler_coal.json @@ -0,0 +1,43 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "gXg", + "pmp" + ], + "key": { + "X": { + "tag": "forge:conduits/steam" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_boiler_coal" + }, + "group": "steamadvantage:steam_boiler_coal", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:conduits/steam" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_boiler_electric.json b/src/main/resources/data/steamadvantage/recipes/steam_boiler_electric.json new file mode 100644 index 0000000..671decc --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_boiler_electric.json @@ -0,0 +1,47 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " Y ", + "gXg", + "pmp" + ], + "key": { + "X": { + "tag": "forge:wires" + }, + "Y": { + "item": "minecraft:bucket" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_boiler_electric" + }, + "group": "steamadvantage:steam_boiler_electric", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:wires" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_boiler_geothermal.json b/src/main/resources/data/steamadvantage/recipes/steam_boiler_geothermal.json new file mode 100644 index 0000000..027f7f8 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_boiler_geothermal.json @@ -0,0 +1,47 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " Y ", + "gXg", + "pmp" + ], + "key": { + "X": { + "tag": "forge:conduits/steam" + }, + "Y": { + "item": "minecraft:obsidian" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_boiler_geothermal" + }, + "group": "steamadvantage:steam_boiler_geothermal", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:conduits/steam" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_boiler_oil.json b/src/main/resources/data/steamadvantage/recipes/steam_boiler_oil.json new file mode 100644 index 0000000..ffd0c03 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_boiler_oil.json @@ -0,0 +1,43 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " Y ", + "gXg", + "pmp" + ], + "key": { + "X": { + "item": "minecraft:furnace" + }, + "Y": { + "item": "minecraft:bucket" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_boiler_oil" + }, + "group": "steamadvantage:steam_boiler_oil", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_crusher.json b/src/main/resources/data/steamadvantage/recipes/steam_crusher.json new file mode 100644 index 0000000..a572272 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_crusher.json @@ -0,0 +1,47 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " Y ", + "gXg", + "pmp" + ], + "key": { + "X": { + "item": "minecraft:piston" + }, + "Y": { + "tag": "forge:storage_blocks/steel" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_crusher" + }, + "group": "steamadvantage:steam_crusher", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:storage_blocks/steel" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_drill.json b/src/main/resources/data/steamadvantage/recipes/steam_drill.json new file mode 100644 index 0000000..f872051 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_drill.json @@ -0,0 +1,39 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "gXg", + "pmp" + ], + "key": { + "X": { + "item": "steamadvantage:steam_drill_bit" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_drill" + }, + "group": "steamadvantage:steam_drill", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_drill_bit.json b/src/main/resources/data/steamadvantage/recipes/steam_drill_bit.json new file mode 100644 index 0000000..397c0d6 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_drill_bit.json @@ -0,0 +1,37 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " g ", + " i ", + "did" + ], + "key": { + "g": { + "tag": "forge:sprockets" + }, + "i": { + "tag": "forge:ingots/steel" + }, + "d": { + "tag": "forge:gems/diamond" + } + }, + "result": { + "item": "steamadvantage:steam_drill_bit" + }, + "group": "steamadvantage:steam_drill_bit", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:gems/diamond" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:ingots/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:sprockets" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_drill_diamond_pickaxe_normal.json b/src/main/resources/data/steamadvantage/recipes/steam_drill_diamond_pickaxe_normal.json new file mode 100644 index 0000000..f718de3 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_drill_diamond_pickaxe_normal.json @@ -0,0 +1,43 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "gXg", + "pmp" + ], + "key": { + "X": { + "item": "minecraft:diamond_pickaxe" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_drill" + }, + "conditions": [ + { + "type": "steamadvantage:recipe_mode", + "mode": "NORMAL" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + } + ], + "group": "steamadvantage:steam_drill" +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_elevator.json b/src/main/resources/data/steamadvantage/recipes/steam_elevator.json new file mode 100644 index 0000000..cb90152 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_elevator.json @@ -0,0 +1,47 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " Y ", + "gXg", + "pmp" + ], + "key": { + "X": { + "item": "minecraft:piston" + }, + "Y": { + "tag": "forge:sprockets" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_elevator" + }, + "group": "steamadvantage:steam_elevator", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:sprockets" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_furnace.json b/src/main/resources/data/steamadvantage/recipes/steam_furnace.json new file mode 100644 index 0000000..642b304 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_furnace.json @@ -0,0 +1,39 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "gXg", + "pmp" + ], + "key": { + "X": { + "item": "minecraft:furnace" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_furnace" + }, + "group": "steamadvantage:steam_furnace", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_governor_apocalyptic.json b/src/main/resources/data/steamadvantage/recipes/steam_governor_apocalyptic.json new file mode 100644 index 0000000..56eb2d9 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_governor_apocalyptic.json @@ -0,0 +1,44 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " t ", + "srs", + "btb" + ], + "key": { + "t": { + "tag": "forge:sprockets" + }, + "s": { + "tag": "forge:rods" + }, + "r": { + "tag": "forge:rods" + }, + "b": { + "tag": "forge:ingots/brass" + } + }, + "result": { + "item": "steamadvantage:steam_governor" + }, + "conditions": [ + { + "type": "steamadvantage:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:ingots/brass" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:rods" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:sprockets" + } + ], + "group": "steamadvantage:steam_governor" +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_governor_normal.json b/src/main/resources/data/steamadvantage/recipes/steam_governor_normal.json new file mode 100644 index 0000000..6dbea01 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_governor_normal.json @@ -0,0 +1,40 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " t ", + "srs", + "btb" + ], + "key": { + "t": { + "tag": "forge:nuggets/iron" + }, + "s": { + "item": "minecraft:stick" + }, + "r": { + "item": "minecraft:stick" + }, + "b": { + "tag": "forge:ingots/brass" + } + }, + "result": { + "item": "steamadvantage:steam_governor" + }, + "conditions": [ + { + "type": "steamadvantage:recipe_mode", + "mode": "NORMAL" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:ingots/brass" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:nuggets/iron" + } + ], + "group": "steamadvantage:steam_governor" +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_governor_tech.json b/src/main/resources/data/steamadvantage/recipes/steam_governor_tech.json new file mode 100644 index 0000000..eb07874 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_governor_tech.json @@ -0,0 +1,44 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " t ", + "srs", + "btb" + ], + "key": { + "t": { + "tag": "forge:sprockets" + }, + "s": { + "tag": "forge:rods" + }, + "r": { + "tag": "forge:rods" + }, + "b": { + "tag": "forge:ingots/brass" + } + }, + "result": { + "item": "steamadvantage:steam_governor" + }, + "conditions": [ + { + "type": "steamadvantage:recipe_mode", + "mode": "TECH_PROGRESSION" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:ingots/brass" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:rods" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:sprockets" + } + ], + "group": "steamadvantage:steam_governor" +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_pipe.json b/src/main/resources/data/steamadvantage/recipes/steam_pipe.json new file mode 100644 index 0000000..5ef549c --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_pipe.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "xxx", + " ", + "xxx" + ], + "key": { + "x": { + "tag": "forge:ingots/brass" + } + }, + "result": { + "item": "steamadvantage:steam_pipe", + "count": 6 + }, + "group": "steamadvantage:steam_pipe", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:ingots/brass" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_pump.json b/src/main/resources/data/steamadvantage/recipes/steam_pump.json new file mode 100644 index 0000000..8de30eb --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_pump.json @@ -0,0 +1,43 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " Y ", + "gXg", + "pmp" + ], + "key": { + "X": { + "item": "minecraft:piston" + }, + "Y": { + "item": "minecraft:bucket" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_pump" + }, + "group": "steamadvantage:steam_pump", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_still.json b/src/main/resources/data/steamadvantage/recipes/steam_still.json new file mode 100644 index 0000000..dbfe1d0 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_still.json @@ -0,0 +1,43 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " Y ", + "gXg", + "pmp" + ], + "key": { + "X": { + "item": "minecraft:bucket" + }, + "Y": { + "item": "minecraft:bucket" + }, + "g": { + "tag": "forge:governors" + }, + "p": { + "tag": "forge:plates/iron" + }, + "m": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_still" + }, + "group": "steamadvantage:steam_still", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/iron" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_switch.json b/src/main/resources/data/steamadvantage/recipes/steam_switch.json new file mode 100644 index 0000000..512dbbc --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_switch.json @@ -0,0 +1,32 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " L ", + "pfp" + ], + "key": { + "L": { + "item": "minecraft:lever" + }, + "p": { + "tag": "forge:conduits/steam" + }, + "f": { + "tag": "forge:frames/steel" + } + }, + "result": { + "item": "steamadvantage:steam_switch" + }, + "group": "steamadvantage:steam_switch", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:conduits/steam" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:frames/steel" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_tank.json b/src/main/resources/data/steamadvantage/recipes/steam_tank.json new file mode 100644 index 0000000..2ec9ff1 --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_tank.json @@ -0,0 +1,37 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "xgx", + "xpx", + "xxx" + ], + "key": { + "x": { + "tag": "forge:plates/copper" + }, + "p": { + "tag": "forge:conduits/steam" + }, + "g": { + "tag": "forge:governors" + } + }, + "result": { + "item": "steamadvantage:steam_tank" + }, + "group": "steamadvantage:steam_tank", + "conditions": [ + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:conduits/steam" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:governors" + }, + { + "type": "poweradvantage:tag_not_empty", + "tag": "forge:plates/copper" + } + ] +} diff --git a/src/main/resources/data/steamadvantage/recipes/steam_track.json b/src/main/resources/data/steamadvantage/recipes/steam_track.json new file mode 100644 index 0000000..fd4546c --- /dev/null +++ b/src/main/resources/data/steamadvantage/recipes/steam_track.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "steamadvantage:steam_pipe" + }, + { + "item": "poweradvantage:steel_frame" + } + ], + "result": { + "item": "steamadvantage:steam_track" + }, + "group": "steamadvantage:steam_track" +} diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info deleted file mode 100644 index cbfac9f..0000000 --- a/src/main/resources/mcmod.info +++ /dev/null @@ -1,16 +0,0 @@ -[ -{ - "modid": "steamadvantage", - "name": "Steam Advantage", - "description": "Add-on mod to Power Advantage that adds steam-powered machines to Minecraft", - "version": "${version}", - "mcversion": "${mcversion}", - "url": "", - "updateUrl": "", - "authorList": ["DrCyano"], - "credits": "The Forge and FML guys, the author of this mod, James Watt, and water vapor", - "logoFile": "", - "screenshots": [], - "dependencies": [] -} -] diff --git a/src/test/java/zone/moddev/mc/steamadvantage/machines/SteamDrillPersistenceTest.java b/src/test/java/zone/moddev/mc/steamadvantage/machines/SteamDrillPersistenceTest.java new file mode 100644 index 0000000..84a850f --- /dev/null +++ b/src/test/java/zone/moddev/mc/steamadvantage/machines/SteamDrillPersistenceTest.java @@ -0,0 +1,32 @@ +package zone.moddev.mc.steamadvantage.machines; + +import net.minecraft.nbt.NBTTagCompound; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class SteamDrillPersistenceTest { + @Test public void retainsLegacyProgressUntilWorldIsAttached() { + SteamDrillTileEntity drill = new SteamDrillTileEntity(); + drill.read(target(94)); + drill.prepareDataFieldsForSync(); + assertEquals(94, drill.getDataFieldArray()[1]); + } + + @Test public void clearsPreviousProgressOnReadingAnUntargetedTile() { + SteamDrillTileEntity drill = new SteamDrillTileEntity(); + drill.read(target(94)); + drill.read(new NBTTagCompound()); + drill.prepareDataFieldsForSync(); + assertEquals(0, drill.getDataFieldArray()[1]); + } + + private static NBTTagCompound target(int progress) { + NBTTagCompound tag = new NBTTagCompound(); + tag.setShort("progress", (short) progress); + tag.setInt("targetX", 2048); + tag.setInt("targetY", 80); + tag.setInt("targetZ", 2049); + return tag; + } +} diff --git a/src/test/java/zone/moddev/mc/steamadvantage/migration/SteamLegacyMigrationsTest.java b/src/test/java/zone/moddev/mc/steamadvantage/migration/SteamLegacyMigrationsTest.java new file mode 100644 index 0000000..5a82a4a --- /dev/null +++ b/src/test/java/zone/moddev/mc/steamadvantage/migration/SteamLegacyMigrationsTest.java @@ -0,0 +1,57 @@ +package zone.moddev.mc.steamadvantage.migration; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import cyano.poweradvantage.api.migration.LegacyMigrationApi; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import org.junit.Test; + +public class SteamLegacyMigrationsTest { + @Test public void preservesAllSixDrillFacings() { + for (EnumFacing facing : EnumFacing.values()) { + assertEquals(facing, SteamLegacyMigrations.legacyDrillFacing(facing.getIndex())); + } + } + + @Test public void clampsLegacyPlatformHeight() { + assertEquals(0, SteamLegacyMigrations.legacyPlatformHeight(0)); + assertEquals(3, SteamLegacyMigrations.legacyPlatformHeight(3)); + assertEquals(4, SteamLegacyMigrations.legacyPlatformHeight(15)); + } + + @Test public void repairsLegacyPumpAndGeothermalKeysWithoutOverwritingCanonicalState() { + NBTTagCompound pump = new NBTTagCompound(); + pump.setString("id", "steamadvantage.steam_pump"); + NBTTagCompound oldTank = new NBTTagCompound(); + oldTank.setInt("Amount", 1250); + pump.setTag("TankOut", oldTank); + assertTrue(SteamLegacyMigrations.repairPersistenceKeys(pump)); + assertEquals(1250, pump.getCompound("Tank").getInt("Amount")); + + NBTTagCompound boiler = new NBTTagCompound(); + boiler.setString("id", "steamadvantage:steam_boiler_geothermal"); + boiler.setFloat("Tempoerature", 412.5F); + assertTrue(SteamLegacyMigrations.repairPersistenceKeys(boiler)); + assertEquals(412.5F, boiler.getFloat("Temperature"), 0.0F); + + NBTTagCompound canonical = new NBTTagCompound(); + canonical.setString("id", "steamadvantage:steam_boiler_geothermal"); + canonical.setFloat("Temperature", 500.0F); + canonical.setFloat("Tempoerature", 100.0F); + assertFalse(SteamLegacyMigrations.repairPersistenceKeys(canonical)); + assertEquals(500.0F, canonical.getFloat("Temperature"), 0.0F); + } + + @Test public void aliasesLegacyTileIds() { + SteamLegacyMigrations.register(); + assertEquals("steamadvantage:steam_pump", + LegacyMigrationApi.tileTarget("steamadvantage.steam_pump")); + assertEquals("steamadvantage:steam_drill", + LegacyMigrationApi.tileTarget("steamadvantage.steam_drill")); + assertEquals("steamadvantage:steam_drill", + LegacyMigrationApi.tileTarget("minecraft:steamadvantage.steam_drill")); + } +} diff --git a/src/test/java/zone/moddev/mc/steamadvantage/resources/ClientResourceContractTest.java b/src/test/java/zone/moddev/mc/steamadvantage/resources/ClientResourceContractTest.java new file mode 100644 index 0000000..0a025d5 --- /dev/null +++ b/src/test/java/zone/moddev/mc/steamadvantage/resources/ClientResourceContractTest.java @@ -0,0 +1,93 @@ +package zone.moddev.mc.steamadvantage.resources; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import org.junit.Test; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Map; +import java.util.stream.Stream; +import static org.junit.Assert.*; + +public class ClientResourceContractTest { + private static final Path ROOT = Paths.get("src/main/resources"); + private static final Path ASSETS = ROOT.resolve("assets/steamadvantage"); + + @Test public void blockstatesUseLiteralModelPaths() throws Exception { + try (Stream files = Files.walk(ASSETS.resolve("blockstates"))) { + for (Path file : (Iterable) files.filter(p -> p.toString().endsWith(".json"))::iterator) { + verifyModels(read(file), file); + } + } + } + + @Test public void obsoleteSelectorsAreAbsent() throws Exception { + try (Stream files = Files.walk(ASSETS.resolve("blockstates"))) { + for (Path file : (Iterable) files.filter(p -> p.toString().endsWith(".json"))::iterator) { + JsonObject state = read(file); + assertFalse(file.toString(), state.has("forge_marker")); + if (state.has("variants")) { + assertFalse(file.toString(), state.getAsJsonObject("variants").has("normal")); + assertFalse(file.toString(), state.getAsJsonObject("variants").has("fluid")); + } + } + } + } + + @Test public void parentsAndTexturesExistInActualPacks() throws Exception { + try (Stream files = Files.walk(ASSETS.resolve("models"))) { + for (Path file : (Iterable) files.filter(p -> p.toString().endsWith(".json"))::iterator) { + JsonObject model = read(file); + if (model.has("parent")) reference(model.get("parent").getAsString(), "models", ".json", file); + if (model.has("textures")) for (Map.Entry entry : model.getAsJsonObject("textures").entrySet()) + reference(entry.getValue().getAsString(), "textures", ".png", file); + } + } + } + + @Test public void modernAliasesRetainEveryLegacyTranslation() throws Exception { + try (Stream files = Files.walk(ASSETS.resolve("lang"))) { + for (Path file : (Iterable) files.filter(p -> p.toString().endsWith(".json"))::iterator) { + JsonObject locale = read(file); + for (Map.Entry entry : locale.entrySet()) { + String key = entry.getKey(); + if (!(key.startsWith("tile.steamadvantage.") || key.startsWith("item.steamadvantage.")) + || !key.endsWith(".name")) continue; + String alias = key.substring(0, key.length() - 5); + if (alias.startsWith("tile.")) alias = "block." + alias.substring(5); + assertEquals(file + " lost alias " + alias, entry.getValue(), locale.get(alias)); + } + } + } + } + + private static void verifyModels(JsonElement node, Path file) { + if (node.isJsonObject()) for (Map.Entry entry : node.getAsJsonObject().entrySet()) { + if ("model".equals(entry.getKey())) reference(entry.getValue().getAsString(), "models", ".json", file); + else verifyModels(entry.getValue(), file); + } + else if (node.isJsonArray()) for (JsonElement child : node.getAsJsonArray()) verifyModels(child, file); + } + + private static void reference(String id, String directory, String suffix, Path file) { + if (id.startsWith("#")) return; + String[] parts = id.split(":", 2); + String namespace = parts.length == 2 ? parts[0] : "minecraft"; + String path = parts.length == 2 ? parts[1] : parts[0]; + if ("minecraft".equals(namespace) && path.startsWith("builtin/")) return; + String resource = "assets/" + namespace + "/" + directory + "/" + path + suffix; + boolean exists = "steamadvantage".equals(namespace) ? Files.isRegularFile(ROOT.resolve(resource)) + : ClientResourceContractTest.class.getClassLoader().getResource(resource) != null; + assertTrue(file + " references missing " + resource, exists); + } + + private static JsonObject read(Path file) throws Exception { + try (Reader reader = Files.newBufferedReader(file, StandardCharsets.UTF_8)) { + return new JsonParser().parse(reader).getAsJsonObject(); + } + } +} diff --git a/src/test/java/zone/moddev/mc/steamadvantage/resources/RecipeUnlockContractTest.java b/src/test/java/zone/moddev/mc/steamadvantage/resources/RecipeUnlockContractTest.java new file mode 100644 index 0000000..a2811b2 --- /dev/null +++ b/src/test/java/zone/moddev/mc/steamadvantage/resources/RecipeUnlockContractTest.java @@ -0,0 +1,131 @@ +package zone.moddev.mc.steamadvantage.resources; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.io.IOException; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.Test; +import static org.junit.Assert.*; + +public class RecipeUnlockContractTest { + private static final String MOD = "steamadvantage"; + private static final Path DATA = Paths.get("src/main/resources/data", MOD); + private static final Set IGNORED = new LinkedHashSet<>(java.util.Arrays.asList( + "item:minecraft:stick", "item:minecraft:string", "item:minecraft:feather", "tag:forge:rods/wooden")); + + @Test public void everyCraftingRecipeHasExactlyOneUnlockAndProcessingHasNone() throws IOException { + Set expected = new LinkedHashSet<>(); + for (Path file : files(DATA.resolve("recipes"))) { + if (crafting(read(file))) expected.add(file.getFileName().toString()); + } + Set actual = files(DATA.resolve("advancements/recipes")).stream() + .map(file -> file.getFileName().toString()).collect(Collectors.toSet()); + assertFalse("No crafting recipes found", expected.isEmpty()); + assertEquals("Missing or orphaned recipe unlocks", expected, actual); + } + + @Test public void discoveriesAreSingleIngredientAlternativesNotAnEntireCraftingGrid() throws IOException { + for (Path file : files(DATA.resolve("recipes"))) { + JsonObject recipe = read(file); + if (!crafting(recipe)) continue; + JsonObject unlock = read(DATA.resolve("advancements/recipes").resolve(file.getFileName())); + assertEquals("minecraft:recipes/root", unlock.get("parent").getAsString()); + assertFalse("Recipe unlocks should not create visible advancement tabs", unlock.has("display")); + JsonObject criteria = unlock.getAsJsonObject("criteria"); + Set actual = new LinkedHashSet<>(); + for (Map.Entry entry : criteria.entrySet()) { + if (entry.getKey().equals("has_recipe")) continue; + JsonObject criterion = entry.getValue().getAsJsonObject(); + assertEquals(file.toString(), "minecraft:inventory_changed", criterion.get("trigger").getAsString()); + JsonArray items = criterion.getAsJsonObject("conditions").getAsJsonArray("items"); + assertEquals("Finding ONE ingredient must be enough: " + file, 1, items.size()); + JsonObject predicate = items.get(0).getAsJsonObject(); + assertEquals("Only an item or tag predicate is expected", 1, predicate.size()); + actual.add(predicateKey(predicate)); + } + List choices = new ArrayList<>(); + if (recipe.has("key")) { + for (Map.Entry entry : recipe.getAsJsonObject("key").entrySet()) + collect(entry.getValue(), choices); + } else collect(recipe.has("ingredients") ? recipe.get("ingredients") : recipe.get("ingredient"), choices); + Set expected = choices.stream().map(RecipeUnlockContractTest::predicateKey) + .filter(key -> !IGNORED.contains(key)).collect(Collectors.toCollection(LinkedHashSet::new)); + if (expected.isEmpty()) for (JsonObject choice : choices) expected.add(predicateKey(choice)); + assertEquals("Trigger must correspond to a relevant recipe ingredient: " + file, expected, actual); + JsonArray requirements = unlock.getAsJsonArray("requirements"); + assertEquals("All criteria must form one OR group", 1, requirements.size()); + Set alternatives = new LinkedHashSet<>(); + for (JsonElement key : requirements.get(0).getAsJsonArray()) alternatives.add(key.getAsString()); + assertEquals(criteria.entrySet().stream().map(Map.Entry::getKey).collect(Collectors.toSet()), alternatives); + } + } + + @Test public void rewardAndRecipeCommandCriterionReferToTheExactVariant() throws IOException { + for (Path file : files(DATA.resolve("advancements/recipes"))) { + String id = MOD + ":" + file.getFileName().toString().replace(".json", ""); + JsonObject unlock = read(file); + JsonArray recipes = unlock.getAsJsonObject("rewards").getAsJsonArray("recipes"); + assertEquals(1, recipes.size()); + assertEquals(id, recipes.get(0).getAsString()); + JsonObject criterion = unlock.getAsJsonObject("criteria").getAsJsonObject("has_recipe"); + assertEquals("minecraft:recipe_unlocked", criterion.get("trigger").getAsString()); + assertEquals(id, criterion.getAsJsonObject("conditions").get("recipe").getAsString()); + assertFalse("Forge recipe conditions are not valid advancement conditions", unlock.has("conditions")); + } + } + + @Test public void recipeBookGroupsIdentifyTheOutputNotABroadMachineCategory() throws IOException { + for (Path file : files(DATA.resolve("recipes"))) { + JsonObject recipe = read(file); + if (!crafting(recipe)) continue; + JsonElement result = recipe.get("result"); + String output = result.isJsonPrimitive() ? result.getAsString() + : result.getAsJsonObject().get("item").getAsString(); + assertTrue("Missing output-specific group: " + file, recipe.has("group")); + assertEquals("Different items must not share a recipe-book cell: " + file, + output, recipe.get("group").getAsString()); + } + } + + private static boolean crafting(JsonObject recipe) { + String type = recipe.get("type").getAsString(); + return type.equals("minecraft:crafting_shaped") || type.equals("minecraft:crafting_shapeless") + || type.equals("minecraft:smelting"); + } + + private static String predicateKey(JsonObject predicate) { + String type = predicate.has("tag") ? "tag" : "item"; + return type + ":" + predicate.get(type).getAsString(); + } + + private static void collect(JsonElement element, List result) { + if (element.isJsonArray()) for (JsonElement child : element.getAsJsonArray()) collect(child, result); + else result.add(element.getAsJsonObject()); + } + + private static JsonObject read(Path file) throws IOException { + try (Reader reader = Files.newBufferedReader(file, StandardCharsets.UTF_8)) { + return new JsonParser().parse(reader).getAsJsonObject(); + } + } + + private static List files(Path directory) throws IOException { + if (!Files.isDirectory(directory)) return java.util.Collections.emptyList(); + try (Stream files = Files.walk(directory)) { + return files.filter(path -> path.toString().endsWith(".json")).sorted().collect(Collectors.toList()); + } + } +} diff --git a/tools/generate-recipe-unlocks.js b/tools/generate-recipe-unlocks.js new file mode 100644 index 0000000..2714622 --- /dev/null +++ b/tools/generate-recipe-unlocks.js @@ -0,0 +1,56 @@ +// Rebuild the checked-in recipe-book advancements; Node is not needed for normal builds. +const fs = require('fs'); +const path = require('path'); + +const root = path.resolve(__dirname, '..'); +const properties = fs.readFileSync(path.join(root, 'gradle.properties'), 'utf8'); +const mod = /^mod_id=(.+)$/m.exec(properties)[1].trim(); +const data = path.join(root, 'src/main/resources/data', mod); +const recipes = path.join(data, 'recipes'); +const output = path.join(data, 'advancements/recipes'); +const check = process.argv.includes('--check'); +const ignored = new Set(['item:minecraft:stick', 'item:minecraft:string', + 'item:minecraft:feather', 'tag:forge:rods/wooden']); + +function choices(value) { + if (Array.isArray(value)) return value.flatMap(choices); + if (value && value.tag) return [{tag: value.tag}]; + if (value && value.item) return [{item: value.item}]; + throw new Error('Unsupported recipe ingredient: ' + JSON.stringify(value)); +} + +const expected = new Set(); +for (const file of fs.readdirSync(recipes).filter(name => name.endsWith('.json')).sort()) { + const recipe = JSON.parse(fs.readFileSync(path.join(recipes, file), 'utf8')); + if (!['minecraft:crafting_shaped', 'minecraft:crafting_shapeless', 'minecraft:smelting'].includes(recipe.type)) continue; + const inputs = choices(recipe.key ? Object.values(recipe.key) : recipe.ingredients || recipe.ingredient); + const materials = inputs.filter(value => !ignored.has(Object.entries(value)[0].join(':'))); + const unique = [...new Map((materials.length ? materials : inputs).map(value => [JSON.stringify(value), value])).values()]; + const id = `${mod}:${file.slice(0, -5)}`; + const criteria = {}; + unique.forEach((ingredient, index) => { + criteria[`has_ingredient_${index + 1}`] = { + trigger: 'minecraft:inventory_changed', conditions: {items: [ingredient]} + }; + }); + criteria.has_recipe = {trigger: 'minecraft:recipe_unlocked', conditions: {recipe: id}}; + const advancement = { + parent: 'minecraft:recipes/root', criteria, + requirements: [Object.keys(criteria)], rewards: {recipes: [id]} + }; + const text = JSON.stringify(advancement, null, 2) + '\n'; + const target = path.join(output, file); + expected.add(file); + if (check) { + if (!fs.existsSync(target) || fs.readFileSync(target, 'utf8').replace(/\r\n/g, '\n') !== text) { + throw new Error('Missing/stale recipe unlock: ' + target); + } + } else { + fs.mkdirSync(output, {recursive: true}); + fs.writeFileSync(target, text); + } +} +for (const file of fs.existsSync(output) ? fs.readdirSync(output) : []) { + if (file.endsWith('.json') && !expected.has(file)) throw new Error('Unexpected recipe unlock: ' + file); +} +console.log(`${mod}: ${expected.size} recipe unlocks ${check ? 'verified' : 'generated'}`);