Skip to content

Commit

Permalink
Fix invalid treasure message showing several times because the item i…
Browse files Browse the repository at this point in the history
…s not removed
  • Loading branch information
Blitheness committed Nov 27, 2022
1 parent b6b4ffe commit 5330574
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>us.shirecraft</groupId>
<artifactId>EasterEggHunt</artifactId>
<version>0.4.12-SNAPSHOT</version>
<version>0.4.13-SNAPSHOT</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/us/shirecraft/easteregghunt/EggListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.FixedMetadataValue;
import us.shirecraft.easteregghunt.halloween.BloodSpider;

import java.util.Objects;
import java.util.Random;
import java.util.stream.Collectors;

public class EggListener implements Listener {
public EggListener(EasterEggHunt plugin) {
Expand Down Expand Up @@ -52,7 +50,7 @@ public void onPlayerPickUpEgg(EntityPickupItemEvent ev) {
if(!regionsEggWasFoundIn.contains(regionName))
{
player.sendMessage("§4 ** Sorry, there was a problem with the treasure you found and it has not been counted.");

ev.getItem().remove();
ev.setCancelled(true);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: us.shirecraft.easteregghunt.EasterEggHunt
name: EasterEggHunt
version: '0.4.12-SNAPSHOT'
version: '0.4.13-SNAPSHOT'
description: "Treasure hunt using WorldGuard regions"
api-version: 1.19
load: POSTWORLD
Expand Down

0 comments on commit 5330574

Please sign in to comment.