Skip to content

Commit

Permalink
Fixes where water could be placed in nether
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Sep 19, 2019
1 parent f28a50e commit 228644d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public void onPlayerInteract(PlayerInteractEvent e) {
if (!e.getPlayer().getWorld().getEnvironment().equals(World.Environment.NETHER)) {
return;
}
if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && e.getItem() != null && e.getItem().getType().equals(Material.WATER_BUCKET)) {
if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && e.getItem() != null && e.getItem().getType().equals(Material.WATER_BUCKET)
&& plugin.getManager().getMap().getGreenhouse(e.getClickedBlock().getLocation()).isPresent()) {
e.setCancelled(true);
e.getClickedBlock().getRelative(e.getBlockFace()).setType(Material.WATER);
e.getItem().setType(Material.BUCKET);
Expand Down Expand Up @@ -120,7 +121,7 @@ public void onPlayerTeleport(PlayerTeleportEvent e) {
* Checks is broken blocks cause the greenhouse to fail
* @param e - event
*/
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled=true)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
public void onBlockBreak(final BlockBreakEvent e) {
User user = User.getInstance(e.getPlayer());
plugin.getManager().getMap().getGreenhouse(e.getBlock().getLocation()).ifPresent(g -> {
Expand Down

0 comments on commit 228644d

Please sign in to comment.