Files

65 lines
2.8 KiB
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
@@ -284,15 +284,17 @@
if (integer.intValue() == 0)
{
- worldIn.setBlockState(pos, Blocks.OBSIDIAN.getDefaultState());
- this.triggerMixEffects(worldIn, pos);
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(worldIn, pos, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(worldIn, pos, pos, Blocks.OBSIDIAN.getDefaultState()), null)) {
+ this.triggerMixEffects(worldIn, pos);
+ }
return true;
}
if (integer.intValue() <= 4)
{
- worldIn.setBlockState(pos, Blocks.COBBLESTONE.getDefaultState());
- this.triggerMixEffects(worldIn, pos);
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(worldIn, pos, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(worldIn, pos, pos, Blocks.COBBLESTONE.getDefaultState()), null)) {
+ this.triggerMixEffects(worldIn, pos);
+ }
return true;
}
}
@@ -448,8 +450,39 @@
return (float)pos.getY() + getBlockLiquidHeight(state, worldIn, pos);
}
+ @Override
+ public float getBlockLiquidHeight(World world, BlockPos pos, IBlockState state, Material material)
+ {
+ return BlockLiquid.getBlockLiquidHeight(state, world, pos);
+ }
+
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face)
{
return BlockFaceShape.UNDEFINED;
}
+
+ @Override
+ @SideOnly (Side.CLIENT)
+ public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks)
+ {
+ Vec3d viewport = net.minecraft.client.renderer.ActiveRenderInfo.projectViewFromEntity(entity, partialTicks);
+
+ if (state.getMaterial().isLiquid())
+ {
+ float height = 0.0F;
+ if (state.getBlock() instanceof BlockLiquid)
+ {
+ height = getLiquidHeightPercent(state.getValue(LEVEL)) - 0.11111111F;
+ }
+ float f1 = (float) (pos.getY() + 1) - height;
+ if (viewport.y > (double)f1)
+ {
+ BlockPos upPos = pos.up();
+ IBlockState upState = world.getBlockState(upPos);
+ return upState.getBlock().getFogColor(world, upPos, upState, entity, originalColor, partialTicks);
+ }
+ }
+
+ return super.getFogColor(world, pos, state, entity, originalColor, partialTicks);
+ }
}