Skip to content

Commit

Permalink
Explicitly ignore cancelled events to prevent extra drops.
Browse files Browse the repository at this point in the history
  • Loading branch information
totemo committed Apr 19, 2020
1 parent 83072a4 commit 2738ead
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors: [totemo, bermudalocket]
description: ${project.description}
website: ${project.url}
main: nu.nerd.safecrystals.SafeCrystals
api-version: 1.13
api-version: 1.15

depend: [WorldGuard]

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>nu.nerd</groupId>
<name>SafeCrystals</name>
<artifactId>${project.name}</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<packaging>jar</packaging>
<description>Prevent Ender Crystals from exploding and breaking blocks or damaging entities.</description>
<url>https://github.com/totemo/${project.name}</url>
Expand All @@ -30,7 +30,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.13-R0.1-SNAPSHOT</version>
<version>1.15.2-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
Expand Down
4 changes: 2 additions & 2 deletions src/nu/nerd/safecrystals/SafeCrystals.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void onEntityExplode(EntityExplodeEvent event) {
* If the damager is a player who can build, drop the crystal as an item.
* Projectiles are handled the same as the player who shot them.
*/
@EventHandler()
@EventHandler(ignoreCancelled = true)
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
Entity entity = event.getEntity();
if (entity.getType() == EntityType.ENDER_CRYSTAL) {
Expand Down Expand Up @@ -110,7 +110,7 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
* when the player clicks the sides or underside of the block. Therefore, we
* always check build permissions <i>above</i> the clicked block.
*/
@EventHandler()
@EventHandler(ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getMaterial() == Material.END_CRYSTAL && event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Block destination = event.getClickedBlock().getRelative(BlockFace.UP);
Expand Down

0 comments on commit 2738ead

Please sign in to comment.