Skip to content

Commit b7e22a7

Browse files
authored
Merge pull request #2692 from BentoBoxWorld/2691_Obsidian_Scooping_is_broken
2691 obsidian scooping is broken
2 parents 73cb09c + 5b50f19 commit b7e22a7

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<!-- Do not change unless you want different name for local builds. -->
7575
<build.number>-LOCAL</build.number>
7676
<!-- This allows to change between versions. -->
77-
<build.version>3.4.0</build.version>
77+
<build.version>3.4.1</build.version>
7878
<sonar.organization>bentobox-world</sonar.organization>
7979
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
8080
<server.jars>${project.basedir}/lib</server.jars>

src/main/java/world/bentobox/bentobox/listeners/flags/worldsettings/ObsidianScoopingListener.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ boolean onPlayerInteract(final PlayerInteractEvent e) {
5858
}
5959

6060
if (Material.BUCKET.equals(e.getPlayer().getInventory().getItemInOffHand().getType()) &&
61-
Material.BUCKET.equals(e.getPlayer().getInventory().getItemInMainHand().getType()) &&
62-
EquipmentSlot.OFF_HAND.equals(e.getHand()))
61+
Material.BUCKET.equals(e.getPlayer().getInventory().getItemInMainHand().getType())
62+
&& EquipmentSlot.OFF_HAND.equals(e.getHand()))
6363
{
6464
// If player is holding bucket in both hands, then allow to interact only with main hand.
6565
// Prevents lava duplication glitch.
@@ -105,16 +105,11 @@ private boolean lookForLava(PlayerInteractEvent e) {
105105
}
106106

107107
private void givePlayerLava(Player player, Block b, ItemStack bucket) {
108-
if (bucket.getAmount() == 1) {
109-
// Needs some special handling when there is only 1 bucket in the stack
110-
bucket = new ItemStack(Material.LAVA_BUCKET);
111-
} else {
112-
// Remove one empty bucket and add a lava bucket to the player's inventory
113-
bucket.setAmount(bucket.getAmount() - 1);
114-
HashMap<Integer, ItemStack> map = player.getInventory().addItem(new ItemStack(Material.LAVA_BUCKET));
115-
if (!map.isEmpty()) {
116-
map.values().forEach(i -> player.getWorld().dropItem(player.getLocation(), i));
117-
}
108+
// Remove one empty bucket and add a lava bucket to the player's inventory
109+
bucket.setAmount(bucket.getAmount() - 1);
110+
HashMap<Integer, ItemStack> map = player.getInventory().addItem(new ItemStack(Material.LAVA_BUCKET));
111+
if (!map.isEmpty()) {
112+
map.values().forEach(i -> player.getWorld().dropItem(player.getLocation(), i));
118113
}
119114
// Set block to air only after giving bucket
120115
b.setType(Material.AIR);

0 commit comments

Comments
 (0)