1414import net .minecraft .server .level .ServerLevel ;
1515import net .minecraft .server .level .ServerPlayer ;
1616import net .minecraft .tags .BlockTags ;
17+ import net .minecraft .tags .FluidTags ;
1718import net .minecraft .util .Util ;
1819import net .minecraft .world .InteractionResult ;
1920import net .minecraft .world .entity .ai .village .poi .PoiManager ;
3031import net .minecraft .world .level .block .state .properties .BlockStateProperties ;
3132import net .minecraft .world .level .block .state .properties .BooleanProperty ;
3233import net .minecraft .world .level .levelgen .Heightmap ;
34+ import net .minecraft .world .level .material .FluidState ;
3335import net .minecraft .world .level .material .Fluids ;
3436import net .minecraft .world .phys .BlockHitResult ;
3537import net .minecraft .world .phys .shapes .CollisionContext ;
@@ -67,7 +69,7 @@ public class TeleportPad extends Block implements SimpleWaterloggedBlock {
6769
6870 public TeleportPad (Properties properties ) {
6971 super (properties .strength (3.0F ));
70- this .registerDefaultState (this .defaultBlockState ().setValue (TeleportPad .SPAWNED , false ));
72+ this .registerDefaultState (this .defaultBlockState ().setValue (TeleportPad .WATERLOGGED , false ). setValue ( TeleportPad . SPAWNED , false ));
7173 }
7274
7375 private static int getDestinationMode () {
@@ -80,7 +82,13 @@ private static boolean isTweaksLoaded() {
8082
8183 @ Override
8284 public BlockState getStateForPlacement (BlockPlaceContext context ) {
83- return this .defaultBlockState ().setValue (TeleportPad .WATERLOGGED , context .getLevel ().getFluidState (context .getClickedPos ()).is (Fluids .WATER ));
85+ FluidState state = context .getLevel ().getFluidState (context .getClickedPos ());
86+ return this .defaultBlockState ().setValue (TeleportPad .WATERLOGGED , state .is (FluidTags .WATER ) && state .isFull ());
87+ }
88+
89+ @ Override
90+ protected FluidState getFluidState (BlockState state ) {
91+ return state .getValue (TeleportPad .WATERLOGGED ) ? Fluids .WATER .getSource (false ) : super .getFluidState (state );
8492 }
8593
8694 @ Override
0 commit comments