mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 01:39:52 +03:00
65 lines
2.8 KiB
Diff
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);
|
|
+ }
|
|
}
|