Skip to content

Commit

Permalink
Merge pull request #140 from BentoBoxWorld/develop
Browse files Browse the repository at this point in the history
Version 1.18.1
  • Loading branch information
tastybento authored Nov 26, 2023
2 parents e3bb98f + 8c9626b commit df273d9
Show file tree
Hide file tree
Showing 9 changed files with 696 additions and 393 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ jobs:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ You're on an island, in a sea of acid! If you like Skyblock, try the AcidIsland

Instead of falling you must contend with acid water when expanding your island, and players can boat to each other's islands.

<img width="512" alt="acidislandart" src="https://github.com/BentoBoxWorld/AcidIsland/assets/4407265/60e97bba-2b7d-425e-9130-cffef73cf76e">

## Download

You can download from GitHub, or ready made plugin packs from [https://download.bentobox.world](https://download.bentobox.world).
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
<!-- Non-minecraft related dependencies -->
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.19.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.23.0</bentobox.version>
<spigot.version>1.20.2-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.0.0-SNAPSHOT</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.18.0</build.version>
<build.version>1.18.1</build.version>
<!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_AcidIsland</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
Expand Down Expand Up @@ -341,7 +341,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<version>0.8.10</version>
<configuration>
<append>true</append>
<excludes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ public void run() {
}.runTaskTimer(addon.getPlugin(), 0L, 20L);
}

/**
* Check if it is still raining or player is safe or dead or there is no damage
* @param player player
* @return true if the acid raid damage should stop
*/
protected boolean checkForRain(Player player) {
if (!addon.getOverWorld().hasStorm() || player.isDead() || isSafeFromRain(player) || addon.getSettings().getAcidRainDamage() <= 0D) {
wetPlayers.remove(player);
Expand All @@ -168,7 +173,7 @@ protected boolean checkForRain(Player player) {
double protection = addon.getSettings().getAcidRainDamage() * getDamageReduced(player);
double totalDamage = Math.max(0, addon.getSettings().getAcidRainDamage() - protection);
AcidRainEvent event = new AcidRainEvent(player, totalDamage, protection, addon.getSettings().getAcidRainEffects());
addon.getServer().getPluginManager().callEvent(event);
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
event.getPotionEffects().stream().filter(EFFECTS::contains).forEach(t -> player.addPotionEffect(new PotionEffect(t, addon.getSettings().getRainEffectDuation() * 20, 1)));
// Apply damage if there is any
Expand Down Expand Up @@ -324,7 +329,7 @@ public static double getDamageReduced(LivingEntity le) {
private static boolean damage(ItemStack item) {
ItemMeta im = item.getItemMeta();

if (im instanceof Damageable d) {
if (im instanceof Damageable d && !im.isUnbreakable()) {
d.setDamage(d.getDamage() + 1);
item.setItemMeta(d);
return d.getDamage() >= item.getType().getMaxDurability();
Expand Down
Loading

0 comments on commit df273d9

Please sign in to comment.