ForgePatch/patches_old_unknown/BlockDynamicLiquid.java.patch

61 lines
3.4 KiB
Diff
Raw Normal View History

--- ../src-base/minecraft/net/minecraft/block/BlockDynamicLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDynamicLiquid.java
@@ -26,6 +26,7 @@
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
+ if (!p_180650_1_.func_175697_a(p_180650_2_, this.func_185698_b(p_180650_1_))) return; // Forge: avoid loading unloaded chunks
int i = ((Integer)p_180650_3_.func_177229_b(field_176367_b)).intValue();
int j = 1;
@@ -67,7 +68,7 @@
}
}
- if (this.field_149815_a >= 2 && this.field_149764_J == Material.field_151586_h)
+ if (this.field_149815_a >= 2 && net.minecraftforge.event.ForgeEventFactory.canCreateFluidSource(p_180650_1_, p_180650_2_, p_180650_3_, this.field_149764_J == Material.field_151586_h))
{
IBlockState iblockstate = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b());
@@ -118,7 +119,7 @@
{
if (this.field_149764_J == Material.field_151587_i && p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185904_a() == Material.field_151586_h)
{
- p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), Blocks.field_150348_b.func_176223_P());
+ p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, p_180650_2_.func_177977_b(), p_180650_2_, Blocks.field_150348_b.func_176223_P()));
this.func_180688_d(p_180650_1_, p_180650_2_.func_177977_b());
return;
}
@@ -166,6 +167,7 @@
}
else
{
+ if (p_176375_3_.func_177230_c() != Blocks.field_150431_aC) //Forge: Vanilla has a 'bug' where snowballs don't drop like every other block. So special case because ewww...
p_176375_3_.func_177230_c().func_176226_b(p_176375_1_, p_176375_2_, p_176375_3_, 0);
}
}
@@ -187,7 +189,7 @@
if (!this.func_176372_g(p_176374_1_, blockpos, iblockstate) && (iblockstate.func_185904_a() != this.field_149764_J || ((Integer)iblockstate.func_177229_b(field_176367_b)).intValue() > 0))
{
- if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), iblockstate))
+ if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), p_176374_1_.func_180495_p(blockpos.func_177977_b())))
{
return p_176374_3_;
}
@@ -254,11 +256,12 @@
private boolean func_176372_g(World p_176372_1_, BlockPos p_176372_2_, IBlockState p_176372_3_)
{
- Block block = p_176372_1_.func_180495_p(p_176372_2_).func_177230_c();
+ Block block = p_176372_3_.func_177230_c(); //Forge: state must be valid for position
+ Material mat = p_176372_3_.func_185904_a();
if (!(block instanceof BlockDoor) && block != Blocks.field_150472_an && block != Blocks.field_150468_ap && block != Blocks.field_150436_aH)
{
- return block.field_149764_J != Material.field_151567_E && block.field_149764_J != Material.field_189963_J ? block.field_149764_J.func_76230_c() : true;
+ return mat != Material.field_151567_E && mat != Material.field_189963_J ? mat.func_76230_c() : true;
}
else
{