Fix liquids stuck in fast drain loop

This commit is contained in:
Byteflux
2015-07-03 12:38:43 -07:00
parent 811b3406a3
commit bc9a97a7a3

View File

@@ -44,34 +44,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */ + */
+ public boolean canFastDrain(World world, BlockPosition position) { + public boolean canFastDrain(World world, BlockPosition position) {
+ boolean result = false; + boolean result = false;
+ int data = getData(world, position);
+ if (this.material == Material.WATER) { + if (this.material == Material.WATER) {
+ if (world.paperSpigotConfig.fastDrainWater) { + if (world.paperSpigotConfig.fastDrainWater) {
+ result = true; + result = true;
+ if (getData(world, position.down()) < 0) { + if (getData(world, position.down()) < 0) {
+ result = false; + result = false;
+ } else if (world.getType(position.north()).getBlock().getMaterial() == Material.WATER && getData(world, position.north()) < 1) { + } else if (world.getType(position.north()).getBlock().getMaterial() == Material.WATER && getData(world, position.north()) < data) {
+ result = false; + result = false;
+ } else if (world.getType(position.south()).getBlock().getMaterial() == Material.WATER && getData(world, position.south()) < 1) { + } else if (world.getType(position.south()).getBlock().getMaterial() == Material.WATER && getData(world, position.south()) < data) {
+ result = false; + result = false;
+ } else if (world.getType(position.west()).getBlock().getMaterial() == Material.WATER && getData(world, position.west()) < 1) { + } else if (world.getType(position.west()).getBlock().getMaterial() == Material.WATER && getData(world, position.west()) < data) {
+ result = false; + result = false;
+ } else if (world.getType(position.east()).getBlock().getMaterial() == Material.WATER && getData(world, position.east()) < 1) { + } else if (world.getType(position.east()).getBlock().getMaterial() == Material.WATER && getData(world, position.east()) < data) {
+ result = false; + result = false;
+ } + }
+ } + }
+ } else if (this.material == Material.LAVA) { + } else if (this.material == Material.LAVA) {
+ if (world.paperSpigotConfig.fastDrainLava) { + if (world.paperSpigotConfig.fastDrainLava) {
+ Material m;
+ result = true; + result = true;
+ if (getData(world, position.down()) < 0) { + if (getData(world, position.down()) < 0 || world.getType(position.up()).getBlock().getMaterial() != Material.AIR) {
+ result = false; + result = false;
+ } else if ((m = world.getType(position.north()).getBlock().getMaterial()) == Material.WATER || (m == Material.LAVA && getData(world, position.north()) < 1)) { + } else if (world.getType(position.north()).getBlock().getMaterial() == Material.LAVA && getData(world, position.north()) < data) {
+ result = false; + result = false;
+ } else if ((m = world.getType(position.south()).getBlock().getMaterial()) == Material.WATER || (m == Material.LAVA && getData(world, position.south()) < 1)) { + } else if (world.getType(position.south()).getBlock().getMaterial() == Material.LAVA && getData(world, position.south()) < data) {
+ result = false; + result = false;
+ } else if ((m = world.getType(position.west()).getBlock().getMaterial()) == Material.WATER || (m == Material.LAVA && getData(world, position.west()) < 1)) { + } else if (world.getType(position.west()).getBlock().getMaterial() == Material.LAVA && getData(world, position.west()) < data) {
+ result = false; + result = false;
+ } else if ((m = world.getType(position.east()).getBlock().getMaterial()) == Material.WATER || (m == Material.LAVA && getData(world, position.east()) < 1)) { + } else if (world.getType(position.east()).getBlock().getMaterial() == Material.LAVA && getData(world, position.east()) < data) {
+ result = false; + result = false;
+ } + }
+ } + }