Liquid optimizations

This commit is contained in:
mathias 2018-12-21 11:27:50 +02:00
parent 4683cf3163
commit 6e50d3d8d1
2 changed files with 13 additions and 0 deletions

View file

@ -211,6 +211,17 @@ class Events implements Listener {
}
} else if (block.getType() == Material.SOIL) {
event.setCancelled(true);
} else if (block.getType() == Material.STATIONARY_WATER ||
block.getType() == Material.STATIONARY_LAVA) {
if (block.getRelative(BlockFace.UP).getType() == block.getType()) {
if (block.getRelative(BlockFace.DOWN).getType() != Material.AIR &&
block.getRelative(BlockFace.NORTH).getType() != Material.AIR &&
block.getRelative(BlockFace.SOUTH).getType() != Material.AIR &&
block.getRelative(BlockFace.WEST).getType() != Material.AIR &&
block.getRelative(BlockFace.EAST).getType() != Material.AIR) {
event.setCancelled(true);
}
}
} else if (main.nonSolidWallMountedBlockList.contains(block.getType())) {
World world = event.getBlock().getWorld();
int radius = 5;

View file

@ -19,6 +19,8 @@ import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;