From 1fdf5eb26e80915a853e7e7fd8da573dc5348d3a Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 15 Aug 2021 11:42:42 -0700 Subject: [PATCH] Release 1.14.5 (#60) * Version 1.14.4 * Implement options for linking nether portals and crating end obsidian platform. * Implement onRespawnCommands() option from BentoBox 1.14. * Fixes copy-paste issue * Init 1.14.5 version * Fix for mobs in negative coords. Fixes https://github.com/BentoBoxWorld/CaveBlock/issues/59 * Remove unused Sonar profile. * Shift to Github Actions * Add correct properties for SonarCloud * Now with correct CaveBlock reference. Co-authored-by: BONNe --- .github/workflows/build.yml | 37 +++++++++++++++++++ .travis.yml | 22 ----------- pom.xml | 28 ++------------ .../populators/EntitiesPopulator.java | 9 +++-- 4 files changed, 45 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e9a6cdc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: Build +on: + push: + branches: + - develop + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 16 + uses: actions/setup-java@v1 + with: + java-version: 16 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=BentoBoxWorld_CaveBlock \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8a21fa1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: java -sudo: false -addons: - sonarcloud: - organization: "bentobox-world" - -jdk: - - openjdk8 - - openjdk11 - -matrix: - allow_failures: - - jdk: openjdk11 - -script: - # the following command line builds the project, runs the tests with coverage and then execute the SonarCloud analysis - - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=BentoBoxWorld_CaveBlock - -cache: - directories: - - '$HOME/.m2/repository' - - '$HOME/.sonar/cache' diff --git a/pom.xml b/pom.xml index 40cc26d..f3d163f 100644 --- a/pom.xml +++ b/pom.xml @@ -50,8 +50,10 @@ ${build.version}-SNAPSHOT - 1.14.4 + 1.14.5 -LOCAL + bentobox-world + https://sonarcloud.io @@ -92,30 +94,6 @@ - - sonar - - https://sonarcloud.io - bentobox-world - - - - - org.sonarsource.scanner.maven - sonar-maven-plugin - 3.6.0.1398 - - - verify - - sonar - - - - - - - diff --git a/src/main/java/world/bentobox/caveblock/generators/populators/EntitiesPopulator.java b/src/main/java/world/bentobox/caveblock/generators/populators/EntitiesPopulator.java index c09a57c..4c95ec2 100644 --- a/src/main/java/world/bentobox/caveblock/generators/populators/EntitiesPopulator.java +++ b/src/main/java/world/bentobox/caveblock/generators/populators/EntitiesPopulator.java @@ -134,9 +134,10 @@ private void tryToPlaceEntity(World world, Block block, EntityType entity, Mater } // Make space for entity based on the entity's size BoundingBox bb = e.getBoundingBox(); - for (int x = (int) bb.getMinX(); x < bb.getMaxX(); x++) { - for (int z = (int) bb.getMinZ(); z < bb.getMaxZ(); z++) { - int y = (int) bb.getMinY(); + + for (int x = (int) Math.floor(bb.getMinX()); x < bb.getMaxX(); x++) { + for (int z = (int) Math.floor(bb.getMinZ()); z < bb.getMaxZ(); z++) { + int y = (int) Math.floor(bb.getMinY()); Block b = world.getBlockAt(x, y, z); for (; y < bb.getMaxY(); y++) { if (addon.getSettings().isDebug()) { @@ -148,7 +149,7 @@ private void tryToPlaceEntity(World world, Block block, EntityType entity, Mater e.remove(); return; } - b.setType(WATER_ENTITIES.contains(entity) ? Material.WATER : Material.CAVE_AIR); + b.setType(WATER_ENTITIES.contains(entity) ? Material.WATER : Material.AIR); } // Add air block on top for all water entities (required for dolphin, okay for others) if (WATER_ENTITIES.contains(entity) && b.getRelative(BlockFace.UP).getType().equals(originalMaterial)) {