Browse Source

PaperSpigot fix (0f7e4b9c5b)

master
Robotia 9 years ago
parent
commit
054ad28068
  1. 41
      patches/net/minecraft/block/BlockDynamicLiquid.java.patch

41
patches/net/minecraft/block/BlockDynamicLiquid.java.patch

@ -34,6 +34,10 @@
+ if(net.minecraft.server.MinecraftServer.getServer().cauldronConfig.infiniteWaterSource.getValue()) + if(net.minecraft.server.MinecraftServer.getServer().cauldronConfig.infiniteWaterSource.getValue())
{ {
- if (p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial().isSolid()) - if (p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial().isSolid())
- {
- j1 = 0;
- }
- else if (p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial() == this.blockMaterial && p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == 0)
+ if (this.field_149815_a >= 2 && this.blockMaterial == Material.water) + if (this.field_149815_a >= 2 && this.blockMaterial == Material.water)
{ {
- j1 = 0; - j1 = 0;
@ -46,10 +50,6 @@
+ j1 = 0; + j1 = 0;
+ } + }
} }
- else if (p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial() == this.blockMaterial && p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == 0)
- {
- j1 = 0;
- }
} }
+ // Cauldron end + // Cauldron end
@ -69,26 +69,31 @@
} }
else else
{ {
@@ -113,21 +136,34 @@ @@ -113,21 +136,35 @@
if (this.func_149809_q(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_)) if (this.func_149809_q(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_))
{ {
- if (this.blockMaterial == Material.lava && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial() == Material.water) - if (this.blockMaterial == Material.lava && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial() == Material.water)
- {
- p_149674_1_.setBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_, Blocks.stone);
- this.func_149799_m(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_);
- return;
- }
+ if (p_149674_1_.getType(p_149674_2_, p_149674_3_, p_149674_4_).getMaterial() != this.blockMaterial) { return; } // PaperSpigot - Stop updating flowing block if material has changed
+ // CraftBukkit start - Send "down" to the server + // CraftBukkit start - Send "down" to the server
+ BlockFromToEvent event = new BlockFromToEvent(source, BlockFace.DOWN); + BlockFromToEvent event = new BlockFromToEvent(source, BlockFace.DOWN);
+
- if (l >= 8)
+ if (server != null) + if (server != null)
{ {
- p_149674_1_.setBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_, Blocks.stone); - this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, l);
- this.func_149799_m(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_);
- return;
+ server.getPluginManager().callEvent(event); + server.getPluginManager().callEvent(event);
} }
- else
- if (l >= 8) +
+ if (!event.isCancelled()) + if (!event.isCancelled())
{ {
- this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, l); - this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, l + 8);
+ if (this.blockMaterial == Material.lava && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial() == Material.water) + if (this.blockMaterial == Material.lava && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial() == Material.water)
+ { + {
+ p_149674_1_.setBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_, Blocks.stone); + p_149674_1_.setBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_, Blocks.stone);
@ -105,16 +110,12 @@
+ this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, l + 8); + this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, l + 8);
+ } + }
} }
- else
- {
- this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, l + 8);
- }
+ +
+ // CraftBukkit end + // CraftBukkit end
} }
else if (l >= 0 && (l == 0 || this.func_149807_p(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_))) else if (l >= 0 && (l == 0 || this.func_149807_p(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_)))
{ {
@@ -144,25 +180,31 @@ @@ -144,25 +181,31 @@
return; return;
} }
@ -160,3 +161,9 @@
} }
} }
@@ -351,4 +394,4 @@
{
return true;
}
-}
+}

Loading…
Cancel
Save