Fix placing buckets of fish.

This commit is contained in:
Brianna 2020-10-15 16:09:59 -05:00
parent 9651fd0e1a
commit 600304b212

View File

@ -62,9 +62,13 @@ public class InteractListeners implements Listener {
IslandLevelManager levellingManager = plugin.getLevellingManager(); IslandLevelManager levellingManager = plugin.getLevellingManager();
if (!worldManager.isIslandWorld(block.getWorld())) return; if (!worldManager.isIslandWorld(block.getWorld())) return;
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && if (event.getAction() == Action.RIGHT_CLICK_BLOCK
worldManager.getIslandWorld(block.getWorld()).equals(IslandWorld.Nether) && && worldManager.getIslandWorld(block.getWorld()).equals(IslandWorld.Nether)
event.getItem().getType().equals(Material.WATER_BUCKET)) { && (event.getItem().getType().equals(Material.WATER_BUCKET)
|| event.getItem().getType().equals(Material.TROPICAL_FISH_BUCKET)
|| event.getItem().getType().equals(Material.COD_BUCKET)
|| event.getItem().getType().equals(Material.SALMON_BUCKET)
|| event.getItem().getType().equals(Material.PUFFERFISH_BUCKET))) {
Location blockLoc = block.getLocation(); Location blockLoc = block.getLocation();
Island island = islandManager.getIslandAtLocation(blockLoc); Island island = islandManager.getIslandAtLocation(blockLoc);
@ -121,14 +125,8 @@ public class InteractListeners implements Listener {
return; return;
} }
if (configLoad.getBoolean("Island.Nether.AllowNetherWater", false)) { if (configLoad.getBoolean("Island.Nether.AllowNetherWater", false))
event.setCancelled(true);
block.setType(Material.WATER, true); block.setType(Material.WATER, true);
block.getWorld().playSound(block.getLocation(), CompatibleSound.ITEM_BUCKET_EMPTY.getSound(), 1f, 1f);
if (!event.getPlayer().getGameMode().equals(GameMode.CREATIVE)) {
event.getItem().setType(Material.BUCKET);
}
}
} }
} }