Class FluidDuctBlock

java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.BaseEntityBlock
com.hbm_m.block.machines.FluidDuctBlock
All Implemented Interfaces:
ILookOverlay, net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.block.EntityBlock, net.minecraft.world.level.ItemLike, net.minecraftforge.common.extensions.IForgeBlock

public class FluidDuctBlock extends net.minecraft.world.level.block.BaseEntityBlock implements ILookOverlay
Fluid duct: multipart blockstate + Forge OBJ visibility on pipe_neo.obj. Fluid type lives in the block entity. Fluid identifier: normal click sets fluid on one duct; sneak (Shift) + click paints the connected network of the same block type (depth-capped). Vanilla does not expose Ctrl on the server; use sneak for recursive mode.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block

    net.minecraft.world.level.block.Block.BlockStatePairKey

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour

    net.minecraft.world.level.block.state.BlockBehaviour.BlockStateBase, net.minecraft.world.level.block.state.BlockBehaviour.OffsetFunction, net.minecraft.world.level.block.state.BlockBehaviour.OffsetType, net.minecraft.world.level.block.state.BlockBehaviour.Properties, net.minecraft.world.level.block.state.BlockBehaviour.StateArgumentPredicate<A extends Object>, net.minecraft.world.level.block.state.BlockBehaviour.StatePredicate
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.world.level.block.state.properties.BooleanProperty
     
    static final net.minecraft.world.level.block.state.properties.BooleanProperty
     
    static final net.minecraft.world.level.block.state.properties.BooleanProperty
     
    static final Map<net.minecraft.core.Direction,net.minecraft.world.level.block.state.properties.BooleanProperty>
     
    static final net.minecraft.world.level.block.state.properties.EnumProperty<PipeRenderShape>
     
    static final net.minecraft.world.level.block.state.properties.BooleanProperty
     
    static final net.minecraft.world.level.block.state.properties.BooleanProperty
     
    static final net.minecraft.world.level.block.state.properties.BooleanProperty
     

    Fields inherited from class net.minecraft.world.level.block.Block

    BLOCK_STATE_REGISTRY, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SUPPRESS_DROPS

    Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour

    drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDER

    Fields inherited from interface net.minecraft.world.flag.FeatureElement

    FILTERED_REGISTRIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    FluidDuctBlock(net.minecraft.world.level.block.state.BlockBehaviour.Properties properties, PipeStyle pipeStyle)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    createBlockStateDefinition(net.minecraft.world.level.block.state.StateDefinition.Builder<net.minecraft.world.level.block.Block,net.minecraft.world.level.block.state.BlockState> builder)
     
    net.minecraft.world.item.ItemStack
    getCloneItemStack(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
    net.minecraft.world.level.block.state.BlockState
    getConnectionState(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos)
    Full connection + render shape for a duct at pos (block there must be this block type).
    List<net.minecraft.world.item.ItemStack>
    getDrops(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.storage.loot.LootParams.Builder builder)
     
     
    net.minecraft.world.level.block.RenderShape
    getRenderShape(net.minecraft.world.level.block.state.BlockState state)
     
    net.minecraft.world.phys.shapes.VoxelShape
    getShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.CollisionContext context)
     
    net.minecraft.world.level.block.state.BlockState
    getStateForPlacement(net.minecraft.world.item.context.BlockPlaceContext ctx)
    Убирает 1-кадровый "isolated" глитч при постановке: сразу ставим корректный blockstate соединений.
    <T extends net.minecraft.world.level.block.entity.BlockEntity>
    net.minecraft.world.level.block.entity.BlockEntityTicker<T>
    getTicker(net.minecraft.world.level.Level level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.entity.BlockEntityType<T> type)
     
    void
    neighborChanged(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.Block block, net.minecraft.core.BlockPos fromPos, boolean isMoving)
     
    net.minecraft.world.level.block.entity.BlockEntity
    newBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
    void
    onPlace(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState oldState, boolean movedByPiston)
     
    static void
    paintConnectedDuctNetwork(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos start, net.minecraft.world.level.material.Fluid fluid)
    Shift + fluid identifier on a duct: paints the whole connected network of the same duct block type.
    void
    printHook(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
     
    static void
    refreshAdjacentDucts(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Refresh duct render connections around pos.
    void
    tick(net.minecraft.world.level.block.state.BlockState state, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource random)
     
    net.minecraft.world.level.block.state.BlockState
    updateShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.Direction facing, net.minecraft.world.level.block.state.BlockState facingState, net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos currentPos, net.minecraft.core.BlockPos facingPos)
     
    net.minecraft.world.InteractionResult
    use(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.phys.BlockHitResult hit)
     

    Methods inherited from class net.minecraft.world.level.block.BaseEntityBlock

    createTickerHelper, getMenuProvider, triggerEvent

    Methods inherited from class net.minecraft.world.level.block.Block

    animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf

    Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour

    attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getOcclusionShape, getSeed, getShadeBrightness, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, isSignalSource, mirror, onProjectileHit, onRemove, randomTick, requiredFeatures, rotate, skipRendering, spawnAfterBreak, updateIndirectNeighbourShapes, useShapeForLightOcclusion

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.level.block.EntityBlock

    getListener

    Methods inherited from interface net.minecraft.world.flag.FeatureElement

    isEnabled

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlock

    addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hidesNeighborFace, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isValidSpawn, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHiding
  • Field Details

    • NORTH

      public static final net.minecraft.world.level.block.state.properties.BooleanProperty NORTH
    • EAST

      public static final net.minecraft.world.level.block.state.properties.BooleanProperty EAST
    • SOUTH

      public static final net.minecraft.world.level.block.state.properties.BooleanProperty SOUTH
    • WEST

      public static final net.minecraft.world.level.block.state.properties.BooleanProperty WEST
    • UP

      public static final net.minecraft.world.level.block.state.properties.BooleanProperty UP
    • DOWN

      public static final net.minecraft.world.level.block.state.properties.BooleanProperty DOWN
    • SHAPE

      public static final net.minecraft.world.level.block.state.properties.EnumProperty<PipeRenderShape> SHAPE
    • PROPERTY_BY_DIRECTION

      public static final Map<net.minecraft.core.Direction,net.minecraft.world.level.block.state.properties.BooleanProperty> PROPERTY_BY_DIRECTION
  • Constructor Details

    • FluidDuctBlock

      public FluidDuctBlock(net.minecraft.world.level.block.state.BlockBehaviour.Properties properties, PipeStyle pipeStyle)
  • Method Details

    • getPipeStyle

      public PipeStyle getPipeStyle()
    • createBlockStateDefinition

      protected void createBlockStateDefinition(net.minecraft.world.level.block.state.StateDefinition.Builder<net.minecraft.world.level.block.Block,net.minecraft.world.level.block.state.BlockState> builder)
      Overrides:
      createBlockStateDefinition in class net.minecraft.world.level.block.Block
    • getShape

      public net.minecraft.world.phys.shapes.VoxelShape getShape(@NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.world.level.BlockGetter level, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.phys.shapes.CollisionContext context)
      Overrides:
      getShape in class net.minecraft.world.level.block.state.BlockBehaviour
    • getConnectionState

      public net.minecraft.world.level.block.state.BlockState getConnectionState(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos)
      Full connection + render shape for a duct at pos (block there must be this block type).
    • getStateForPlacement

      @Nullable public net.minecraft.world.level.block.state.BlockState getStateForPlacement(@NotNull net.minecraft.world.item.context.BlockPlaceContext ctx)
      Убирает 1-кадровый "isolated" глитч при постановке: сразу ставим корректный blockstate соединений.
      Overrides:
      getStateForPlacement in class net.minecraft.world.level.block.Block
    • updateShape

      public net.minecraft.world.level.block.state.BlockState updateShape(@NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.core.Direction facing, @NotNull net.minecraft.world.level.block.state.BlockState facingState, @NotNull net.minecraft.world.level.LevelAccessor level, @NotNull net.minecraft.core.BlockPos currentPos, @NotNull net.minecraft.core.BlockPos facingPos)
      Overrides:
      updateShape in class net.minecraft.world.level.block.state.BlockBehaviour
    • onPlace

      public void onPlace(@NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.block.state.BlockState oldState, boolean movedByPiston)
      Overrides:
      onPlace in class net.minecraft.world.level.block.state.BlockBehaviour
    • neighborChanged

      public void neighborChanged(@NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.block.Block block, @NotNull net.minecraft.core.BlockPos fromPos, boolean isMoving)
      Overrides:
      neighborChanged in class net.minecraft.world.level.block.state.BlockBehaviour
    • tick

      public void tick(@NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.server.level.ServerLevel level, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.util.RandomSource random)
      Overrides:
      tick in class net.minecraft.world.level.block.state.BlockBehaviour
    • refreshAdjacentDucts

      public static void refreshAdjacentDucts(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Refresh duct render connections around pos.

      Важно для мультиблок-коннекторов: метод может вызываться как с позиции самой трубы, так и с позиции соседнего UniversalMachinePartBlockEntity. Поэтому обновляем все duct-блоки вокруг переданной позиции, а потом их соседей.

    • use

      public net.minecraft.world.InteractionResult use(@NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.InteractionHand hand, @NotNull net.minecraft.world.phys.BlockHitResult hit)
      Overrides:
      use in class net.minecraft.world.level.block.state.BlockBehaviour
    • paintConnectedDuctNetwork

      public static void paintConnectedDuctNetwork(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos start, net.minecraft.world.level.material.Fluid fluid)
      Shift + fluid identifier on a duct: paints the whole connected network of the same duct block type. Used from FluidIdentifierItem.useOn(net.minecraft.world.item.context.UseOnContext) because item useOn runs before block use and must consume the interaction so it is not confused with other UI.
    • newBlockEntity

      @Nullable public net.minecraft.world.level.block.entity.BlockEntity newBlockEntity(@NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.block.state.BlockState state)
      Specified by:
      newBlockEntity in interface net.minecraft.world.level.block.EntityBlock
    • getTicker

      @Nullable public <T extends net.minecraft.world.level.block.entity.BlockEntity> net.minecraft.world.level.block.entity.BlockEntityTicker<T> getTicker(@NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.world.level.block.entity.BlockEntityType<T> type)
      Specified by:
      getTicker in interface net.minecraft.world.level.block.EntityBlock
    • getRenderShape

      public net.minecraft.world.level.block.RenderShape getRenderShape(@NotNull net.minecraft.world.level.block.state.BlockState state)
      Overrides:
      getRenderShape in class net.minecraft.world.level.block.BaseEntityBlock
    • getCloneItemStack

      @NotNull public net.minecraft.world.item.ItemStack getCloneItemStack(@NotNull net.minecraft.world.level.BlockGetter level, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.block.state.BlockState state)
      Overrides:
      getCloneItemStack in class net.minecraft.world.level.block.Block
    • getDrops

      public List<net.minecraft.world.item.ItemStack> getDrops(@NotNull net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.storage.loot.LootParams.Builder builder)
      Overrides:
      getDrops in class net.minecraft.world.level.block.state.BlockBehaviour
    • printHook

      public void printHook(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Specified by:
      printHook in interface ILookOverlay