User Tools

Site Tools


tutorial:waterloggable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:waterloggable [2022/12/16 02:12] solidblocktutorial:waterloggable [2023/09/06 08:21] (current) – Fix syntax error drakonkinst
Line 35: Line 35:
         return (BlockState)this.getDefaultState()         return (BlockState)this.getDefaultState()
             .with(Properties.HORIZONTAL_FACING, ctx.getPlayerFacing().getOpposite())             .with(Properties.HORIZONTAL_FACING, ctx.getPlayerFacing().getOpposite())
-            .with(WATERLOGGED, ctx.getWorld().getFluidState(ctx.getBlockPos()).getFluid() == Fluids.WATER);+            .with(WATERLOGGED, ctx.getWorld().getFluidState(ctx.getBlockPos()).isOf(Fluids.WATER));
     }     }
 </code> </code>
tutorial/waterloggable.1671156769.txt.gz · Last modified: 2022/12/16 02:12 by solidblock