Skip to content

Commit

Permalink
fix: don't allow trampling when the event is cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertik committed Dec 31, 2024
1 parent 0f1ce49 commit af56e9e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions blockregen-ancient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BlockRegen</artifactId>
<groupId>nl.aurorion.blockregen</groupId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>nl.aurorion.blockregen</groupId>
<artifactId>blockregen-version</artifactId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion blockregen-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BlockRegen</artifactId>
<groupId>nl.aurorion.blockregen</groupId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions blockregen-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BlockRegen</artifactId>
<groupId>nl.aurorion.blockregen</groupId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -22,7 +22,7 @@
<dependency>
<groupId>nl.aurorion.blockregen</groupId>
<artifactId>blockregen-version</artifactId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

Expand Down
10 changes: 5 additions & 5 deletions blockregen-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BlockRegen</artifactId>
<groupId>nl.aurorion.blockregen</groupId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -112,25 +112,25 @@
<dependency>
<groupId>nl.aurorion.blockregen</groupId>
<artifactId>blockregen-common</artifactId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>nl.aurorion.blockregen</groupId>
<artifactId>blockregen-version</artifactId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>nl.aurorion.blockregen</groupId>
<artifactId>blockregen-legacy</artifactId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>nl.aurorion.blockregen</groupId>
<artifactId>blockregen-ancient</artifactId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- Spigot API -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.*;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPhysicsEvent;
Expand Down Expand Up @@ -88,9 +85,9 @@ public void onPhysics(BlockPhysicsEvent event) {
}

// Block trampling
@EventHandler
@EventHandler(priority = EventPriority.HIGHEST)
public void onInteract(PlayerInteractEvent event) {
if (event.getAction() != Action.PHYSICAL) {
if (event.getAction() != Action.PHYSICAL || event.useInteractedBlock() == Event.Result.DENY) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions blockregen-version/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>BlockRegen</artifactId>
<groupId>nl.aurorion.blockregen</groupId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
</parent>

<artifactId>blockregen-version</artifactId>
Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>nl.aurorion.blockregen</groupId>
<artifactId>blockregen-common</artifactId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- Spigot API -->
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>nl.aurorion.blockregen</groupId>
<artifactId>BlockRegen</artifactId>
<version>3.17.2</version>
<version>3.17.3-SNAPSHOT</version>
<modules>
<module>blockregen-version</module>
<module>blockregen-common</module>
Expand Down

0 comments on commit af56e9e

Please sign in to comment.