diff --git a/.github/scripts/generate-publish-matrix.sh b/.github/scripts/generate-publish-matrix.sh new file mode 100755 index 000000000..9e114ae14 --- /dev/null +++ b/.github/scripts/generate-publish-matrix.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +allowed_mod_loaders=$1 +curseforge_fabric_project_id=$2 +curseforge_forge_project_id=$3 +modrinth_fabric_project_id=$4 +modrinth_forge_project_id=$5 + +IFS=',' read -r -a allowed_mod_loaders_array <<< "${allowed_mod_loaders//[\[\]\']/}" +matrix_content="{\"include\":[" +enabled_platforms=$(awk -F= '/enabled_platforms/{print $2}' gradle.properties | tr -d ' ') +minecraft_version=$(awk -F= '/minecraft_version/{print $2; exit}' gradle.properties | tr -d ' ') + +for platform in $(echo $enabled_platforms | tr ',' ' '); do + if [[ " ${allowed_mod_loaders_array[@]} " =~ " ${platform} " ]]; then + if [[ "$platform" == "fabric" ]]; then + supported_mod_loaders="\"fabric\",\"quilt\"" + else + supported_mod_loaders="\"$platform\"" + fi + + if [[ "$platform" == "fabric" ]]; then + curseforge_project_id="$curseforge_fabric_project_id" + modrinth_project_id="$modrinth_fabric_project_id" + else + curseforge_project_id="$curseforge_forge_project_id" + modrinth_project_id="$modrinth_forge_project_id" + fi + + matrix_entry="{\"mod_loader\":\"$platform\",\"minecraft_version\":\"$minecraft_version\",\"supported_mod_loaders\":[$supported_mod_loaders],\"curseforge_project_id\":\"$curseforge_project_id\",\"modrinth_project_id\":\"$modrinth_project_id\"}," + matrix_content+="$matrix_entry" + fi +done + +matrix_content="${matrix_content%,}]}" +echo "Generated matrix: $matrix_content" +echo "::set-output name=matrix::$matrix_content" \ No newline at end of file diff --git a/.github/scripts/generate-run-matrix.sh b/.github/scripts/generate-run-matrix.sh index 8d64e1e91..47d456cc7 100755 --- a/.github/scripts/generate-run-matrix.sh +++ b/.github/scripts/generate-run-matrix.sh @@ -5,9 +5,13 @@ enabled_platforms=$(awk -F= '/enabled_platforms/{print $2}' gradle.properties | version=$(awk -F= '/minecraft_version/{print $2; exit}' gradle.properties | tr -d ' ') for platform in $(echo $enabled_platforms | tr ',' ' '); do - matrix_entry="{\"mod_loader\":\"$platform\",\"version\":\"$version\",\"script\":\"client\"}," - matrix_content+="$matrix_entry" - matrix_entry="{\"mod_loader\":\"$platform\",\"version\":\"$version\",\"script\":\"server\"}," + if [[ "$platform" == "forge" ]]; then + mod_loader_alias="lexforge" + else + mod_loader_alias="$platform" + fi + + matrix_entry="{\"mod_loader\":\"$platform\",\"mod_loader_alias\":\"$mod_loader_alias\",\"version\":\"$version\"}," matrix_content+="$matrix_entry" done diff --git a/.github/scripts/parse-changelog.sh b/.github/scripts/parse-changelog.sh new file mode 100755 index 000000000..428369e52 --- /dev/null +++ b/.github/scripts/parse-changelog.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +tag=$1 + +changelog=$(cat CHANGELOG.md) + +list=$(echo "$changelog" | sed -n "/^## $tag/,/^## [0-9]/p" | sed -e '1d;$d' -e '/^$/d') + +echo "Parsed changelog:\n$list" +echo "$list" > RELEASE_CHANGELOG.md \ No newline at end of file diff --git a/.github/scripts/parse-gradle-properties.sh b/.github/scripts/parse-gradle-properties.sh new file mode 100755 index 000000000..2b5c4ad3e --- /dev/null +++ b/.github/scripts/parse-gradle-properties.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +parse_properties_file() { + local file=$1 + while IFS='=' read -r key value; do + # Trim leading/trailing whitespace from key and value + key=$(echo "$key" | awk '{$1=$1;print}') + value=$(echo "$value" | awk '{$1=$1;print}') + + # Skip comments, empty keys, and unwanted keys like "org.gradle.jvmargs" + if [[ -z "$key" || "$key" =~ ^# || "$key" == "org.gradle.jvmargs" ]]; then + continue + fi + + # Convert key to uppercase and replace non-alphanumeric characters with underscores + key=$(echo "$key" | tr '[:lower:]' '[:upper:]' | tr -c '[:alnum:]' '_') + + # Remove any trailing underscores + key=$(echo "$key" | sed 's/_$//') + + # Output the key-value pair + echo "${key}=${value}" + echo "${key}=${value}" >> "$GITHUB_OUTPUT" + done < "$file" +} + +# Parse the main gradle.properties file +parse_properties_file gradle.properties \ No newline at end of file diff --git a/.github/scripts/run-client.sh b/.github/scripts/run-client.sh deleted file mode 100755 index 852d3c1bc..000000000 --- a/.github/scripts/run-client.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -./gradlew $1:runClient --no-daemon 2>&1 | tee gradle_client_output.txt & - -SUCCESS_PATTERN='minecraft:textures/atlas/mob_effects\.png-atlas' -ERROR_PATTERNS=( - 'For more details see the full crash report file' - ' end of report ' - 'Failed download after 3 attempts' -) -TIMEOUT=1800 -ELAPSED=0 - -while [ $ELAPSED -lt $TIMEOUT ]; do - if grep -Eq "$SUCCESS_PATTERN" gradle_client_output.txt; then - pkill -P $$ - exit 0 - fi - - for ERROR_PATTERN in "${ERROR_PATTERNS[@]}"; do - if grep -Eq "$ERROR_PATTERN" gradle_client_output.txt; then - pkill -P $$ - exit 1 - fi - done - - sleep 1 - ELAPSED=$((ELAPSED + 1)) -done - -if [ $ELAPSED -ge $TIMEOUT ]; then - exit 1 -fi diff --git a/.github/scripts/run-server.sh b/.github/scripts/run-server.sh deleted file mode 100755 index 392335537..000000000 --- a/.github/scripts/run-server.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -mkdir -p $1/run && echo "eula=true" > $1/run/eula.txt - -./gradlew $1:runServer --no-daemon --args="nogui" 2>&1 | tee gradle_server_output.txt & - -SUCCESS_PATTERN='For help, type "help"' -ERROR_PATTERNS=( - 'For more details see the full crash report file' - ' end of report ' - 'Failed download after 3 attempts' -) -TIMEOUT=1800 -ELAPSED=0 - -while [ $ELAPSED -lt $TIMEOUT ]; do - if grep -Eq "$SUCCESS_PATTERN" gradle_server_output.txt; then - pkill -P $$ - exit 0 - fi - - for ERROR_PATTERN in "${ERROR_PATTERNS[@]}"; do - if grep -Eq "$ERROR_PATTERN" gradle_server_output.txt; then - pkill -P $$ - exit 1 - fi - done - - sleep 1 - ELAPSED=$((ELAPSED + 1)) -done - -if [ $ELAPSED -ge $TIMEOUT ]; then - exit 1 -fi \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4386fd3b9..f8e942415 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: build: name: "Build project" runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 10 outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -25,26 +25,18 @@ jobs: - name: "Parse gradle properties" id: gradle-properties - run: | - while IFS='=' read -r key value; do - key=$(echo $key | awk '{$1=$1;print}') - value=$(echo $value | awk '{$1=$1;print}') - - case "$key" in - mod_java_version) echo "JAVA_VERSION=$value" >> $GITHUB_OUTPUT ;; - minecraft_version) echo "MINECRAFT_VERSION=$value" >> $GITHUB_OUTPUT ;; - mod_name) echo "MOD_NAME=$value" >> $GITHUB_OUTPUT ;; - mod_version) echo "MOD_VERSION=$value" >> $GITHUB_OUTPUT ;; - enabled_platforms) echo "ENABLED_PLATFORMS=$value" >> $GITHUB_OUTPUT ;; - esac - done < gradle.properties + run: ./.github/scripts/parse-gradle-properties.sh - name: "Set up JDK" uses: actions/setup-java@v4 with: - java-version: ${{ steps.gradle-properties.outputs.JAVA_VERSION }} + java-version: ${{ steps.gradle-properties.outputs.MOD_JAVA_VERSION }} distribution: temurin + - name: "Generate matrix for the run job" + id: set-matrix + run: ./.github/scripts/generate-run-matrix.sh + - name: "Run gradle build" uses: gradle/actions/setup-gradle@v3 with: @@ -53,9 +45,13 @@ jobs: gradle-version: wrapper arguments: build - - name: "Generate matrix for the run job" - id: set-matrix - run: ./.github/scripts/generate-run-matrix.sh + - name: "Upload Built JARs" + uses: actions/upload-artifact@v4 + with: + name: built-jars + if-no-files-found: error + path: | + ./**/build/libs/*[0-9].jar run: name: Run ${{ matrix.mod_loader }} ${{ matrix.script }} @@ -72,35 +68,27 @@ jobs: with: fetch-depth: 0 - - name: "Parse gradle properties" - id: gradle-properties - run: | - while IFS='=' read -r key value; do - key=$(echo $key | awk '{$1=$1;print}') - value=$(echo $value | awk '{$1=$1;print}') - - case "$key" in - mod_java_version) echo "JAVA_VERSION=$value" >> $GITHUB_OUTPUT ;; - esac - done < gradle.properties - - - name: "Set up JDK" - uses: actions/setup-java@v4 + - name: "Download Built JARs" + uses: actions/download-artifact@v4 with: - java-version: ${{ steps.gradle-properties.outputs.JAVA_VERSION }} - distribution: temurin + name: built-jars - - name: "Setup Gradle" - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: true - gradle-version: wrapper + - name: "Parse gradle properties" + id: gradle-properties + run: ./.github/scripts/parse-gradle-properties.sh - - name: "Accept eula" - run: mkdir -p ${{ matrix.mod_loader }}/run && echo "eula=true" > ${{ matrix.mod_loader }}/run/eula.txt + - name: "Copy mod jar to run/mods" + run: mkdir -p run/mods && cp ${{ matrix.mod_loader }}/build/libs/* run/mods - - name: Run ${{ matrix.mod_loader }} ${{ matrix.script }} - uses: modmuss50/xvfb-action@v1 + - name: Run ${{ matrix.version }} ${{ matrix.mod_loader }} + uses: 3arthqu4ke/mc-runtime-test@2.4.0 with: - run: ./.github/scripts/run-${{ matrix.script }}.sh ${{ matrix.mod_loader }} - shell: bash + mc: ${{ matrix.version }} + modloader: ${{ matrix.mod_loader }} + regex: .*${{ matrix.mod_loader }}.* + mc-runtime-test: ${{ matrix.mod_loader_alias }} + java: ${{ steps.gradle-properties.outputs.MOD_JAVA_VERSION }} + java-distribution: temurin + fabric-api: ${{ steps.gradle-properties.outputs.FABRIC_API_VERSION }} + xvfb: false + headlessmc-command: -lwjgl --retries 3 --jvm -Djava.awt.headless=true \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 76f08e15f..cc698e9d8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,25 +15,16 @@ on: type: string jobs: - publish: + build: runs-on: ubuntu-latest - name: Publish ${{ matrix.branch }} ${{ matrix.mod_loader }} - timeout-minutes: 60 + name: Build ${{ matrix.branch }} + timeout-minutes: 15 strategy: - max-parallel: 3 fail-fast: false matrix: branch: ${{ fromJson(inputs.branches) }} - mod_loader: ${{ fromJson(inputs.mod_loaders) }} - include: - - mod_loader: "fabric" - supported_mod_loaders: [ "fabric", "quilt" ] - - - mod_loader: "forge" - supported_mod_loaders: [ "forge" ] - - - mod_loader: "neoforge" - supported_mod_loaders: [ "neoforge" ] + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - name: "Checkout repository" @@ -42,47 +33,14 @@ jobs: ref: ${{ matrix.branch }} fetch-depth: 0 - - name: "Check if the mod loader is supported" - id: check-mod-loader - run: | - if [ -d ${{ matrix.mod_loader }} ]; then - echo "Mod loader is supported" - echo "is_mod_loader_supported=true" >> $GITHUB_OUTPUT - else - echo "Mod loader is not supported" - echo "is_mod_loader_supported=false" >> $GITHUB_OUTPUT - fi - - name: "Parse gradle properties" - if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' id: gradle-properties - run: | - while IFS='=' read -r key value; do - key=$(echo $key | awk '{$1=$1;print}') - value=$(echo $value | awk '{$1=$1;print}') - - case "$key" in - mod_java_version) echo "JAVA_VERSION=$value" >> $GITHUB_OUTPUT ;; - minecraft_version) echo "MINECRAFT_VERSION=$value" >> $GITHUB_OUTPUT ;; - min_minecraft_version) echo "MIN_MINECRAFT_VERSION=$value" >> $GITHUB_OUTPUT ;; - mod_name) echo "MOD_NAME=$value" >> $GITHUB_OUTPUT ;; - mod_version) echo "MOD_VERSION=$value" >> $GITHUB_OUTPUT ;; - esac - done < gradle.properties + run: ./.github/scripts/parse-gradle-properties.sh - name: "Parse changelog" - if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' - id: parse-changelog - run: | - changelog=$(cat CHANGELOG.md) - tag=${{ steps.gradle-properties.outputs.MOD_VERSION }} - - list=$(echo "$changelog" | sed -n "/^## $tag/,/^## [0-9]/p" | sed -e '1d;$d' -e '/^$/d') - - echo "$list" > RELEASE_CHANGELOG.md + run: ./.github/scripts/parse-changelog.sh ${{ steps.gradle-properties.outputs.MOD_VERSION }} - name: "Create github release" - if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' continue-on-error: true uses: ncipollo/release-action@v1 with: @@ -91,39 +49,77 @@ jobs: omitNameDuringUpdate: true omitBodyDuringUpdate: true tag: mc${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}-${{ steps.gradle-properties.outputs.MOD_VERSION }} + commit: ${{ matrix.branch }} name: ${{ steps.gradle-properties.outputs.MOD_NAME }} ${{ steps.gradle-properties.outputs.MOD_VERSION }} for Minecraft ${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }} bodyFile: RELEASE_CHANGELOG.md - name: "Set up JDK" - if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' uses: actions/setup-java@v4 with: - java-version: ${{ steps.gradle-properties.outputs.JAVA_VERSION }} + java-version: ${{ steps.gradle-properties.outputs.MOD_JAVA_VERSION }} distribution: temurin - - name: "Setup gradle and run build" - if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' - uses: gradle/gradle-build-action@v3 + - name: "Setup Gradle and run build" + uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: true + cache-read-only: false generate-job-summary: false gradle-version: wrapper - arguments: ${{ matrix.mod_loader }}:build + arguments: build + + - name: "Upload Built JARs" + uses: actions/upload-artifact@v4 + with: + name: built-jars + if-no-files-found: error + path: | + ./**/build/libs/*[0-9].jar + + - name: "Generate matrix for the run job" + id: set-matrix + run: ./.github/scripts/generate-publish-matrix.sh "${{ inputs.mod_loaders }}" ${{ vars.CURSEFORGE_FABRIC_PROJECT_ID }} ${{ vars.CURSEFORGE_FORGE_PROJECT_ID }} ${{ vars.MODRINTH_FABRIC_PROJECT_ID }} ${{ vars.MODRINTH_FORGE_PROJECT_ID }} + + publish: + runs-on: ubuntu-latest + needs: build + name: Publish ${{ matrix.mod_loader }} + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: ${{fromJson(needs.build.outputs.matrix)}} + + steps: + - name: "Checkout repository" + uses: actions/checkout@v4 + with: + ref: ${{ matrix.minecraft_version }} + fetch-depth: 0 + + - name: "Download Built JARs" + uses: actions/download-artifact@v4 + with: + name: built-jars + + - name: "Parse gradle properties" + id: gradle-properties + run: ./.github/scripts/parse-gradle-properties.sh + + - name: "Parse changelog" + run: ./.github/scripts/parse-changelog.sh ${{ steps.gradle-properties.outputs.MOD_VERSION }} - name: Publish ${{ matrix.mod_loader }} - if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' uses: Kir-Antipov/mc-publish@v3.3.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} github-tag: mc${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}-${{ steps.gradle-properties.outputs.MOD_VERSION }} github-commitish: ${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }} - curseforge-id: ${{ vars.CURSEFORGE_PROJECT_ID }} - curseforge-token: ${{ secrets.CURSEFORGE_RELEASE_TOKEN }} + #curseforge-id: ${{ matrix.curseforge_project_id }} + #curseforge-token: ${{ secrets.CURSEFORGE_RELEASE_TOKEN }} - modrinth-id: ${{ vars.MODRINTH_PROJECT_ID }} - modrinth-featured: true - modrinth-token: ${{ secrets.MODRINTH_RELEASE_TOKEN}} + #modrinth-id: ${{ matrix.modrinth_project_id }} + #modrinth-featured: true + #modrinth-token: ${{ secrets.MODRINTH_RELEASE_TOKEN }} name: ${{ steps.gradle-properties.outputs.MOD_NAME }} ${{ steps.gradle-properties.outputs.MOD_VERSION }} version: ${{ matrix.mod_loader }}-mc${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}-${{ steps.gradle-properties.outputs.MOD_VERSION }} @@ -131,16 +127,4 @@ jobs: game-versions: "${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}\n${{ steps.gradle-properties.outputs.MIN_MINECRAFT_VERSION }}" changelog-file: RELEASE_CHANGELOG.md files: | - ${{ matrix.mod_loader }}/build/libs/!(*-@(dev|dev-shadow|sources|javadoc)).jar - - clear-cache: - needs: publish - runs-on: ubuntu-latest - name: "Clear cache" - timeout-minutes: 60 - steps: - - uses: MyAlbum/purge-cache@v2 - with: - accessed: true - created: true - max-age: 21600 \ No newline at end of file + ${{ matrix.mod_loader }}/build/libs/*[0-9].jar diff --git a/CHANGELOG.md b/CHANGELOG.md index 459efa616..fd9d9faec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 3.0.0 + +- Added crab +- Fixed wildfire crown enchantability on newer minecraft versions +- Corrected bamboo, cherry, crimson and warped beehives wood sound groups +- Corrected crimson and warped beehive flammability +- Added de_de translations (Thanks to tristankechlo) +- Updated vi_vn translations (Thanks to godkyo98) +- Huge internal refactoring (restructure) of the mod (can cause a lot of new bugs/missing features) + ## 2.0.17 - Fixed tuff golem holding enchanted "book" instead of enchanted "enchanted book" diff --git a/Makefile b/Makefile index 15874bd7e..e5b693735 100644 --- a/Makefile +++ b/Makefile @@ -19,11 +19,17 @@ gen-sources: ## Generate sources run-fabric-client: ## Runs fabric client ./gradlew fabric:runClient +run-forge-client: ## Runs forge client + ./gradlew forge:runClient + run-neoforge-client: ## Runs neoforge client ./gradlew neoforge:runClient run-fabric-server: ## Runs fabric server ./gradlew fabric:runServer +run-forge-server: ## Runs forge server + ./gradlew forge:runServer + run-neoforge-server: ## Runs neoforge server ./gradlew neoforge:runServer \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3ebbeb353..cc73c4927 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ subprojects { dependencies { minecraft "com.mojang:minecraft:${minecraft_version}" mappings loom.layered { - it.mappings "net.fabricmc:yarn:${yarn_mappings}" + it.mappings "net.fabricmc:yarn:${yarn_mappings}:v2" it.mappings "dev.architectury:yarn-mappings-patch-neoforge:${yarn_mappings_patch}" } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoes.java similarity index 98% rename from common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoes.java rename to common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoes.java index 09497dcbf..d5e765d74 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoes.java @@ -1,4 +1,4 @@ -package com.faboslav.friendsandfoes; +package com.faboslav.friendsandfoes.common; import com.faboslav.friendsandfoes.common.api.MoobloomVariantManager; import com.faboslav.friendsandfoes.common.config.FriendsAndFoesConfig; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoesClient.java b/common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoesClient.java similarity index 96% rename from common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoesClient.java rename to common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoesClient.java index b18cd07f9..c916910a2 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/FriendsAndFoesClient.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/FriendsAndFoesClient.java @@ -1,4 +1,4 @@ -package com.faboslav.friendsandfoes; +package com.faboslav.friendsandfoes.common; import com.faboslav.friendsandfoes.common.events.client.RegisterEntityLayersEvent; import com.faboslav.friendsandfoes.common.events.client.RegisterEntityRenderersEvent; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/api/MoobloomVariantManager.java b/common/src/main/java/com/faboslav/friendsandfoes/common/api/MoobloomVariantManager.java index f6e789afc..ec54d41f7 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/api/MoobloomVariantManager.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/api/MoobloomVariantManager.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.api; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesBlocks; import com.faboslav.friendsandfoes.common.tag.FriendsAndFoesTags; import com.google.gson.Gson; @@ -109,7 +109,7 @@ public MoobloomVariant getRandomBiomeSpecificMoobloomVariant( var biome = serverWorldAccess.getBiome(blockPos); for (MoobloomVariant moobloomVariant : this.getMoobloomVariants()) { - if (biome.isIn(moobloomVariant.getBiomes()) == false) { + if (!biome.isIn(moobloomVariant.getBiomes())) { continue; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/block/CrabEggBlock.java b/common/src/main/java/com/faboslav/friendsandfoes/common/block/CrabEggBlock.java index c59537ca4..68f8974ca 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/block/CrabEggBlock.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/block/CrabEggBlock.java @@ -139,13 +139,13 @@ public void afterBreak( } public boolean canReplace(BlockState state, ItemPlacementContext context) { - return !context.shouldCancelInteraction() && context.getStack().isOf(this.asItem()) && state.get(EGGS) < 4 ? true:super.canReplace(state, context); + return !context.shouldCancelInteraction() && context.getStack().isOf(this.asItem()) && state.get(EGGS) < 4 || super.canReplace(state, context); } @Nullable public BlockState getPlacementState(ItemPlacementContext ctx) { BlockState blockState = ctx.getWorld().getBlockState(ctx.getBlockPos()); - return blockState.isOf(this) ? blockState.with(EGGS, Math.min(4, (Integer) blockState.get(EGGS) + 1)):super.getPlacementState(ctx); + return blockState.isOf(this) ? blockState.with(EGGS, Math.min(4, blockState.get(EGGS) + 1)):super.getPlacementState(ctx); } public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/block/Oxidizable.java b/common/src/main/java/com/faboslav/friendsandfoes/common/block/Oxidizable.java similarity index 98% rename from common/src/main/java/com/faboslav/friendsandfoes/block/Oxidizable.java rename to common/src/main/java/com/faboslav/friendsandfoes/common/block/Oxidizable.java index 3426a2ea1..0ca1eeaf0 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/block/Oxidizable.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/block/Oxidizable.java @@ -1,4 +1,4 @@ -package com.faboslav.friendsandfoes.block; +package com.faboslav.friendsandfoes.common.block; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesBlocks; import com.google.common.base.Suppliers; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/animation/animator/ModelAnimator.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/animation/animator/ModelAnimator.java index 4e15508c7..60c048cd3 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/animation/animator/ModelAnimator.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/animation/animator/ModelAnimator.java @@ -23,7 +23,7 @@ public final class ModelAnimator { - protected static final Vector3f TEMP = new Vector3f(); + private static final Vector3f TEMP = new Vector3f(); public static void updateKeyframeAnimations( AnimatedEntity animatedEntity, @@ -258,7 +258,7 @@ private static void animateWithProgress( animationCurrentVector = animationContext.getCurrentVector(); animationTargetVector = animationContext.getTargetVector(); - if (animationTargetVector.equals(targetVector) == false) { + if (!animationTargetVector.equals(targetVector)) { animationContextTracker.remove(modelPartName, animationType); animationContext = ModelPartAnimationContext.createWithProgress( progress, @@ -453,7 +453,7 @@ private static void animateModelPartBasedOnTicks( animationTargetVector = animationContext.getTargetVector(); - if (animationTargetVector.equals(targetVector) == false) { + if (!animationTargetVector.equals(targetVector)) { animationContextTracker.remove(modelPartName, animationType); animationContext = ModelPartAnimationContext.createWithTicks( currentEntityTick, diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/GlareFlowerFeatureRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/GlareFlowerFeatureRenderer.java index ec2f8402d..451eb9e2e 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/GlareFlowerFeatureRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/GlareFlowerFeatureRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.feature; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.GlareEntityModel; import com.faboslav.friendsandfoes.common.entity.GlareEntity; import net.fabricmc.api.EnvType; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/MoobloomFlowerFeatureRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/MoobloomFlowerFeatureRenderer.java index 7524c889d..a92ab6550 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/MoobloomFlowerFeatureRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/MoobloomFlowerFeatureRenderer.java @@ -40,7 +40,7 @@ public void render( float k, float l ) { - if (moobloomEntity.isBaby() == false && moobloomEntity.isInvisible() == false) { + if (!moobloomEntity.isBaby() && !moobloomEntity.isInvisible()) { BlockRenderManager blockRenderManager = MinecraftClient.getInstance().getBlockRenderManager(); PlantBlock flower = moobloomEntity.getVariant().getFlower(); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemClosedEyesRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemClosedEyesRenderer.java index 2ef6fb83c..7e50c63cd 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemClosedEyesRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemClosedEyesRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.feature; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.TuffGolemEntityModel; import com.faboslav.friendsandfoes.common.entity.TuffGolemEntity; import net.fabricmc.api.EnvType; @@ -30,7 +30,7 @@ public void render( float k, float l ) { - if (tuffGolem.isInvisible() || tuffGolem.isInSleepingPose() == false) { + if (tuffGolem.isInvisible() || !tuffGolem.isInSleepingPose()) { return; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemClothFeatureRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemClothFeatureRenderer.java index a9e4b8455..7b2593e4c 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemClothFeatureRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemClothFeatureRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.feature; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.TuffGolemEntityModel; import com.faboslav.friendsandfoes.common.entity.TuffGolemEntity; import net.fabricmc.api.EnvType; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemHeldItemFeatureRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemHeldItemFeatureRenderer.java index f22696af5..a4bc39dde 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemHeldItemFeatureRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/feature/TuffGolemHeldItemFeatureRenderer.java @@ -48,7 +48,7 @@ public void render( ) { if ( tuffGolem.isDead() - || ((TuffGolemEntity) tuffGolem).isHoldingItem() == false + || !((TuffGolemEntity) tuffGolem).isHoldingItem() ) { return; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/model/MaulerEntityModel.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/model/MaulerEntityModel.java index 6a8c147ec..62666b59e 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/model/MaulerEntityModel.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/model/MaulerEntityModel.java @@ -106,7 +106,7 @@ public void setAngles( if ( mauler.hasAngerTime() - && mauler.isBurrowedDown() == false + && !mauler.isBurrowedDown() && mauler.isMoving() && mauler.isOnGround() && mauler.getVelocity().getY() <= 0.00001 diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/CopperGolemEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/CopperGolemEntityRenderer.java index 70a1b8c73..2f58e05ca 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/CopperGolemEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/CopperGolemEntityRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.CopperGolemEntityModel; import com.faboslav.friendsandfoes.common.entity.CopperGolemEntity; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityModelLayers; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/CrabEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/CrabEntityRenderer.java index 6521221fc..ccbcfae54 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/CrabEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/CrabEntityRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.CrabEntityModel; import com.faboslav.friendsandfoes.common.entity.CrabEntity; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityModelLayers; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/GlareEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/GlareEntityRenderer.java index fd52bec11..92351e9c5 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/GlareEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/GlareEntityRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.feature.GlareFlowerFeatureRenderer; import com.faboslav.friendsandfoes.common.client.render.entity.model.GlareEntityModel; import com.faboslav.friendsandfoes.common.entity.GlareEntity; @@ -23,7 +23,7 @@ public GlareEntityRenderer(EntityRendererFactory.Context context) { @Override protected void scale(GlareEntity glare, MatrixStack matrixStack, float amount) { - if (glare.isBaby() == false) { + if (!glare.isBaby()) { matrixStack.scale(0.8F, 0.8F, 0.8F); } else { matrixStack.scale(0.4F, 0.4F, 0.4F); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerEntityRenderer.java index 7cea18e6b..703d61a7c 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerEntityRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.render.VertexConsumerProvider; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerIceChunkRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerIceChunkRenderer.java index c041d7932..ee1394bd0 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerIceChunkRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/IceologerIceChunkRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.IceologerIceChunkModel; import com.faboslav.friendsandfoes.common.entity.IceologerIceChunkEntity; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityModelLayers; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/MaulerEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/MaulerEntityRenderer.java index eae37810c..56c6657c9 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/MaulerEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/MaulerEntityRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.MaulerEntityModel; import com.faboslav.friendsandfoes.common.entity.MaulerEntity; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityModelLayers; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/MoobloomEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/MoobloomEntityRenderer.java index a70f33631..89330c521 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/MoobloomEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/MoobloomEntityRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.feature.MoobloomFlowerFeatureRenderer; import com.faboslav.friendsandfoes.common.entity.MoobloomEntity; import net.fabricmc.api.EnvType; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/RascalEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/RascalEntityRenderer.java index e3cc407ca..9e2d22dfa 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/RascalEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/RascalEntityRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.RascalEntityModel; import com.faboslav.friendsandfoes.common.entity.RascalEntity; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityModelLayers; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/TuffGolemEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/TuffGolemEntityRenderer.java index 2dd01b43a..95fff2ee6 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/TuffGolemEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/TuffGolemEntityRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.feature.TuffGolemClosedEyesRenderer; import com.faboslav.friendsandfoes.common.client.render.entity.feature.TuffGolemClothFeatureRenderer; import com.faboslav.friendsandfoes.common.client.render.entity.feature.TuffGolemHeldItemFeatureRenderer; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/WildfireEntityRenderer.java b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/WildfireEntityRenderer.java index 2aa705abe..bf99f93bf 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/WildfireEntityRenderer.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/client/render/entity/renderer/WildfireEntityRenderer.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.client.render.entity.renderer; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.WildfireEntityModel; import com.faboslav.friendsandfoes.common.entity.WildfireEntity; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityModelLayers; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/config/FriendsAndFoesConfig.java b/common/src/main/java/com/faboslav/friendsandfoes/common/config/FriendsAndFoesConfig.java index 4db424c70..dd920c101 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/config/FriendsAndFoesConfig.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/config/FriendsAndFoesConfig.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.config; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.config.annotation.Category; import com.faboslav.friendsandfoes.common.config.annotation.Description; import com.faboslav.friendsandfoes.common.config.omegaconfig.api.Config; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/config/omegaconfig/OmegaConfig.java b/common/src/main/java/com/faboslav/friendsandfoes/common/config/omegaconfig/OmegaConfig.java index 8cd6d13a3..2b4993672 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/config/omegaconfig/OmegaConfig.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/config/omegaconfig/OmegaConfig.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.config.omegaconfig; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.config.annotation.Description; import com.faboslav.friendsandfoes.common.config.omegaconfig.api.Config; import com.faboslav.friendsandfoes.common.platform.ConfigDirectory; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/CopperGolemEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/CopperGolemEntity.java index 1bf7540d2..14f70acb5 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/CopperGolemEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/CopperGolemEntity.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.animation.CopperGolemAnimations; import com.faboslav.friendsandfoes.common.client.render.entity.animation.KeyframeAnimation; import com.faboslav.friendsandfoes.common.client.render.entity.animation.animator.context.AnimationContextTracker; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/CrabEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/CrabEntity.java index 4be9bbdad..60a681fb3 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/CrabEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/CrabEntity.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.block.CrabEggBlock; import com.faboslav.friendsandfoes.common.client.render.entity.animation.CrabAnimations; import com.faboslav.friendsandfoes.common.client.render.entity.animation.KeyframeAnimation; @@ -131,11 +131,7 @@ public boolean isPushedByFluids() { @Override public boolean hasNoDrag() { - if (this.isSwimming()) { - return true; - } else { - return false; - } + return this.isSwimming(); } @Override @@ -259,7 +255,7 @@ protected void playStepSound( @Override public void tick() { - if (this.getWorld().isClient() == false && FriendsAndFoes.getConfig().enableCrab == false) { + if (!this.getWorld().isClient() && !FriendsAndFoes.getConfig().enableCrab) { this.discard(); } @@ -326,7 +322,7 @@ public void tickMovement() { } private void updateKeyframeAnimations() { - if (this.getWorld().isClient() == false) { + if (!this.getWorld().isClient()) { this.updateKeyframeAnimationTicks(); } @@ -341,7 +337,7 @@ private void updateKeyframeAnimations() { private KeyframeAnimation getKeyframeAnimationByPose() { KeyframeAnimation keyframeAnimation = null; - if (this.isInPose(CrabEntityPose.IDLE) && this.isMoving() == false) { + if (this.isInPose(CrabEntityPose.IDLE) && !this.isMoving()) { keyframeAnimation = CrabAnimations.IDLE; } else if (this.isInPose(CrabEntityPose.WAVE)) { keyframeAnimation = CrabAnimations.WAVE; @@ -357,7 +353,7 @@ private void tryToStartKeyframeAnimation(KeyframeAnimation keyframeAnimationToSt return; } - if (this.getWorld().isClient() == false) { + if (!this.getWorld().isClient()) { this.setKeyframeAnimationTicks(keyframeAnimationToStart.getAnimationLengthInTicks()); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/GlareEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/GlareEntity.java index 8d457a6f9..47f85b696 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/GlareEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/GlareEntity.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.animation.animator.context.AnimationContextTracker; import com.faboslav.friendsandfoes.common.entity.ai.brain.GlareBrain; import com.faboslav.friendsandfoes.common.entity.ai.pathing.CachedPathHolder; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/IceologerEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/IceologerEntity.java index bc58bcc7d..20ba904f5 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/IceologerEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/IceologerEntity.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesSoundEvents; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; @@ -28,7 +28,7 @@ public final class IceologerEntity extends SpellcastingIllagerEntity public IceologerEntity(EntityType entityType, World world) { super(entityType, world); - if (FriendsAndFoes.getConfig().enableIceologer == false && this.getWorld().isClient() == false) { + if (!FriendsAndFoes.getConfig().enableIceologer && !this.getWorld().isClient()) { this.discard(); } @@ -77,7 +77,7 @@ public boolean isTeammate(Entity other) { @Override public void tick() { - if (FriendsAndFoes.getConfig().enableIceologer == false) { + if (!FriendsAndFoes.getConfig().enableIceologer) { this.discard(); } @@ -147,7 +147,7 @@ public final class SlowTargetGoal extends CastSpellGoal { @Override public boolean canStart() { - return super.canStart() != false + return super.canStart() && IceologerEntity.this.getTarget() != null; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/IceologerIceChunkEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/IceologerIceChunkEntity.java index 8a6978b76..4f4680b58 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/IceologerIceChunkEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/IceologerIceChunkEntity.java @@ -128,7 +128,7 @@ public void setOwnerUuid(@Nullable UUID uuid) { @Nullable public LivingEntity getOwner() { - if (this.owner == null && this.getOwnerUuid() != null && this.getWorld().isClient() == false) { + if (this.owner == null && this.getOwnerUuid() != null && !this.getWorld().isClient()) { Entity entity = ((ServerWorld) this.getWorld()).getEntity(this.getOwnerUuid()); if (entity instanceof LivingEntity) { this.owner = (LivingEntity) entity; @@ -149,7 +149,7 @@ public void setTargetUuid(@Nullable UUID uuid) { @Nullable public LivingEntity getTarget() { - if (this.target == null && this.getTargetUuid() != null && this.getWorld().isClient() == false) { + if (this.target == null && this.getTargetUuid() != null && !this.getWorld().isClient()) { Entity entity = ((ServerWorld) this.getWorld()).getEntity(this.getTargetUuid()); if (entity instanceof LivingEntity) { this.target = (LivingEntity) entity; @@ -172,7 +172,7 @@ public void tick() { this.lifetimeTicks++; this.setSummonAnimationProgress(); - if (this.getTarget() != null && this.getWorld().isClient() == false) { + if (this.getTarget() != null && !this.getWorld().isClient()) { if (this.getTarget().isPlayer()) { var playerTarget = (PlayerEntity) this.getTarget(); @@ -238,7 +238,7 @@ private void damage(LivingEntity hitEntity) { LivingEntity livingEntity = this.getOwner(); if ( - hitEntity.isAlive() == false + !hitEntity.isAlive() || hitEntity.isInvulnerable() || hitEntity == livingEntity || ( @@ -267,7 +267,7 @@ public void moveTowardsTarget() { if ( target == null - || target.isAlive() == false + || !target.isAlive() || target.getVelocity().lengthSquared() < 0.0001 ) { return; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/MaulerEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/MaulerEntity.java index aebe75456..4f5621008 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/MaulerEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/MaulerEntity.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.animation.animator.context.AnimationContextTracker; import com.faboslav.friendsandfoes.common.entity.ai.goal.mauler.*; import com.faboslav.friendsandfoes.common.entity.animation.AnimatedEntity; @@ -104,7 +104,7 @@ public MaulerEntity(EntityType entityType, World world) PREY_PREDICATE_FILTER = (entity) -> { if ( entity instanceof SlimeEntity slimeEntity && slimeEntity.getSize() != SlimeEntity.MIN_SIZE - || entity instanceof ZombieEntity && ((ZombieEntity) entity).isBaby() == false + || entity instanceof ZombieEntity && !((ZombieEntity) entity).isBaby() ) { return false; } @@ -184,7 +184,7 @@ public EntityData initialize( @Override public boolean canImmediatelyDespawn(double distanceSquared) { - return this.hasCustomName() == false; + return !this.hasCustomName(); } public static boolean canSpawn( @@ -212,7 +212,7 @@ protected void initGoals() { @Override public void tick() { - if (FriendsAndFoes.getConfig().enableMauler == false) { + if (!FriendsAndFoes.getConfig().enableMauler) { this.discard(); } @@ -220,7 +220,7 @@ public void tick() { super.tick(); - if (this.getWorld().isClient() == true) { + if (this.getWorld().isClient()) { return; } @@ -233,14 +233,14 @@ public void tick() { @Override public void tickMovement() { - if (this.getWorld().isClient() == false && this.getBurrowingDownAnimationProgress() > 0.0F) { + if (!this.getWorld().isClient() && this.getBurrowingDownAnimationProgress() > 0.0F) { this.getNavigation().setSpeed(0); this.getNavigation().stop(); } super.tickMovement(); - if (this.getWorld().isClient() == true) { + if (this.getWorld().isClient()) { return; } @@ -253,7 +253,7 @@ public boolean damage( DamageSource source, float amount ) { - if (this.getWorld().isClient() == false && this.burrowDownGoal.isRunning()) { + if (!this.getWorld().isClient() && this.burrowDownGoal.isRunning()) { this.burrowDownGoal.stop(); } @@ -273,7 +273,7 @@ public ActionResult interactMob(PlayerEntity player, Hand hand) { boolean interactionResult = false; if ( - this.hasAngerTime() == false + !this.hasAngerTime() && ( ( itemStack.hasEnchantments() @@ -282,7 +282,7 @@ public ActionResult interactMob(PlayerEntity player, Hand hand) { ) ) { interactionResult = this.tryToInteractWithEnhancedItem(player, hand, itemStack); - } else if (this.hasAngerTime() == false && itemInHand == Items.GLASS_BOTTLE) { + } else if (!this.hasAngerTime() && itemInHand == Items.GLASS_BOTTLE) { interactionResult = this.tryToInteractWithGlassBottle(player, itemStack); } @@ -314,7 +314,7 @@ private boolean tryToInteractWithEnhancedItem(PlayerEntity player, Hand hand, It this.setStoredExperiencePoints(recalculatedExperiencePoints); - if (player.getAbilities().creativeMode == false) { + if (!player.getAbilities().creativeMode) { if (itemStack.isStackable()) { itemStack.decrement(1); } else { @@ -382,7 +382,7 @@ public static Builder createMaulerAttributes() { @Override public boolean isPushable() { - return this.isBurrowedDown() == false && super.isPushable(); + return !this.isBurrowedDown() && super.isPushable(); } @Override diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/MoobloomEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/MoobloomEntity.java index 6a0f5b8fe..4060dac89 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/MoobloomEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/MoobloomEntity.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.api.MoobloomVariant; import com.faboslav.friendsandfoes.common.api.MoobloomVariantManager; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesBlocks; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/RascalEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/RascalEntity.java index 3168932d0..a9de8f4b2 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/RascalEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/RascalEntity.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.animation.KeyframeAnimation; import com.faboslav.friendsandfoes.common.client.render.entity.animation.RascalAnimations; import com.faboslav.friendsandfoes.common.client.render.entity.animation.animator.context.AnimationContextTracker; @@ -198,7 +198,7 @@ public static DefaultAttributeContainer.Builder createRascalAttributes() { @Override public void tick() { - if (FriendsAndFoes.getConfig().enableRascal == false) { + if (!FriendsAndFoes.getConfig().enableRascal) { this.discard(); } @@ -208,7 +208,7 @@ public void tick() { this.playReappearSound(); } - if (this.getWorld().isClient() == false) { + if (!this.getWorld().isClient()) { this.updateKeyframeAnimationTicks(); } @@ -225,7 +225,7 @@ public void tick() { private KeyframeAnimation getKeyframeAnimationByPose() { KeyframeAnimation keyframeAnimation = null; - if (this.isInPose(RascalEntityPose.IDLE) && this.isMoving() == false) { + if (this.isInPose(RascalEntityPose.IDLE) && !this.isMoving()) { keyframeAnimation = RascalAnimations.IDLE; } else if (this.isInPose(RascalEntityPose.NOD)) { keyframeAnimation = RascalAnimations.NOD; @@ -241,7 +241,7 @@ private void tryToStartKeyframeAnimation(KeyframeAnimation keyframeAnimationToSt return; } - if (this.getWorld().isClient() == false) { + if (!this.getWorld().isClient()) { this.setKeyframeAnimationTicks(keyframeAnimationToStart.getAnimationLengthInTicks()); } @@ -306,7 +306,7 @@ public boolean damage( Entity attacker = source.getAttacker(); if ( - attacker instanceof PlayerEntity == false + !(attacker instanceof PlayerEntity) || this.hasCustomName() ) { return super.damage(source, amount); @@ -352,7 +352,7 @@ protected SoundEvent getAmbientSound() { @Override public void playAmbientSound() { - if (this.isHidden() || this.ambientSounds == false) { + if (this.isHidden() || !this.ambientSounds) { return; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/TuffGolemEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/TuffGolemEntity.java index 1ea3294d3..ab0c60edc 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/TuffGolemEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/TuffGolemEntity.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.animation.KeyframeAnimation; import com.faboslav.friendsandfoes.common.client.render.entity.animation.TuffGolemAnimations; import com.faboslav.friendsandfoes.common.client.render.entity.animation.animator.context.AnimationContextTracker; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/WildfireEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/WildfireEntity.java index 530269e7c..beff3f1ea 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/WildfireEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/WildfireEntity.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.ai.brain.WildfireBrain; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesSoundEvents; import com.faboslav.friendsandfoes.common.tag.FriendsAndFoesTags; @@ -236,7 +236,7 @@ public void playSummonBlazeSound() { @Override public void tick() { - if (FriendsAndFoes.getConfig().enableWildfire == false) { + if (!FriendsAndFoes.getConfig().enableWildfire) { this.discard(); } @@ -252,7 +252,7 @@ public void tick() { @Override public void tickMovement() { - if (this.isOnGround() == false && this.getVelocity().y < 0.0F) { + if (!this.isOnGround() && this.getVelocity().y < 0.0F) { this.setVelocity(this.getVelocity().multiply(1.0F, 0.6F, 1.0F)); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/WildfireShieldDebrisEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/WildfireShieldDebrisEntity.java index 0d8dd08c3..289dc9aeb 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/WildfireShieldDebrisEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/WildfireShieldDebrisEntity.java @@ -67,7 +67,7 @@ protected void onBlockHit(BlockHitResult blockHitResult) { Entity entity = this.getOwner(); if ( - (entity instanceof MobEntity) == false + !(entity instanceof MobEntity) || this.getWorld().getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING) ) { BlockPos blockPos = blockHitResult.getBlockPos().offset(blockHitResult.getSide()); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/GlareBrain.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/GlareBrain.java index 1be34e37b..f106d0828 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/GlareBrain.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/GlareBrain.java @@ -150,7 +150,7 @@ private static void addIdleActivities(Brain brain) { private static Optional getOwner(GlareEntity glare) { if ( - glare.isTamed() == false + !glare.isTamed() || glare.getOwner() == null ) { return Optional.empty(); @@ -173,8 +173,8 @@ public static void updateActivities(GlareEntity glare) { public static void updateMemories(GlareEntity glare) { if ( ( - (glare.isBaby() == false && glare.isTamed() == false) - || GlareLocateDarkSpotTask.canLocateDarkSpot(glare) == false + (!glare.isBaby() && !glare.isTamed()) + || !GlareLocateDarkSpotTask.canLocateDarkSpot(glare) ) && glare.getBrain().isMemoryInState(FriendsAndFoesMemoryModuleTypes.GLARE_DARK_SPOT_LOCATING_COOLDOWN.get(), MemoryModuleState.VALUE_ABSENT) ) { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/RascalBrain.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/RascalBrain.java index a01787ec0..8b0eaeef9 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/RascalBrain.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/RascalBrain.java @@ -123,7 +123,7 @@ public static boolean shouldRunAway(RascalEntity rascal) { } public static void onCooldown(RascalEntity rascal) { - if (shouldRunAway(rascal) == false) { + if (!shouldRunAway(rascal)) { return; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/WildfireBrain.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/WildfireBrain.java index 0c7673360..18123438a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/WildfireBrain.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/WildfireBrain.java @@ -147,7 +147,7 @@ public static boolean shouldRunAway(WildfireEntity wildfire) { } public static void onCooldown(WildfireEntity wildfire) { - if (shouldRunAway(wildfire) == false) { + if (!shouldRunAway(wildfire)) { return; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/sensor/CopperGolemSpecificSensor.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/sensor/CopperGolemSpecificSensor.java index be0e9a7e7..36e472ffe 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/sensor/CopperGolemSpecificSensor.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/sensor/CopperGolemSpecificSensor.java @@ -56,7 +56,7 @@ protected void sense(ServerWorld world, CopperGolemEntity copperGolem) { List players = world.getPlayers().stream().filter(NOTICEABLE_PLAYER_FILTER).filter(player -> copperGolem.isInRange(player, 16.0)).sorted(Comparator.comparingDouble(copperGolem::squaredDistanceTo)).toList(); - if (players.isEmpty() || copperGolem.isWaxed() == false) { + if (players.isEmpty() || !copperGolem.isWaxed()) { return; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/coppergolem/CopperGolemLocateButtonTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/coppergolem/CopperGolemLocateButtonTask.java index 89a1f42d6..9d24b9822 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/coppergolem/CopperGolemLocateButtonTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/coppergolem/CopperGolemLocateButtonTask.java @@ -66,7 +66,7 @@ private List findAllButtonsInRange( for (BlockPos blockPos : BlockPos.iterateOutwards(copperGolemPos, horizontalRange, verticalRange, horizontalRange)) { BlockPos possibleButtonBlockPos = blockPos.mutableCopy(); - if (condition.test(possibleButtonBlockPos) == false) { + if (!condition.test(possibleButtonBlockPos)) { continue; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/coppergolem/CopperGolemSpinHeadTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/coppergolem/CopperGolemSpinHeadTask.java index 30e064bf2..5da748926 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/coppergolem/CopperGolemSpinHeadTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/coppergolem/CopperGolemSpinHeadTask.java @@ -25,11 +25,7 @@ public CopperGolemSpinHeadTask() { @Override protected boolean shouldRun(ServerWorld world, CopperGolemEntity copperGolem) { - if (copperGolem.getRandom().nextFloat() < 0.9) { - return false; - } - - return true; + return !(copperGolem.getRandom().nextFloat() < 0.9); } @Override @@ -41,14 +37,8 @@ protected void run(ServerWorld world, CopperGolemEntity copperGolem, long time) @Override protected boolean shouldKeepRunning(ServerWorld world, CopperGolemEntity copperGolem, long time) { - if ( - this.spinHeadTicks > this.maxSpinHeadTicks - || copperGolem.isOxidized() - ) { - return false; - } - - return true; + return this.spinHeadTicks <= this.maxSpinHeadTicks + && !copperGolem.isOxidized(); } protected void keepRunning(ServerWorld world, CopperGolemEntity copperGolem, long time) { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabDanceTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabDanceTask.java index 0cf500c71..bad7305dc 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabDanceTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabDanceTask.java @@ -29,14 +29,8 @@ public CrabDanceTask() { @Override protected boolean shouldRun(ServerWorld world, CrabEntity crab) { - if ( - crab.isClimbing() - || !crab.isDancing() - ) { - return false; - } - - return true; + return !crab.isClimbing() + && crab.isDancing(); } @Override @@ -60,14 +54,8 @@ protected void run(ServerWorld world, CrabEntity crab, long time) { @Override protected boolean shouldKeepRunning(ServerWorld world, CrabEntity crab, long time) { - if ( - crab.isClimbing() - || !crab.isDancing() - ) { - return false; - } - - return true; + return !crab.isClimbing() + && crab.isDancing(); } @Override diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabGoToHomePositionTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabGoToHomePositionTask.java index 97c734fcf..916c68e6d 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabGoToHomePositionTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabGoToHomePositionTask.java @@ -27,15 +27,9 @@ protected boolean shouldRun( ServerWorld world, CrabEntity crab ) { - if ( - crab.isCloseToHomePos(3.0F) - || crab.isLeashed() - || crab.hasVehicle() - ) { - return false; - } - - return true; + return !crab.isCloseToHomePos(3.0F) + && !crab.isLeashed() + && !crab.hasVehicle(); } @Override diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabLocateBurrowSpotTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabLocateBurrowSpotTask.java index c21617b02..e3b253f48 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabLocateBurrowSpotTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabLocateBurrowSpotTask.java @@ -28,11 +28,7 @@ protected boolean shouldRun( ServerWorld world, CrabEntity crab ) { - if (!crab.isCloseToHomePos(6.0F)) { - return false; - } - - return true; + return crab.isCloseToHomePos(6.0F); } @Override diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabWaveTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabWaveTask.java index 2044fb24f..96a40ca96 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabWaveTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/crab/CrabWaveTask.java @@ -77,11 +77,7 @@ protected void run(ServerWorld world, CrabEntity crab, long time) { @Override protected boolean shouldKeepRunning(ServerWorld world, CrabEntity crab, long time) { - if (this.waveTicks > this.maxWaveTicks) { - return false; - } - - return true; + return this.waveTicks <= this.maxWaveTicks; } protected void keepRunning(ServerWorld world, CrabEntity crab, long time) { diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareLocateDarkSpotTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareLocateDarkSpotTask.java index a26042ffe..c43ba4059 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareLocateDarkSpotTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareLocateDarkSpotTask.java @@ -96,20 +96,12 @@ private BlockPos findRandomDarkSpot(GlareEntity glare) { } public static boolean canLocateDarkSpot(GlareEntity glare) { - if ( - glare.isLeashed() - || glare.isSitting() - || glare.hasVehicle() - || glare.isTamed() == false - || glare.isBaby() - || ( - glare.getWorld().isDay() - && glare.getWorld().isSkyVisible(glare.getBlockPos()) - ) - ) { - return false; - } - - return true; + return !glare.isLeashed() + && !glare.isSitting() + && !glare.hasVehicle() + && glare.isTamed() + && !glare.isBaby() + && (!glare.getWorld().isDay() + || !glare.getWorld().isSkyVisible(glare.getBlockPos())); } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareLocateGlowBerriesTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareLocateGlowBerriesTask.java index 1eb702b26..e98b41371 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareLocateGlowBerriesTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareLocateGlowBerriesTask.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity.ai.brain.task.glare; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.GlareEntity; import com.faboslav.friendsandfoes.common.entity.ai.brain.GlareBrain; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesMemoryModuleTypes; @@ -32,11 +32,11 @@ public GlareLocateGlowBerriesTask() { @Override protected boolean shouldRun(ServerWorld world, GlareEntity glare) { - return FriendsAndFoes.getConfig().enableGlareGriefing != false + return FriendsAndFoes.getConfig().enableGlareGriefing && !glare.isLeashed() && !glare.isSitting() && !glare.hasVehicle() - && glare.getEquippedStack(EquipmentSlot.MAINHAND).isEmpty() != false; + && glare.getEquippedStack(EquipmentSlot.MAINHAND).isEmpty(); } @Override @@ -79,7 +79,7 @@ private List findAllGlowBerriesInRange( for (BlockPos blockPos : BlockPos.iterateOutwards(glarePos, horizontalRange, verticalRange, horizontalRange)) { BlockPos possibleGlowBerriesBlockPos = blockPos.mutableCopy(); - if (condition.test(possibleGlowBerriesBlockPos) == false) { + if (!condition.test(possibleGlowBerriesBlockPos)) { continue; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareShakeGlowBerriesTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareShakeGlowBerriesTask.java index 95e98ae7f..94462fff4 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareShakeGlowBerriesTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareShakeGlowBerriesTask.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity.ai.brain.task.glare; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.GlareEntity; import com.faboslav.friendsandfoes.common.entity.ai.brain.GlareBrain; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesMemoryModuleTypes; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareTeleportToOwnerTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareTeleportToOwnerTask.java index 0445f74b4..cbca47395 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareTeleportToOwnerTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareTeleportToOwnerTask.java @@ -19,18 +19,12 @@ public GlareTeleportToOwnerTask() { protected boolean shouldRun(ServerWorld world, GlareEntity glare) { LivingEntity owner = glare.getOwner(); - if ( - owner == null - || owner.isSpectator() - || glare.isLeashed() - || glare.isSitting() - || glare.hasVehicle() - || glare.squaredDistanceTo(owner) < 1024.0D - ) { - return false; - } - - return true; + return owner != null + && !owner.isSpectator() + && !glare.isLeashed() + && !glare.isSitting() + && !glare.hasVehicle() + && !(glare.squaredDistanceTo(owner) < 1024.0D); } @Override diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareTravelToGlowBerriesTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareTravelToGlowBerriesTask.java index 246dc7956..b2145c016 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareTravelToGlowBerriesTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/glare/GlareTravelToGlowBerriesTask.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity.ai.brain.task.glare; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.GlareEntity; import com.faboslav.friendsandfoes.common.entity.ai.brain.GlareBrain; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesMemoryModuleTypes; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/rascal/RascalWaitForPlayerTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/rascal/RascalWaitForPlayerTask.java index e7bc20551..b1d7dcbb4 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/rascal/RascalWaitForPlayerTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/rascal/RascalWaitForPlayerTask.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity.ai.brain.task.rascal; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.RascalEntity; import com.faboslav.friendsandfoes.common.entity.ai.brain.RascalBrain; import com.faboslav.friendsandfoes.common.entity.pose.RascalEntityPose; @@ -65,7 +65,7 @@ protected boolean shouldRun(ServerWorld world, RascalEntity rascal) { if ( nearestTarget == null || rascal.distanceTo(nearestTarget) > NOD_RANGE - || nearestTarget.isAlive() == false + || !nearestTarget.isAlive() || ( nearestTarget instanceof PlayerEntity && ( @@ -181,10 +181,10 @@ private void tryToTeleport(ServerWorld world, RascalEntity rascal) { double y = MathHelper.clamp(rascal.getY() + (double) (rascal.getRandom().nextInt(8) - 4), world.getBottomY(), world.getBottomY() + world.getLogicalHeight() - 1); double z = rascal.getZ() + (rascal.getRandom().nextDouble() - 0.5) * 16.0; - if (structureAccessor.getStructureContaining( + if (!structureAccessor.getStructureContaining( new BlockPos((int) x, (int) y, (int) z), StructureTags.MINESHAFT - ).hasChildren() == false) { + ).hasChildren()) { continue; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/tuffgolem/TuffGolemGoToHomePositionTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/tuffgolem/TuffGolemGoToHomePositionTask.java index b999afece..85f479e96 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/tuffgolem/TuffGolemGoToHomePositionTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/tuffgolem/TuffGolemGoToHomePositionTask.java @@ -69,7 +69,7 @@ protected void keepRunning( } if ( - tuffGolem.isCloseToHomePos(2.0F) == false + !tuffGolem.isCloseToHomePos(2.0F) || Math.abs((int) tuffGolem.getY() - (int) tuffGolem.getHomePos().getY()) > 1 ) { return; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireBarrageAttackTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireBarrageAttackTask.java index 49092580f..2d137b74e 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireBarrageAttackTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireBarrageAttackTask.java @@ -39,7 +39,7 @@ protected boolean shouldRun(ServerWorld world, WildfireEntity wildfire) { if ( attackTarget == null - || attackTarget.isAlive() == false + || !attackTarget.isAlive() || ( attackTarget instanceof PlayerEntity && ( @@ -73,14 +73,14 @@ protected void run(ServerWorld world, WildfireEntity wildfire, long time) { @Override protected boolean shouldKeepRunning(ServerWorld world, WildfireEntity wildfire, long time) { - if (attackTarget.isAlive() == false) { + if (!attackTarget.isAlive()) { attackTarget = wildfire.getBrain().getOptionalRegisteredMemory(MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER).orElse(null); } if ( attackTarget == null - || attackTarget.isAlive() == false - || attackTarget.isAlive() == false + || !attackTarget.isAlive() + || !attackTarget.isAlive() || ( attackTarget instanceof PlayerEntity && ( @@ -141,7 +141,7 @@ protected void keepRunning(ServerWorld world, WildfireEntity wildfire, long time double distanceToAttackTarget = wildfire.squaredDistanceTo(this.attackTarget); double h = Math.sqrt(Math.sqrt(distanceToAttackTarget)) * 0.5; - if (wildfire.isSilent() == false) { + if (!wildfire.isSilent()) { wildfire.playShootSound(); wildfire.getWorld().syncWorldEvent(null, 1018, wildfire.getBlockPos(), 0); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireShockwaveAttackTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireShockwaveAttackTask.java index 28cff6353..b67732eff 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireShockwaveAttackTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireShockwaveAttackTask.java @@ -46,7 +46,7 @@ protected boolean shouldRun(ServerWorld world, WildfireEntity wildfire) { if ( nearestTarget == null || wildfire.distanceTo(nearestTarget) > SHOCKWAVE_ATTACK_RANGE - || nearestTarget.isAlive() == false + || !nearestTarget.isAlive() || ( nearestTarget instanceof PlayerEntity && ( diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireSummonBlazeTask.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireSummonBlazeTask.java index 6c3bd3acc..2a1adce78 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireSummonBlazeTask.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/ai/brain/task/wildfire/WildfireSummonBlazeTask.java @@ -39,7 +39,7 @@ protected boolean shouldRun(ServerWorld world, WildfireEntity wildfire) { if ( attackTarget == null - || attackTarget.isAlive() == false + || !attackTarget.isAlive() || ( attackTarget instanceof PlayerEntity && ( diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/animation/AnimatedEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/animation/AnimatedEntity.java index 905161c72..75e46d519 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/animation/AnimatedEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/animation/AnimatedEntity.java @@ -37,7 +37,7 @@ default void setKeyframeAnimationTicks(int keyframeAnimationTicks) { } default void updateKeyframeAnimationTicks() { - if (this.isAnyKeyframeAnimationRunning() == false) { + if (!this.isAnyKeyframeAnimationRunning()) { return; } @@ -48,12 +48,12 @@ default void updateKeyframeAnimationTicks() { } for (KeyframeAnimation keyframeAnimation : this.getAnimations()) { - if (keyframeAnimation.getAnimation().looping() == false) { + if (!keyframeAnimation.getAnimation().looping()) { continue; } var keyframeAnimationContext = this.getAnimationContextTracker().get(keyframeAnimation); - if (keyframeAnimationContext.isRunning() == false) { + if (!keyframeAnimationContext.isRunning()) { continue; } @@ -87,7 +87,7 @@ default void forceStartKeyframeAnimation(KeyframeAnimation keyframeAnimation, in default void stopRunningKeyframeAnimations() { for (KeyframeAnimation keyframeAnimation : this.getAnimations()) { - if (this.getAnimationContextTracker().get(keyframeAnimation).isRunning() == false) { + if (!this.getAnimationContextTracker().get(keyframeAnimation).isRunning()) { this.stopKeyframeAnimation(keyframeAnimation); } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/effect/ReachStatusEffect.java b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/effect/ReachStatusEffect.java index 8457ac2c7..10d8fe5de 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/entity/effect/ReachStatusEffect.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/entity/effect/ReachStatusEffect.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.entity.effect; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import net.minecraft.entity.attribute.EntityAttributeModifier; import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.effect.StatusEffect; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesActivities.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesActivities.java index 09ec303f3..0cb12f0b9 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesActivities.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesActivities.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesArmorMaterials.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesArmorMaterials.java index 1441c6166..ea4c16724 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesArmorMaterials.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesArmorMaterials.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.registry.ReferenceRegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesBlockSetTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesBlockSetTypes.java index d86b8dcc5..3eb6aaa72 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesBlockSetTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesBlockSetTypes.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.events.block.RegisterBlockSetTypeEvent; import net.minecraft.block.BlockSetType; import net.minecraft.sound.BlockSoundGroup; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesBlocks.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesBlocks.java index 4bb724db5..4e10cbc43 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesBlocks.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesBlocks.java @@ -1,6 +1,7 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.block.Oxidizable; import com.faboslav.friendsandfoes.common.block.CopperButtonBlock; import com.faboslav.friendsandfoes.common.block.CrabEggBlock; import com.faboslav.friendsandfoes.common.block.OxidizableButtonBlock; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesCriterias.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesCriterias.java index 56f40c4ca..6d463dec6 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesCriterias.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesCriterias.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.advancements.criterion.CompleteHideAndSeekGameCriterion; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityModelLayers.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityModelLayers.java index 8cac78fad..da81bdeb6 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityModelLayers.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityModelLayers.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.model.*; import com.faboslav.friendsandfoes.common.events.client.RegisterEntityLayersEvent; import net.fabricmc.api.EnvType; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityTypes.java index b6ea362f3..8338791d7 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesEntityTypes.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.renderer.WildfireEntityRenderer; import com.faboslav.friendsandfoes.common.entity.*; import com.faboslav.friendsandfoes.common.events.lifecycle.AddSpawnBiomeModificationsEvent; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItemGroups.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItemGroups.java index b6e86a9cf..86bffbe2b 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItemGroups.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItemGroups.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.events.AddItemGroupEntriesEvent; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItems.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItems.java index 40967bfe6..986f8109c 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItems.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesItems.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesMemoryModuleTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesMemoryModuleTypes.java index cc4b1b7fd..b6d43b3b9 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesMemoryModuleTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesMemoryModuleTypes.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesParticleTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesParticleTypes.java index 0129653a9..e72db1920 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesParticleTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesParticleTypes.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.particle.FreezingTotemParticle; import com.faboslav.friendsandfoes.common.client.particle.IllusionTotemParticle; import com.faboslav.friendsandfoes.common.events.client.RegisterParticlesEvent; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPointOfInterestTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPointOfInterestTypes.java index ce1cd2e35..1b1ceeab7 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPointOfInterestTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPointOfInterestTypes.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; import net.minecraft.registry.Registries; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPotions.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPotions.java index 1c51f5ff2..d7e323a92 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPotions.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesPotions.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.registry.ReferenceRegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesSensorTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesSensorTypes.java index d146cb27c..ad38edd82 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesSensorTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesSensorTypes.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.ai.brain.CopperGolemBrain; import com.faboslav.friendsandfoes.common.entity.ai.brain.CrabBrain; import com.faboslav.friendsandfoes.common.entity.ai.brain.GlareBrain; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesSoundEvents.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesSoundEvents.java index 7838d569f..768ef99ca 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesSoundEvents.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesSoundEvents.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStatusEffects.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStatusEffects.java index eaaf365bb..a40b1996a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStatusEffects.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStatusEffects.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.effect.ReachStatusEffect; import com.faboslav.friendsandfoes.common.init.registry.ReferenceRegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructurePoolElements.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructurePoolElements.java index 901ad3e84..f44e6cde1 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructurePoolElements.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructurePoolElements.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.util.StructurePoolHelper; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKeys; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructureProcessorTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructureProcessorTypes.java index 30cc774f6..126918f5f 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructureProcessorTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructureProcessorTypes.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructureTypes.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructureTypes.java index 3aee1d588..2ad2e9e96 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructureTypes.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesStructureTypes.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesVillagerProfessions.java b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesVillagerProfessions.java index 0556a818b..9dbb6d8f2 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesVillagerProfessions.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/init/FriendsAndFoesVillagerProfessions.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.events.entity.RegisterVillagerTradesEvent; import com.faboslav.friendsandfoes.common.init.registry.RegistryEntry; import com.faboslav.friendsandfoes.common.init.registry.ResourcefulRegistries; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/AddCustomRaidMemberMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/AddCustomRaidMemberMixin.java index 440559bb8..66c09f4de 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/AddCustomRaidMemberMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/AddCustomRaidMemberMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityTypes; import com.faboslav.friendsandfoes.common.util.CustomRaidMember; import net.minecraft.entity.EntityType; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/AxeItemMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/AxeItemMixin.java index eebd41c51..1dc548d5b 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/AxeItemMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/AxeItemMixin.java @@ -1,7 +1,7 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.block.Oxidizable; +import com.faboslav.friendsandfoes.common.block.Oxidizable; import com.faboslav.friendsandfoes.common.util.WaxableBlocksMap; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/CarvedPumpkinBlockMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/CarvedPumpkinBlockMixin.java index 1db8815a7..774630d0f 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/CarvedPumpkinBlockMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/CarvedPumpkinBlockMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.TuffGolemEntity; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityTypes; import com.faboslav.friendsandfoes.common.util.CopperGolemBuildPatternPredicates; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityMixin.java index 768ddc605..c4b270efd 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.IllusionerEntityAccess; import com.llamalad7.mixinextras.injector.WrapWithCondition; import net.minecraft.entity.Entity; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityRendererMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityRendererMixin.java index 63401c181..61bc717cc 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityRendererMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IllusionerEntityRendererMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.render.VertexConsumerProvider; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IntegratedServerLoaderMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IntegratedServerLoaderMixin.java new file mode 100644 index 000000000..fb5c57ea4 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/IntegratedServerLoaderMixin.java @@ -0,0 +1,36 @@ +package com.faboslav.friendsandfoes.common.mixin; + +import com.mojang.serialization.Lifecycle; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.world.CreateWorldScreen; +import net.minecraft.server.integrated.IntegratedServerLoader; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Environment(EnvType.CLIENT) +@Mixin(IntegratedServerLoader.class) +public abstract class IntegratedServerLoaderMixin +{ + @Inject( + method = "tryLoad", + at = @At("HEAD"), + cancellable = true + ) + private static void alwaysTreatAsStable( + MinecraftClient client, + CreateWorldScreen parent, + Lifecycle lifecycle, + Runnable loader, + boolean bypassWarnings, + CallbackInfo ci + ) { + if (lifecycle != Lifecycle.stable()) { + loader.run(); + ci.cancel(); + } + } +} diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/LightningRodBlockDegradableMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/LightningRodBlockDegradableMixin.java index 5406f3747..371934710 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/LightningRodBlockDegradableMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/LightningRodBlockDegradableMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.block.Oxidizable; +import com.faboslav.friendsandfoes.common.block.Oxidizable; import net.minecraft.block.Degradable; import net.minecraft.block.LightningRodBlock; import org.spongepowered.asm.mixin.Mixin; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/LightningRodBlockMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/LightningRodBlockMixin.java index 13f00f9fe..56cdc5866 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/LightningRodBlockMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/LightningRodBlockMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.client.render.entity.animation.KeyframeAnimation; import com.faboslav.friendsandfoes.common.entity.CopperGolemEntity; import com.faboslav.friendsandfoes.common.entity.ai.brain.CopperGolemBrain; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/PlayerEntityMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/PlayerEntityMixin.java index a8781ebdd..dfd65a153 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/PlayerEntityMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/PlayerEntityMixin.java @@ -120,10 +120,10 @@ public void friendsandfoes_tryUseTotems(DamageSource source, float amount, Callb if ( player.isAlive() - && source.isOf(DamageTypes.IN_FIRE) == false - && source.isOf(DamageTypes.ON_FIRE) == false - && source.isOf(DamageTypes.FALL) == false - && source.isOf(DamageTypes.FALLING_BLOCK) == false + && !source.isOf(DamageTypes.IN_FIRE) + && !source.isOf(DamageTypes.ON_FIRE) + && !source.isOf(DamageTypes.FALL) + && !source.isOf(DamageTypes.FALLING_BLOCK) && source.getAttacker() != null && !player.isDead() && this.getHealth() <= this.getMaxHealth() / 2.0F diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/RaidMemberMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/RaidMemberMixin.java index e55cdc6a5..f950fe566 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/RaidMemberMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/RaidMemberMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import net.minecraft.village.raid.Raid; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/RaidMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/RaidMixin.java index d6b9819b1..8006ab1d6 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/RaidMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/RaidMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.IceologerEntity; import net.minecraft.entity.mob.IllusionerEntity; import net.minecraft.entity.raid.RaiderEntity; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/ServerWorldMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/ServerWorldMixin.java index 4bf5f2161..e62ae3959 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/ServerWorldMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/ServerWorldMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.ZombieHorseEntityAccess; import com.faboslav.friendsandfoes.common.tag.FriendsAndFoesTags; import net.minecraft.entity.EntityType; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/StrongholdGeneratorMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/StrongholdGeneratorMixin.java index bf5038f3e..1c6b870cb 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/StrongholdGeneratorMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/StrongholdGeneratorMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.entity.TuffGolemEntity; import com.faboslav.friendsandfoes.common.entity.pose.TuffGolemEntityPose; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityTypes; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/VillagerEntityMixin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/VillagerEntityMixin.java index bc95304cc..d267d8f7b 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/VillagerEntityMixin.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/VillagerEntityMixin.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.mixin; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesVillagerProfessions; import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.village.VillagerData; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/plugin/FriendsAndFoesMixinPlugin.java b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/plugin/FriendsAndFoesMixinPlugin.java new file mode 100644 index 000000000..45dde3251 --- /dev/null +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/mixin/plugin/FriendsAndFoesMixinPlugin.java @@ -0,0 +1,51 @@ +package com.faboslav.friendsandfoes.common.mixin.plugin; + +import org.objectweb.asm.tree.ClassNode; +import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinInfo; + +import java.util.List; +import java.util.Set; + +public class FriendsAndFoesMixinPlugin implements IMixinConfigPlugin +{ + @Override + public void onLoad(String mixinPackage) { + } + + @Override + public String getRefMapperConfig() { + return null; + } + + @Override + public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { + if (mixinClassName.equals("com.faboslav.friendsandfoes.common.mixin.IntegratedServerLoaderMixin")) { + return this.isClassAvailable("me.earth.mc_runtime_test.McRuntimeTest"); + } + + return true; + } + + @Override + public void acceptTargets(Set myTargets, Set otherTargets) { + } + + @Override + public List getMixins() { + return null; + } + + @Override + public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } + + @Override + public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } + + private boolean isClassAvailable(String className) { + String classPath = className.replace('.', '/') + ".class"; + return getClass().getClassLoader().getResource(classPath) != null; + } +} \ No newline at end of file diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/modcompat/ModChecker.java b/common/src/main/java/com/faboslav/friendsandfoes/common/modcompat/ModChecker.java index e86bb0425..5a154fa9e 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/modcompat/ModChecker.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/modcompat/ModChecker.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.modcompat; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.platform.Platform; import dev.architectury.injectables.annotations.ExpectPlatform; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/MessageHandler.java b/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/MessageHandler.java index a23181a81..b0cfab855 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/MessageHandler.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/MessageHandler.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.network.packet; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.network.Network; /** diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/MoobloomVariantsSyncPacket.java b/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/MoobloomVariantsSyncPacket.java index 2cccc8885..998499743 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/MoobloomVariantsSyncPacket.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/MoobloomVariantsSyncPacket.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.network.packet; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.api.MoobloomVariant; import com.faboslav.friendsandfoes.common.api.MoobloomVariantManager; import com.faboslav.friendsandfoes.common.events.lifecycle.DatapackSyncEvent; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/TotemEffectPacket.java b/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/TotemEffectPacket.java index 59eead1f7..3c1e4eaeb 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/TotemEffectPacket.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/network/packet/TotemEffectPacket.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.network.packet; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesItems; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesParticleTypes; import com.faboslav.friendsandfoes.common.network.Packet; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/tag/FriendsAndFoesTags.java b/common/src/main/java/com/faboslav/friendsandfoes/common/tag/FriendsAndFoesTags.java index 051d1be40..496c9f083 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/tag/FriendsAndFoesTags.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/tag/FriendsAndFoesTags.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.tag; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import net.minecraft.block.Block; import net.minecraft.entity.EntityType; import net.minecraft.item.Item; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/util/StructurePoolHelper.java b/common/src/main/java/com/faboslav/friendsandfoes/common/util/StructurePoolHelper.java index 4ffc44ebd..a344a2494 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/util/StructurePoolHelper.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/util/StructurePoolHelper.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.util; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.mixin.StructurePoolAccessor; import com.mojang.datafixers.util.Pair; import net.minecraft.registry.Registry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/util/UpdateChecker.java b/common/src/main/java/com/faboslav/friendsandfoes/common/util/UpdateChecker.java index 10f80021a..c0558eadd 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/util/UpdateChecker.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/util/UpdateChecker.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.util; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.platform.ModVersion; import com.faboslav.friendsandfoes.common.platform.Platform; import com.faboslav.friendsandfoes.common.platform.ProjectUrlProvider; @@ -29,7 +29,7 @@ public final class UpdateChecker public static void checkForNewUpdatesInGame(ClientPlayerEntity clientPlayerEntity) { CompletableFuture.runAsync(() -> { - if (FriendsAndFoes.getConfig().checkForNewUpdates == false) { + if (!FriendsAndFoes.getConfig().checkForNewUpdates) { return; } @@ -69,7 +69,7 @@ public static void checkForNewUpdatesInGame(ClientPlayerEntity clientPlayerEntit public static void checkForNewUpdates() { CompletableFuture.runAsync(() -> { - if (FriendsAndFoes.getConfig().checkForNewUpdates == false) { + if (!FriendsAndFoes.getConfig().checkForNewUpdates) { return; } @@ -139,7 +139,7 @@ public static Version getLatestVersion() { String gameVersion = SharedConstants.getGameVersion().getName(); - if (releases.containsKey(gameVersion) == false) { + if (!releases.containsKey(gameVersion)) { return null; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/util/world/processor/IceologerCabinArmorStandProcessorHelper.java b/common/src/main/java/com/faboslav/friendsandfoes/common/util/world/processor/IceologerCabinArmorStandProcessorHelper.java index ca88304f7..e5e332e8c 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/util/world/processor/IceologerCabinArmorStandProcessorHelper.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/util/world/processor/IceologerCabinArmorStandProcessorHelper.java @@ -18,7 +18,7 @@ public static StructureEntityInfo processEntity( StructureEntityInfo globalEntityInfo, StructurePlacementData structurePlacementData ) { - if (globalEntityInfo.nbt.getString("id").equals("minecraft:armor_stand") == false) { + if (!globalEntityInfo.nbt.getString("id").equals("minecraft:armor_stand")) { return globalEntityInfo; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/util/world/processor/IllusionerShackItemFrameProcessorHelper.java b/common/src/main/java/com/faboslav/friendsandfoes/common/util/world/processor/IllusionerShackItemFrameProcessorHelper.java index f02696536..03d02693a 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/util/world/processor/IllusionerShackItemFrameProcessorHelper.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/util/world/processor/IllusionerShackItemFrameProcessorHelper.java @@ -18,7 +18,7 @@ public static StructureEntityInfo processEntity( StructureEntityInfo globalEntityInfo, StructurePlacementData structurePlacementData ) { - if (globalEntityInfo.nbt.getString("id").equals("minecraft:item_frame") == false) { + if (!globalEntityInfo.nbt.getString("id").equals("minecraft:item_frame")) { return globalEntityInfo; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/CitadelBottomProcessor.java b/common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/CitadelBottomProcessor.java index 4d408e0fb..22c2c1edc 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/CitadelBottomProcessor.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/world/processor/CitadelBottomProcessor.java @@ -61,7 +61,7 @@ public StructureTemplate.StructureBlockInfo process( if (blockInfoGlobal.state().isOf(this.targetBlock.getBlock())) { if ( worldView instanceof ChunkRegion chunkRegion - && chunkRegion.getCenterPos().equals(new ChunkPos(blockInfoGlobal.pos())) == false + && !chunkRegion.getCenterPos().equals(new ChunkPos(blockInfoGlobal.pos())) ) { return blockInfoGlobal; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/world/spawner/IceologerSpawner.java b/common/src/main/java/com/faboslav/friendsandfoes/common/world/spawner/IceologerSpawner.java index 39493296d..abbc4bff7 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/world/spawner/IceologerSpawner.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/world/spawner/IceologerSpawner.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.world.spawner; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesEntityTypes; import com.faboslav.friendsandfoes.common.tag.FriendsAndFoesTags; import net.minecraft.block.BlockState; @@ -24,8 +24,8 @@ public IceologerSpawner() { @Override public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) { if ( - spawnMonsters == false - || FriendsAndFoes.getConfig().enableIceologerSpawn == false + !spawnMonsters + || !FriendsAndFoes.getConfig().enableIceologerSpawn ) { return 0; } @@ -42,7 +42,7 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) if ( l < 5L - || world.isDay() == false + || !world.isDay() || random.nextBetween(0, 1) != 0 ) { return 0; @@ -71,11 +71,11 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) var maxX = mutable.getX() + 10; var maxZ = mutable.getZ() + 10; - if (world.isRegionLoaded(minX, minZ, maxX, maxZ) == false) { + if (!world.isRegionLoaded(minX, minZ, maxX, maxZ)) { return 0; } - if (world.getBiome(mutable).isIn(FriendsAndFoesTags.HAS_ICEOLOGER) == false) { + if (!world.getBiome(mutable).isIn(FriendsAndFoesTags.HAS_ICEOLOGER)) { return 0; } @@ -83,8 +83,8 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) BlockState blockState = world.getBlockState(mutable); if ( - SpawnHelper.isClearForSpawn(world, mutable, blockState, blockState.getFluidState(), FriendsAndFoesEntityTypes.ICEOLOGER.get()) == false - || PatrolEntity.canSpawn(FriendsAndFoesEntityTypes.ICEOLOGER.get(), world, SpawnReason.PATROL, mutable, random) == false + !SpawnHelper.isClearForSpawn(world, mutable, blockState, blockState.getFluidState(), FriendsAndFoesEntityTypes.ICEOLOGER.get()) + || !PatrolEntity.canSpawn(FriendsAndFoesEntityTypes.ICEOLOGER.get(), world, SpawnReason.PATROL, mutable, random) ) { return 0; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/world/spawner/IllusionerSpawner.java b/common/src/main/java/com/faboslav/friendsandfoes/common/world/spawner/IllusionerSpawner.java index cba7cf9bf..18cd05e04 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/world/spawner/IllusionerSpawner.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/world/spawner/IllusionerSpawner.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.world.spawner; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.tag.FriendsAndFoesTags; import net.minecraft.block.BlockState; import net.minecraft.entity.EntityType; @@ -24,9 +24,9 @@ public IllusionerSpawner() { @Override public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) { if ( - spawnMonsters == false - || FriendsAndFoes.getConfig().enableIllusioner == false - || FriendsAndFoes.getConfig().enableIllusionerSpawn == false + !spawnMonsters + || !FriendsAndFoes.getConfig().enableIllusioner + || !FriendsAndFoes.getConfig().enableIllusionerSpawn ) { return 0; } @@ -43,7 +43,7 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) if ( l < 5L - || world.isDay() == false + || !world.isDay() || random.nextBetween(0, 1) != 0 ) { return 0; @@ -71,11 +71,11 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) var minZ = mutable.getZ() - 10; var maxX = mutable.getX() + 10; var maxZ = mutable.getZ() + 10; - if (world.isRegionLoaded(minX, minZ, maxX, maxZ) == false) { + if (!world.isRegionLoaded(minX, minZ, maxX, maxZ)) { return 0; } - if (world.getBiome(mutable).isIn(FriendsAndFoesTags.HAS_ILLUSIONER) == false) { + if (!world.getBiome(mutable).isIn(FriendsAndFoesTags.HAS_ILLUSIONER)) { return 0; } @@ -83,8 +83,8 @@ public int spawn(ServerWorld world, boolean spawnMonsters, boolean spawnAnimals) BlockState blockState = world.getBlockState(mutable); if ( - SpawnHelper.isClearForSpawn(world, mutable, blockState, blockState.getFluidState(), EntityType.ILLUSIONER) == false - || PatrolEntity.canSpawn(EntityType.ILLUSIONER, world, SpawnReason.PATROL, mutable, random) == false + !SpawnHelper.isClearForSpawn(world, mutable, blockState, blockState.getFluidState(), EntityType.ILLUSIONER) + || !PatrolEntity.canSpawn(EntityType.ILLUSIONER, world, SpawnReason.PATROL, mutable, random) ) { return 0; } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/CitadelStructure.java b/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/CitadelStructure.java index adc04126f..129293bdc 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/CitadelStructure.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/CitadelStructure.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.world.structures; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesStructureTypes; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; @@ -71,8 +71,8 @@ public Optional getStructurePosition(Structure.Cont BlockPos blockPos = new BlockPos(context.chunkPos().getStartX(), offsetY, context.chunkPos().getStartZ()); if ( - FriendsAndFoes.getConfig().generateCitadelStructure == false - || extraSpawningChecks(context, blockPos) == false + !FriendsAndFoes.getConfig().generateCitadelStructure + || !extraSpawningChecks(context, blockPos) ) { return Optional.empty(); } @@ -103,7 +103,7 @@ private boolean extraSpawningChecks(Structure.Context context, BlockPos blockPos mutable.set(blockPos).move(xOffset, yOffset, zOffset); BlockState state = blockView.getState(mutable.getY()); - if (state.isAir() == false && state.getFluidState().isEmpty()) { + if (!state.isAir() && state.getFluidState().isEmpty()) { return false; } } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IceologerCabinStructure.java b/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IceologerCabinStructure.java index 19f76f9ac..1a833cbdd 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IceologerCabinStructure.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IceologerCabinStructure.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.world.structures; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesStructureTypes; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; @@ -68,7 +68,7 @@ public Optional getStructurePosition(Context context) { int offsetY = this.startHeight.get(context.random(), new HeightContext(context.chunkGenerator(), context.world())); BlockPos blockPos = new BlockPos(context.chunkPos().getStartX(), offsetY, context.chunkPos().getStartZ()); - if (FriendsAndFoes.getConfig().generateIceologerCabinStructure == false) { + if (!FriendsAndFoes.getConfig().generateIceologerCabinStructure) { return Optional.empty(); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IllusionerShackStructure.java b/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IllusionerShackStructure.java index 761b40650..599332c4b 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IllusionerShackStructure.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IllusionerShackStructure.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.world.structures; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesStructureTypes; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; @@ -68,7 +68,7 @@ public Optional getStructurePosition(Context context) { int offsetY = this.startHeight.get(context.random(), new HeightContext(context.chunkGenerator(), context.world())); BlockPos blockPos = new BlockPos(context.chunkPos().getStartX(), offsetY, context.chunkPos().getStartZ()); - if (FriendsAndFoes.getConfig().generateIllusionerShackStructure == false) { + if (!FriendsAndFoes.getConfig().generateIllusionerShackStructure) { return Optional.empty(); } diff --git a/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IllusionerTrainingGroundsStructure.java b/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IllusionerTrainingGroundsStructure.java index d8e9149bb..62befe79d 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IllusionerTrainingGroundsStructure.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/common/world/structures/IllusionerTrainingGroundsStructure.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.world.structures; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.init.FriendsAndFoesStructureTypes; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; @@ -68,7 +68,7 @@ public Optional getStructurePosition(Context context) { int offsetY = this.startHeight.get(context.random(), new HeightContext(context.chunkGenerator(), context.world())); BlockPos blockPos = new BlockPos(context.chunkPos().getStartX(), offsetY, context.chunkPos().getStartZ()); - if (FriendsAndFoes.getConfig().generateIllusionerTrainingGroundsStructure == false) { + if (!FriendsAndFoes.getConfig().generateIllusionerTrainingGroundsStructure) { return Optional.empty(); } diff --git a/common/src/main/resources/assets/friendsandfoes/lang/de_de.json b/common/src/main/resources/assets/friendsandfoes/lang/de_de.json new file mode 100644 index 000000000..70c46efe6 --- /dev/null +++ b/common/src/main/resources/assets/friendsandfoes/lang/de_de.json @@ -0,0 +1,135 @@ +{ + "advancements.husbandry.beehive.title": "Der Imker", + "advancements.husbandry.beehive.description": "Sammle alle Typen von Bienenstöcken", + "advancements.adventure.kill_iceologer.title": "Ich war hier, ich habe gelebt, ich ...", + "advancements.adventure.kill_iceologer.description": "Töte den Eisforscher", + "advancements.adventure.kill_illusioner.title": "Welt der Illusionen", + "advancements.adventure.kill_illusioner.description": "Töte den Illusionisten … falls es ihn überhaupt gibt", + "advancements.husbandry.shear_a_moobloom.title": "MooBoom!", + "advancements.husbandry.shear_a_moobloom.description": "Ein Moobloom scheren", + "advancements.adventure.summon_copper_golem.title": "Los gehts", + "advancements.adventure.summon_copper_golem.description": "Beschwöre einen Kupfergolem", + "advancements.husbandry.tame_a_glare.title": "Mürrisch und süß", + "advancements.husbandry.tame_a_glare.description": "Zähme einen Späher", + "advancements.adventure.the_magicians.title": "Die Magier", + "advancements.adventure.the_magicians.description": "Töte alle drei Illager-Magier", + "advancements.adventure.it_bites.title": "Es beißt", + "advancements.adventure.it_bites.description": "Töte den Schurken", + "advancements.survival.activate_zombie_horse_trap.title": "Reiter im Sturm", + "advancements.survival.activate_zombie_horse_trap.description": "Aktiviere eine Zombie-Pferdefalle", + "advancements.nether.find_citadel.title": "Eine Festung? Nein, eine Zitadelle!", + "advancements.nether.find_citadel.description": "Betreten Sie eine Netherzitadelle", + "advancements.nether.kill_wildfire.title": "Drop it like it's hot", + "advancements.nether.kill_wildfire.description": "Töte ein Lauffeuer", + "advancements.nether.obtain_wildfire_crown.title": "Wer ist der neue König der Hölle?", + "advancements.nether.obtain_wildfire_crown.description": "Halte eine Lauffeuer-Krone im Inventar", + "advancements.adventure.complete_hide_and_seek_game.title": "Das Versteckspiel", + "advancements.adventure.complete_hide_and_seek_game.description": "Finde den Schlingel dreimal in seinem kleinen Spiel", + "block.friendsandfoes.buttercup": "Butterblume", + "block.minecraft.beehive": "Eichen-Bienenstock", + "block.friendsandfoes.acacia_beehive": "Akazien-Bienenstock", + "block.friendsandfoes.bamboo_beehive": "Bambus-Bienenstock", + "block.friendsandfoes.birch_beehive": "Birken-Bienenstock", + "block.friendsandfoes.cherry_beehive": "Kirschenholz-Bienenstock", + "block.friendsandfoes.crimson_beehive": "Karmesin-Bienenstock", + "block.friendsandfoes.dark_oak_beehive": "Schwarzeichen-Bienenstock", + "block.friendsandfoes.jungle_beehive": "Tropen-Bienenstock", + "block.friendsandfoes.mangrove_beehive": "Mangroven-Bienenstock", + "block.friendsandfoes.spruce_beehive": "Fichten-Bienenstock", + "block.friendsandfoes.warped_beehive": "Wirr-Bienenstock", + "block.friendsandfoes.copper_button": "Kupferknopf", + "block.friendsandfoes.exposed_copper_button": "Angelaufener Kupferknopf", + "block.friendsandfoes.weathered_copper_button": "Verwitterter Kupferknopf", + "block.friendsandfoes.oxidized_copper_button": "Oxidierter Kupferknopf", + "block.friendsandfoes.waxed_copper_button": "Gewachster Kupferknopf", + "block.friendsandfoes.waxed_exposed_copper_button": "Gewachster Angelaufener Kupferknopf", + "block.friendsandfoes.waxed_weathered_copper_button": "Gewachster Verwitterter Kupferknopf", + "block.friendsandfoes.waxed_oxidized_copper_button": "Gewachster Oxidierter Kupferknopf", + "block.friendsandfoes.exposed_lightning_rod": "Angelaufener Blitzableiter", + "block.friendsandfoes.weathered_lightning_rod": "Verwitterter Blitzableiter", + "block.friendsandfoes.oxidized_lightning_rod": "Oxidierter Blitzableiter", + "block.friendsandfoes.waxed_lightning_rod": "Gewachster Blitzableiter", + "block.friendsandfoes.waxed_exposed_lightning_rod": "Gewachster Angelaufener Blitzableiter", + "block.friendsandfoes.waxed_weathered_lightning_rod": "Gewachster Verwitterter Blitzableiter", + "block.friendsandfoes.waxed_oxidized_lightning_rod": "Gewachster Oxidierter Blitzableiter", + "block.friendsandfoes.potted_buttercup": "Butterblume im Topf", + "entity.minecraft.villager.beekeeper": "Imker", + "entity.minecraft.villager.friendsandfoes.beekeeper": "Imker", + "entity.friendsandfoes.copper_golem": "Kupfergolem", + "entity.friendsandfoes.glare": "Späher", + "entity.friendsandfoes.iceologer": "Eisforscher", + "entity.friendsandfoes.moobloom": "Moobloom", + "entity.friendsandfoes.rascal": "Schlingel", + "entity.friendsandfoes.mauler": "Schurke", + "entity.friendsandfoes.tuff_golem": "Tuff-Golem", + "entity.friendsandfoes.wildfire": "Lauffeuer", + "item.friendsandfoes.buttercup": "Butterblume", + "item.friendsandfoes.glare_spawn_egg": "Späher-Spawn-Ei", + "item.friendsandfoes.copper_golem_spawn_egg": "Kupfergolem-Spawn-Ei", + "item.friendsandfoes.iceologer_spawn_egg": "Eisforscher-Spawn-Ei", + "item.friendsandfoes.illusioner_spawn_egg": "Illusionist-Spawn-Ei", + "item.friendsandfoes.mauler_spawn_egg": "Schurken-Spawn-Ei", + "item.friendsandfoes.moobloom_spawn_egg": "Moobloom-Spawn-Ei", + "item.friendsandfoes.rascal_spawn_egg": "Schlingel-Spawn-Ei", + "item.friendsandfoes.tuff_golem_spawn_egg": "Tuff-Golem-Spawn-Ei", + "item.friendsandfoes.wildfire_spawn_egg": "Lauffeuer-Spawn-Ei", + "item.friendsandfoes.totem_of_freezing": "Totem der Kälte", + "item.friendsandfoes.totem_of_illusion": "Totem der Illusion", + "item.friendsandfoes.wildfire_crown": "Lauffeuer-Krone", + "item.friendsandfoes.wildfire_crown_fragment": "Lauffeuer-Kronenfragment", + "subtitle.entity.friendsandfoes.glare.ambient": "Späher fliegt", + "subtitle.entity.friendsandfoes.glare.death": "Späher stirbt", + "subtitle.entity.friendsandfoes.glare.eat": "Späher isst", + "subtitle.entity.friendsandfoes.glare.grumpiness": "Späher mürrt", + "subtitle.entity.friendsandfoes.glare.grumpiness_short": "Späher mürrt", + "subtitle.entity.friendsandfoes.glare.hurt": "Späher nimmt Schaden", + "subtitle.entity.friendsandfoes.glare.rustle": "Späher raschelt", + "subtitle.entity.friendsandfoes.glare.shake": "Späher schüttelt Leuchtbeeren ab", + "subtitle.entity.friendsandfoes.copper_golem.death": "Kupfergolem stirbt", + "subtitle.entity.friendsandfoes.copper_golem.head_spin": "Kupfergolem schüttelt den Kopf", + "subtitle.entity.friendsandfoes.copper_golem.hurt": "Kupfergolem nimmt Schaden", + "subtitle.entity.friendsandfoes.copper_golem.repair": "Kupfergolem repariert", + "subtitle.entity.friendsandfoes.copper_golem.step": "Fußstapfen", + "subtitle.entity.friendsandfoes.iceologer.ambient": "Eisforscher murmelt", + "subtitle.entity.friendsandfoes.iceologer.cast_spell": "Eisforscher spricht Zauber", + "subtitle.entity.friendsandfoes.iceologer.death": "Eisforscher stirbt", + "subtitle.entity.friendsandfoes.iceologer.hurt": "Eisforscher nimmt Schaden", + "subtitle.entity.friendsandfoes.iceologer.prepare_slowness": "Eisforscher bereitet Langsamkeit vor", + "subtitle.entity.friendsandfoes.iceologer.prepare_summon": "Eiskundler bereitet Beschwörung vor", + "subtitle.entity.friendsandfoes.ice_chunk.ambient": "Eisbrocken bricht", + "subtitle.entity.friendsandfoes.ice_chunk.hit": "Eisbrocken fällt", + "subtitle.entity.friendsandfoes.ice_chunk.summon": "Eisbrocken bricht", + "subtitle.entity.friendsandfoes.mauler.bite": "Schurke beißt", + "subtitle.entity.friendsandfoes.mauler.death": "Schurke stirbt", + "subtitle.entity.friendsandfoes.mauler.growl": "Schurke knurrt", + "subtitle.entity.friendsandfoes.mauler.hurt": "Schurke nimmt Schaden", + "subtitle.entity.friendsandfoes.moobloom.convert": "Moobloom verwandelt sich", + "subtitle.entity.friendsandfoes.player.mirror_move": "Spieler bewegt sich", + "subtitle.entity.friendsandfoes.rascal.ambient": "Schlingel stichelt", + "subtitle.entity.friendsandfoes.rascal.disappear": "Schlingel verschwindet", + "subtitle.entity.friendsandfoes.rascal.nod": "Schlingel nickt", + "subtitle.entity.friendsandfoes.rascal.hurt": "Schlingel nimmt Schaden", + "subtitle.entity.friendsandfoes.rascal.reappear": "Schlingel erscheint", + "subtitle.entity.friendsandfoes.rascal.reward": "Schlingel gibt Belohnung", + "subtitle.entity.friendsandfoes.rascal.reward_bad": "Schlingel gibt schlechte Belohnung", + "subtitle.entity.friendsandfoes.shield_debris.impact": "Schildtrümmer getroffen", + "subtitle.entity.friendsandfoes.tuff_golem.glue_on": "Tuff-Golem festgeklebt", + "subtitle.entity.friendsandfoes.tuff_golem.glue_off": "Tuff-Golem befreit", + "subtitle.entity.friendsandfoes.tuff_golem.hurt": "Tuff-Golem nimmt Schaden", + "subtitle.entity.friendsandfoes.tuff_golem.move": "Tuff-Golem bewegt sich", + "subtitle.entity.friendsandfoes.tuff_golem.repair": "Tuff-Golem repariert", + "subtitle.entity.friendsandfoes.tuff_golem.wake": "Tuff-Golem wacht auf", + "subtitle.entity.friendsandfoes.tuff_golem.sleep": "Tuff-Golem schläft ein", + "subtitle.entity.friendsandfoes.tuff_golem.step": "Fußstapfen", + "subtitle.entity.friendsandfoes.wildfire.ambient": "Lauffeuer atmet", + "subtitle.entity.friendsandfoes.wildfire.death": "Lauffeuer stirbt", + "subtitle.entity.friendsandfoes.wildfire.hurt": "Lauffeuer nimmt Schaden", + "subtitle.entity.friendsandfoes.wildfire.shield_break": "Lauffeuer-Schild gebrochen", + "subtitle.entity.friendsandfoes.wildfire.shockwave": "Lauffeuer Schockwelle", + "subtitle.entity.friendsandfoes.wildfire.shoot": "Lauffeuer schießt", + "subtitle.entity.friendsandfoes.wildfire.step": "Fußstapfen", + "subtitle.entity.friendsandfoes.wildfire.summon_blaze": "Lauffeuer beschwört Lohe", + "trinkets.slot.charm.charm": "Amulett", + "text.betterf3.line.glares": "Späher", + "text.betterf3.line.rascals": "Schlingel" +} \ No newline at end of file diff --git a/common/src/main/resources/assets/friendsandfoes/lang/vi_vn.json b/common/src/main/resources/assets/friendsandfoes/lang/vi_vn.json index 6842e9b45..5de8b90c6 100644 --- a/common/src/main/resources/assets/friendsandfoes/lang/vi_vn.json +++ b/common/src/main/resources/assets/friendsandfoes/lang/vi_vn.json @@ -73,8 +73,8 @@ "item.friendsandfoes.rascal_spawn_egg": "Trứng sinh ra Tinh Nghịch", "item.friendsandfoes.tuff_golem_spawn_egg": "Trứng sinh ra Người Đá Túp", "item.friendsandfoes.wildfire_spawn_egg": "Trứng sinh ra Quỷ Lửa Dại", - "item.friendsandfoes.totem_of_freezing": "Bùa Đóng Băng", - "item.friendsandfoes.totem_of_illusion": "Bùa Ảo Ảnh", + "item.friendsandfoes.totem_of_freezing": "Vật Tổ Đóng Băng", + "item.friendsandfoes.totem_of_illusion": "Vật Tổ Ảo Ảnh", "item.friendsandfoes.wildfire_crown": "Vương Miện Quỷ Lửa Dại", "item.friendsandfoes.wildfire_crown_fragment": "Mảnh Vương Miện Quỷ Lửa Dại", "subtitle.entity.friendsandfoes.glare.ambient": "Tiếng bay của Glare", diff --git a/common/src/main/resources/friendsandfoes-common.mixins.json b/common/src/main/resources/friendsandfoes-common.mixins.json index 84dd7755d..0337e9a11 100644 --- a/common/src/main/resources/friendsandfoes-common.mixins.json +++ b/common/src/main/resources/friendsandfoes-common.mixins.json @@ -3,6 +3,7 @@ "package": "com.faboslav.friendsandfoes.common.mixin", "compatibilityLevel": "JAVA_${modJavaVersion}", "minVersion": "0.8", + "plugin": "com.faboslav.friendsandfoes.common.mixin.plugin.FriendsAndFoesMixinPlugin", "injectors": { "defaultRequire": 1 }, @@ -59,6 +60,7 @@ "ClientPlayNetworkHandlerMixin", "EntityRenderDispatcherMixin", "IllusionerEntityRendererMixin", + "IntegratedServerLoaderMixin", "ModelPartAccessor" ] } \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index d2b06b8fe..2607fa2f4 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -25,8 +25,8 @@ configurations { dependencies { // Core dependencies - modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" - modApi "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}" + modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}") + modApi("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}+${min_minecraft_version}") // Mod menu (https://modrinth.com/mod/modmenu) modImplementation("com.terraformersmc:modmenu:${mod_menu_version}") { transitive = false } diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/common/modcompat/fabric/ModCheckerImpl.java b/fabric/src/main/java/com/faboslav/friendsandfoes/common/modcompat/fabric/ModCheckerImpl.java index 500712dc1..111007c0d 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/common/modcompat/fabric/ModCheckerImpl.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/common/modcompat/fabric/ModCheckerImpl.java @@ -1,7 +1,7 @@ package com.faboslav.friendsandfoes.common.modcompat.fabric; -import com.faboslav.friendsandfoes.FriendsAndFoes; -import com.faboslav.friendsandfoes.fabric.modcompat.fabric.TrinketsCompat; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; +import com.faboslav.friendsandfoes.fabric.modcompat.TrinketsCompat; import static com.faboslav.friendsandfoes.common.modcompat.ModChecker.loadModCompat; diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/common/network/fabric/NetworkImpl.java b/fabric/src/main/java/com/faboslav/friendsandfoes/common/network/fabric/NetworkImpl.java index f605eda66..3bd20f21b 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/common/network/fabric/NetworkImpl.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/common/network/fabric/NetworkImpl.java @@ -1,7 +1,7 @@ package com.faboslav.friendsandfoes.common.network.fabric; import com.faboslav.friendsandfoes.common.network.base.Networking; -import com.faboslav.friendsandfoes.fabric.network.fabric.FabricNetworking; +import com.faboslav.friendsandfoes.fabric.network.FabricNetworking; import net.minecraft.util.Identifier; /** diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/common/platform/fabric/BiomeModificationsImpl.java b/fabric/src/main/java/com/faboslav/friendsandfoes/common/platform/fabric/BiomeModificationsImpl.java index 88a8b4e13..a58025d2f 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/common/platform/fabric/BiomeModificationsImpl.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/common/platform/fabric/BiomeModificationsImpl.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.platform.fabric; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import net.fabricmc.fabric.api.biome.v1.BiomeModifications; import net.fabricmc.fabric.api.biome.v1.ModificationPhase; import net.minecraft.entity.EntityType; diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/common/platform/fabric/ModVersionImpl.java b/fabric/src/main/java/com/faboslav/friendsandfoes/common/platform/fabric/ModVersionImpl.java index 62728d587..b0e07a97c 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/common/platform/fabric/ModVersionImpl.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/common/platform/fabric/ModVersionImpl.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.platform.fabric; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import net.fabricmc.loader.api.FabricLoader; import org.jetbrains.annotations.Nullable; diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabric.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabric.java index 6328a976a..9ebc3735b 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabric.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabric.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.fabric; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.events.AddItemGroupEntriesEvent; import com.faboslav.friendsandfoes.common.events.block.RegisterBlockSetTypeEvent; import com.faboslav.friendsandfoes.common.events.entity.RegisterVillagerTradesEvent; diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabricClient.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabricClient.java index e9bfcd757..97c766115 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabricClient.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/FriendsAndFoesFabricClient.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.fabric; -import com.faboslav.friendsandfoes.FriendsAndFoesClient; +import com.faboslav.friendsandfoes.common.FriendsAndFoesClient; import com.faboslav.friendsandfoes.common.events.client.RegisterEntityLayersEvent; import com.faboslav.friendsandfoes.common.events.client.RegisterEntityRenderersEvent; import com.faboslav.friendsandfoes.common.events.client.RegisterItemColorEvent; diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/mixin/StructureEntityProcessorMixin.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/mixin/StructureEntityProcessorMixin.java index 5802fa428..ba0d5f097 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/mixin/StructureEntityProcessorMixin.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/mixin/StructureEntityProcessorMixin.java @@ -65,7 +65,7 @@ private void friendsandfoes_processEntities( int flags, CallbackInfoReturnable cir ) { - if (FabricLoader.getInstance().isModLoaded("yungsapi") == false) { + if (!FabricLoader.getInstance().isModLoaded("yungsapi")) { for (StructureEntityInfo entityInfo : friendsandfoes_processEntityInfos( serverWorldAccess, structurePiecePos, @@ -77,7 +77,7 @@ private void friendsandfoes_processEntities( if ( structurePlacementData.getBoundingBox() != null - && structurePlacementData.getBoundingBox().contains(blockPos) == false + && !structurePlacementData.getBoundingBox().contains(blockPos) ) { continue; } @@ -142,7 +142,7 @@ private void friendsandfoes_cancelPlaceEntities( boolean initializeMobs, CallbackInfo ci ) { - if (FabricLoader.getInstance().isModLoaded("yungsapi") == false) { + if (!FabricLoader.getInstance().isModLoaded("yungsapi")) { ci.cancel(); } } @@ -184,7 +184,7 @@ private List friendsandfoes_processEntityInfos( // Apply processors for (StructureProcessor processor : structurePlacementData.getProcessors()) { - if (processor instanceof StructureEntityProcessor == false) { + if (!(processor instanceof StructureEntityProcessor)) { continue; } diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/fabric/CatalogueCompat.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/CatalogueCompat.java similarity index 71% rename from fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/fabric/CatalogueCompat.java rename to fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/CatalogueCompat.java index 74dce6fb3..1a186d9d3 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/fabric/CatalogueCompat.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/CatalogueCompat.java @@ -1,6 +1,6 @@ -package com.faboslav.friendsandfoes.fabric.modcompat.fabric; +package com.faboslav.friendsandfoes.fabric.modcompat; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.config.ConfigScreenBuilder; import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; @@ -9,7 +9,7 @@ public final class CatalogueCompat { public static Screen createConfigScreen(Screen currentScreen, ModContainer container) { - if (FabricLoader.getInstance().isModLoaded("catalogue") == false) { + if (!FabricLoader.getInstance().isModLoaded("catalogue")) { return null; } diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/fabric/ModMenuCompat.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/ModMenuCompat.java similarity index 83% rename from fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/fabric/ModMenuCompat.java rename to fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/ModMenuCompat.java index 9c47305d7..52faacd7d 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/fabric/ModMenuCompat.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/ModMenuCompat.java @@ -1,6 +1,6 @@ -package com.faboslav.friendsandfoes.fabric.modcompat.fabric; +package com.faboslav.friendsandfoes.fabric.modcompat; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.config.ConfigScreenBuilder; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/fabric/TrinketsCompat.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/TrinketsCompat.java similarity index 94% rename from fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/fabric/TrinketsCompat.java rename to fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/TrinketsCompat.java index 745a38e27..50937c2b0 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/fabric/TrinketsCompat.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/modcompat/TrinketsCompat.java @@ -1,4 +1,4 @@ -package com.faboslav.friendsandfoes.fabric.modcompat.fabric; +package com.faboslav.friendsandfoes.fabric.modcompat; import com.faboslav.friendsandfoes.common.modcompat.ModCompat; import dev.emi.trinkets.api.SlotReference; diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/fabric/FabricClientNetworkHandler.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/FabricClientNetworkHandler.java similarity index 95% rename from fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/fabric/FabricClientNetworkHandler.java rename to fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/FabricClientNetworkHandler.java index 2295d77c6..bf5527bd7 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/fabric/FabricClientNetworkHandler.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/FabricClientNetworkHandler.java @@ -1,4 +1,4 @@ -package com.faboslav.friendsandfoes.fabric.network.fabric; +package com.faboslav.friendsandfoes.fabric.network; import com.faboslav.friendsandfoes.common.network.Packet; import com.faboslav.friendsandfoes.common.network.base.ClientboundPacketType; diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/fabric/FabricNetworking.java b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/FabricNetworking.java similarity index 97% rename from fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/fabric/FabricNetworking.java rename to fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/FabricNetworking.java index f18f6d5b4..8b632b495 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/fabric/FabricNetworking.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/fabric/network/FabricNetworking.java @@ -1,4 +1,4 @@ -package com.faboslav.friendsandfoes.fabric.network.fabric; +package com.faboslav.friendsandfoes.fabric.network; import com.faboslav.friendsandfoes.common.network.Packet; import com.faboslav.friendsandfoes.common.network.base.ClientboundPacketType; diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 9d661e399..f1c99d0b3 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -28,7 +28,7 @@ "com.llamalad7.mixinextras.MixinExtrasBootstrap::init" ], "modmenu": [ - "com.faboslav.friendsandfoes.fabric.modcompat.fabric.ModMenuCompat" + "com.faboslav.friendsandfoes.fabric.modcompat.ModMenuCompat" ] }, "mixins": [ @@ -36,10 +36,9 @@ "${modId}-fabric.mixins.json" ], "depends": { - "java": ">=${modJavaVersion}", - "minecraft": ">=${minMinecraftVersion}", - "fabricloader": ">=${fabricLoaderVersion}", - "fabric": ">=${fabricApiVersion}" + "minecraft": ">=${minMinecraftVersion}-", + "fabricloader": "*", + "fabric": "*" }, "custom": { "modmenu": { diff --git a/gradle.properties b/gradle.properties index 26251d710..4a055e6c6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,12 +12,12 @@ mod_author=Faboslav mod_description=Adds outvoted and forgotten mobs from the mob votes in a believable vanilla plus style. maven_group=com.faboslav.friendsandfoes -#Minecraft +# Minecraft minecraft_version=1.21.1 min_minecraft_version=1.21 -#Mappings -yarn_mappings=1.21+build.4:v2 +# Mappings +yarn_mappings=1.21+build.4 yarn_mappings_patch=1.21+build.4 # Architectury @@ -33,7 +33,7 @@ curios_version=9.0.9+1.21 # Fabric https://fabricmc.net/versions.html fabric_loader_version=0.15.11 -fabric_api_version=0.103.0+1.21.1 +fabric_api_version=0.102.0 # Neoforge https://projects.neoforged.net/neoforged/neoforge neoforge_version=21.1.1 diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/common/modcompat/neoforge/CuriosCompat.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/common/modcompat/neoforge/CuriosCompat.java index eef9b0837..6ef74b1e6 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/common/modcompat/neoforge/CuriosCompat.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/common/modcompat/neoforge/CuriosCompat.java @@ -12,6 +12,7 @@ import top.theillusivec4.curios.api.CuriosApi; import top.theillusivec4.curios.api.SlotResult; import top.theillusivec4.curios.api.client.CuriosRendererRegistry; + import java.util.EnumSet; import java.util.function.Predicate; diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/common/modcompat/neoforge/ModCheckerImpl.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/common/modcompat/neoforge/ModCheckerImpl.java index 664fa8ce5..cfdde4125 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/common/modcompat/neoforge/ModCheckerImpl.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/common/modcompat/neoforge/ModCheckerImpl.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.modcompat.neoforge; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import static com.faboslav.friendsandfoes.common.modcompat.ModChecker.loadModCompat; diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/common/platform/neoforge/ModVersionImpl.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/common/platform/neoforge/ModVersionImpl.java index 1a768be2a..e4a98619d 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/common/platform/neoforge/ModVersionImpl.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/common/platform/neoforge/ModVersionImpl.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.common.platform.neoforge; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import net.neoforged.fml.ModList; import org.jetbrains.annotations.Nullable; diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForge.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForge.java index 7d68fc56e..88321b159 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForge.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForge.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.neoforge; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.common.events.AddItemGroupEntriesEvent; import com.faboslav.friendsandfoes.common.events.block.RegisterBlockSetTypeEvent; import com.faboslav.friendsandfoes.common.events.entity.RegisterVillagerTradesEvent; diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForgeClient.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForgeClient.java index 0a9086d5c..c3c1df0e8 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForgeClient.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/FriendsAndFoesNeoForgeClient.java @@ -1,7 +1,7 @@ package com.faboslav.friendsandfoes.neoforge; -import com.faboslav.friendsandfoes.FriendsAndFoes; -import com.faboslav.friendsandfoes.FriendsAndFoesClient; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoesClient; import com.faboslav.friendsandfoes.common.config.ConfigScreenBuilder; import com.faboslav.friendsandfoes.common.events.client.RegisterEntityLayersEvent; import com.faboslav.friendsandfoes.common.events.client.RegisterEntityRenderersEvent; diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/init/FriendsAndFoesBiomeModifiers.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/init/FriendsAndFoesBiomeModifiers.java index 334b5a85b..2d662fdc3 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/init/FriendsAndFoesBiomeModifiers.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/neoforge/init/FriendsAndFoesBiomeModifiers.java @@ -1,6 +1,6 @@ package com.faboslav.friendsandfoes.neoforge.init; -import com.faboslav.friendsandfoes.FriendsAndFoes; +import com.faboslav.friendsandfoes.common.FriendsAndFoes; import com.faboslav.friendsandfoes.neoforge.worldgen.MobSpawnsBiomeModifier; import com.mojang.serialization.MapCodec; import net.neoforged.neoforge.common.world.BiomeModifier; diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index a473aeb3f..59915cb34 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -19,11 +19,6 @@ config = "friendsandfoes-neoforge.mixins.json" [[mixins]] config = "friendsandfoes-common.mixins.json" -[[dependencies.${ modId }]] -modId = "minecraft" -required = true -versionRange = "[${minMinecraftVersion},)" - [modproperties.${ modId }] catalogueImageIcon = "catalogue_icon.png" catalogueBackground = "catalogue_background.png"