Skip to content

Commit

Permalink
Bump depends versions + fix possible issues with empty containers
Browse files Browse the repository at this point in the history
  • Loading branch information
MetallicGoat committed May 9, 2024
1 parent 9eff713 commit d51ac70
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
26 changes: 13 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
<version>2.11.3</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>de.marcely.bedwars</groupId>-->
<!-- <artifactId>API</artifactId>-->
<!-- <version>5.3.3</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>de.marcely.bedwars</groupId>
<artifactId>API</artifactId>
<version>5.4.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.metallicgoat.hotbarmanageraddon</groupId>
<artifactId>API</artifactId>
Expand All @@ -56,13 +56,13 @@
<scope>system</scope>
<systemPath>${basedir}/libs/public/PrestigeAddonAPI-1.2.0.jar</systemPath>
</dependency>
<dependency>
<groupId>de.marcely.bedwars</groupId>
<artifactId>API</artifactId>
<version>5.3.3</version>
<scope>system</scope>
<systemPath>${basedir}/libs/public/BedwarsAPI-5.3.3.jar</systemPath>
</dependency>
<!-- <dependency>-->
<!-- <groupId>de.marcely.bedwars</groupId>-->
<!-- <artifactId>API</artifactId>-->
<!-- <version>5.3.3</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${basedir}/libs/public/BedwarsAPI-5.3.3.jar</systemPath>-->
<!-- </dependency>-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

public class EmptyContainers implements Listener {

// Keep in mind 1.8 does not have an off-hand
@EventHandler
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
if (!MainConfig.remove_empty_buckets)
Expand All @@ -27,7 +26,9 @@ public void onBucketEmpty(PlayerBucketEmptyEvent event) {
if (arena == null)
return;

event.getItemStack().setType(Material.AIR);
// Uses isSimilar to remove ItemStacks (weird but works)
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(MBedwarsTweaksPlugin.getInstance(), () ->
player.getInventory().removeItem(new ItemStack(Material.BUCKET)), 1);
}

@EventHandler
Expand All @@ -41,7 +42,8 @@ public void onConsume(PlayerItemConsumeEvent event) {
if (arena == null)
return;

// Uses isSimilar to remove ItemStacks (weird but works)
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(MBedwarsTweaksPlugin.getInstance(), () ->
event.getPlayer().getInventory().removeItem(new ItemStack(Material.GLASS_BOTTLE)), 1);
player.getInventory().removeItem(new ItemStack(Material.GLASS_BOTTLE)), 1);
}
}

0 comments on commit d51ac70

Please sign in to comment.