mirror of
https://github.com/BentoBoxWorld/Greenhouses.git
synced 2025-02-01 12:51:31 +01:00
Fix bug with water in offhand and nether greenhouse
Fixes https://github.com/BentoBoxWorld/Greenhouses/issues/76
This commit is contained in:
parent
f2faeb71df
commit
29f04ef673
@ -69,7 +69,12 @@ public class GreenhouseEvents implements Listener {
|
|||||||
.map(gh -> gh.getBiomeRecipe().getBiome()).map(NETHER_BIOMES::contains).orElse(false)) {
|
.map(gh -> gh.getBiomeRecipe().getBiome()).map(NETHER_BIOMES::contains).orElse(false)) {
|
||||||
// Not in Nether, in a nether greenhouse
|
// Not in Nether, in a nether greenhouse
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
e.getPlayer().getInventory().getItemInMainHand().setType(Material.BUCKET);
|
if (e.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.WATER_BUCKET)) {
|
||||||
|
e.getPlayer().getInventory().getItemInMainHand().setType(Material.BUCKET);
|
||||||
|
} else if (e.getPlayer().getInventory().getItemInOffHand().getType().equals(Material.WATER_BUCKET)) {
|
||||||
|
e.getPlayer().getInventory().getItemInOffHand().setType(Material.BUCKET);
|
||||||
|
}
|
||||||
|
|
||||||
b.getWorld().spawnParticle(Particle.SMOKE_NORMAL, b.getLocation(), 10);
|
b.getWorld().spawnParticle(Particle.SMOKE_NORMAL, b.getLocation(), 10);
|
||||||
b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1F, 5F);
|
b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1F, 5F);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user