Class PressureTubeBlock

java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
All Implemented Interfaces:
IPneumaticWrenchable, ITubeNetworkConnector, IPneumaticCraftProbeable, PneumaticCraftEntityBlock, net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.block.BucketPickup, net.minecraft.world.level.block.EntityBlock, net.minecraft.world.level.block.LiquidBlockContainer, net.minecraft.world.level.block.SimpleWaterloggedBlock, net.minecraft.world.level.ItemLike, net.minecraftforge.common.extensions.IForgeBlock, net.minecraftforge.common.extensions.IForgeBucketPickup

public class PressureTubeBlock extends AbstractCamouflageBlock implements net.minecraft.world.level.block.SimpleWaterloggedBlock, PneumaticCraftEntityBlock, ITubeNetworkConnector
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Stores information about the subpart of a pressure tube that is being looked at or interacted with.

    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 int
     
    static final int
     

    Fields inherited from class me.desht.pneumaticcraft.common.block.AbstractCamouflageBlock

    BLOCK_ACCESS, BLOCK_POS, CAMO_STATE

    Fields inherited from class me.desht.pneumaticcraft.common.block.AbstractPneumaticCraftBlock

    CONNECTION_PROPERTIES, DOWN, EAST, NORTH, SOUTH, UP, WEST

    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
    PressureTubeBlock(BiFunction<net.minecraft.core.BlockPos,net.minecraft.world.level.block.state.BlockState,? extends PressureTubeBlockEntity> teFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canConnectToNetwork(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction dir, net.minecraft.world.level.block.state.BlockState state)
    Called when a network is being scanned.
    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.block.state.BlockState state, net.minecraft.world.phys.HitResult target, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
     
    getFocusedModule(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
    Get the tube module being looked at by the player, if any.
    int
    getSignal(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter par1IBlockAccess, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
     
    net.minecraft.world.level.block.state.BlockState
    getStateForPlacement(net.minecraft.world.item.context.BlockPlaceContext ctx)
     
    net.minecraft.world.phys.shapes.VoxelShape
    getUncamouflagedShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter reader, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.CollisionContext ctx)
    The equivalent of BlockBehaviour.getShape(BlockState, BlockGetter, BlockPos, CollisionContext), but for uncamouflaged camo blocks.
    boolean
    isSignalSource(net.minecraft.world.level.block.state.BlockState state)
     
    protected boolean
     
    net.minecraft.world.level.block.state.BlockState
    mirror(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.Mirror mirrorIn)
     
    net.minecraft.world.level.block.entity.BlockEntity
    newBlockEntity(net.minecraft.core.BlockPos pPos, net.minecraft.world.level.block.state.BlockState pState)
     
    void
    onRemove(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState newState, boolean isMoving)
     
    boolean
    onWrenched(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand)
     
    static net.minecraft.world.level.block.state.BlockState
    recalculateState(net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos currentPos, net.minecraft.world.level.block.state.BlockState stateIn)
     
    net.minecraft.world.level.block.state.BlockState
    rotate(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.Rotation rotation)
     
    void
    setPlacedBy(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack)
     
    boolean
    tryPlaceModule(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand, boolean simulate)
     
    net.minecraft.world.level.block.state.BlockState
    updateShape(net.minecraft.world.level.block.state.BlockState stateIn, net.minecraft.core.Direction facing, net.minecraft.world.level.block.state.BlockState facingState, net.minecraft.world.level.LevelAccessor worldIn, 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 world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.phys.BlockHitResult brtr)
     

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

    animateTick, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, handlePrecipitation, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerWillDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, 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, getBlockSupportShape, getDestroyProgress, getDirectSignal, getDrops, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getSeed, getShadeBrightness, getVisualShape, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, onPlace, onProjectileHit, randomTick, requiredFeatures, skipRendering, spawnAfterBreak, tick, triggerEvent, 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, 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, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHiding

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

    getPickupSound

    Methods inherited from interface me.desht.pneumaticcraft.common.block.PneumaticCraftEntityBlock

    getTicker

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

    canPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
  • Field Details

  • Constructor Details

    • PressureTubeBlock

      public PressureTubeBlock(BiFunction<net.minecraft.core.BlockPos,net.minecraft.world.level.block.state.BlockState,? extends PressureTubeBlockEntity> teFactory)
  • Method Details

    • isWaterloggable

      protected boolean isWaterloggable()
      Overrides:
      isWaterloggable in class AbstractPneumaticCraftBlock
    • newBlockEntity

      @Nullable public net.minecraft.world.level.block.entity.BlockEntity newBlockEntity(net.minecraft.core.BlockPos pPos, net.minecraft.world.level.block.state.BlockState pState)
      Specified by:
      newBlockEntity in interface net.minecraft.world.level.block.EntityBlock
    • 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 AbstractPneumaticCraftBlock
    • getStateForPlacement

      @Nullable public net.minecraft.world.level.block.state.BlockState getStateForPlacement(net.minecraft.world.item.context.BlockPlaceContext ctx)
      Overrides:
      getStateForPlacement in class AbstractPneumaticCraftBlock
    • updateShape

      public net.minecraft.world.level.block.state.BlockState updateShape(net.minecraft.world.level.block.state.BlockState stateIn, net.minecraft.core.Direction facing, net.minecraft.world.level.block.state.BlockState facingState, net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos currentPos, net.minecraft.core.BlockPos facingPos)
      Overrides:
      updateShape in class AbstractPneumaticCraftBlock
    • recalculateState

      public static net.minecraft.world.level.block.state.BlockState recalculateState(net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos currentPos, net.minecraft.world.level.block.state.BlockState stateIn)
    • getUncamouflagedShape

      public net.minecraft.world.phys.shapes.VoxelShape getUncamouflagedShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter reader, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.CollisionContext ctx)
      Description copied from class: AbstractCamouflageBlock
      The equivalent of BlockBehaviour.getShape(BlockState, BlockGetter, BlockPos, CollisionContext), but for uncamouflaged camo blocks.
      Specified by:
      getUncamouflagedShape in class AbstractCamouflageBlock
      Parameters:
      state - the blockstate
      reader - the world
      pos - the block pos
      ctx - the selection context
      Returns:
      the block's actual shape, when it isn't camouflaged
    • use

      public net.minecraft.world.InteractionResult use(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.phys.BlockHitResult brtr)
      Overrides:
      use in class AbstractPneumaticCraftBlock
    • setPlacedBy

      public void setPlacedBy(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack)
      Overrides:
      setPlacedBy in class AbstractPneumaticCraftBlock
    • tryPlaceModule

      public boolean tryPlaceModule(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand, boolean simulate)
    • getFocusedModule

      public static AbstractTubeModule getFocusedModule(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
      Get the tube module being looked at by the player, if any.
      Parameters:
      world - the world
      pos - the blockpos
      player - the player
      Returns:
      a tube module, or null if no module is focused
    • getCloneItemStack

      public net.minecraft.world.item.ItemStack getCloneItemStack(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.phys.HitResult target, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
      Specified by:
      getCloneItemStack in interface net.minecraftforge.common.extensions.IForgeBlock
    • onWrenched

      public boolean onWrenched(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand)
      Specified by:
      onWrenched in interface IPneumaticWrenchable
      Overrides:
      onWrenched in class AbstractPneumaticCraftBlock
    • onRemove

      public void onRemove(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState newState, boolean isMoving)
      Overrides:
      onRemove in class AbstractPneumaticCraftBlock
    • getSignal

      public int getSignal(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter par1IBlockAccess, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
      Overrides:
      getSignal in class net.minecraft.world.level.block.state.BlockBehaviour
    • isSignalSource

      public boolean isSignalSource(net.minecraft.world.level.block.state.BlockState state)
      Overrides:
      isSignalSource in class net.minecraft.world.level.block.state.BlockBehaviour
    • rotate

      public net.minecraft.world.level.block.state.BlockState rotate(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.Rotation rotation)
      Overrides:
      rotate in class AbstractPneumaticCraftBlock
    • mirror

      public net.minecraft.world.level.block.state.BlockState mirror(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.Mirror mirrorIn)
      Overrides:
      mirror in class AbstractPneumaticCraftBlock
    • canConnectToNetwork

      public boolean canConnectToNetwork(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction dir, net.minecraft.world.level.block.state.BlockState state)
      Description copied from interface: ITubeNetworkConnector
      Called when a network is being scanned. Check if the block at the given position can connect to a tube module network in the given direction. This may be as simple as just checking a blockstate property; the blockstate at the position is passed for convenience. If that is not sufficient, the level and position are available in case of the need for a block entity query.
      Specified by:
      canConnectToNetwork in interface ITubeNetworkConnector
      Parameters:
      level - the world
      pos - block position in question
      dir - the direction to be connected to
      state - the blockstate at the given position
      Returns:
      true if this block should form part of the module network, false otherwise