Package com.hbm_m.block.machines
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.BlockStatePairKeyNested 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
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.world.level.block.state.properties.BooleanPropertystatic final net.minecraft.world.level.block.state.properties.BooleanPropertystatic final net.minecraft.world.level.block.state.properties.BooleanPropertystatic 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.BooleanPropertystatic final net.minecraft.world.level.block.state.properties.BooleanPropertystatic final net.minecraft.world.level.block.state.properties.BooleanPropertyFields 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_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsConstructorDescriptionFluidDuctBlock(net.minecraft.world.level.block.state.BlockBehaviour.Properties properties, PipeStyle pipeStyle) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateBlockStateDefinition(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.ItemStackgetCloneItemStack(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.BlockStategetConnectionState(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos) Full connection + render shape for a duct atpos(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.RenderShapegetRenderShape(net.minecraft.world.level.block.state.BlockState state) net.minecraft.world.phys.shapes.VoxelShapegetShape(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.BlockStategetStateForPlacement(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) voidneighborChanged(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.BlockEntitynewBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) voidonPlace(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 voidpaintConnectedDuctNetwork(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.voidprintHook(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) static voidrefreshAdjacentDucts(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Refresh duct render connections aroundpos.voidtick(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.BlockStateupdateShape(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.InteractionResultuse(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, triggerEventMethods 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, withPropertiesOfMethods 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, useShapeForLightOcclusionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.block.EntityBlock
getListenerMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods 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
-
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:
createBlockStateDefinitionin classnet.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:
getShapein classnet.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 atpos(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:
getStateForPlacementin classnet.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:
updateShapein classnet.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:
onPlacein classnet.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:
neighborChangedin classnet.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:
tickin classnet.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 aroundpos.Важно для мультиблок-коннекторов: метод может вызываться как с позиции самой трубы, так и с позиции соседнего 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:
usein classnet.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 fromFluidIdentifierItem.useOn(net.minecraft.world.item.context.UseOnContext)because itemuseOnruns 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:
newBlockEntityin interfacenet.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:
getTickerin interfacenet.minecraft.world.level.block.EntityBlock
-
getRenderShape
public net.minecraft.world.level.block.RenderShape getRenderShape(@NotNull net.minecraft.world.level.block.state.BlockState state) - Overrides:
getRenderShapein classnet.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:
getCloneItemStackin classnet.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:
getDropsin classnet.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:
printHookin interfaceILookOverlay
-