Class AbstractBlockGate

java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.DoorBlock
com.minecolonies.api.blocks.decorative.AbstractBlockGate
All Implemented Interfaces:
net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.block.LiquidBlockContainer, net.minecraft.world.level.ItemLike, net.neoforged.neoforge.common.extensions.IBlockExtension
Direct Known Subclasses:
BlockGate

public abstract class AbstractBlockGate extends net.minecraft.world.level.block.DoorBlock implements net.minecraft.world.level.block.LiquidBlockContainer
Block as one big door
  • 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>, net.minecraft.world.level.block.state.BlockBehaviour.StatePredicate
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final net.minecraft.world.phys.shapes.VoxelShape
    The bounding boxes.
    static final String
    Variant reg names
    protected static final net.minecraft.world.phys.shapes.VoxelShape
     
    static final String
     

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

    AABB_DOOR_THICKNESS, CODEC, EAST_AABB, FACING, HALF, HINGE, NORTH_AABB, OPEN, POWERED, SOUTH_AABB, WEST_AABB

    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
    AbstractBlockGate(String name, float hardness, int maxWidth, int maxHeight)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canPlaceLiquid(@Nullable net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.level.BlockGetter blockGetter, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.world.level.material.Fluid fluid)
     
    boolean
    canSurvive(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader worldIn, net.minecraft.core.BlockPos pos)
     
    float
    getBlockHardness(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter worldIn, net.minecraft.core.BlockPos pos)
    Deprecated.
    net.minecraft.world.phys.shapes.VoxelShape
    getCollisionShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.CollisionContext context)
     
    int
     
    int
     
    net.minecraft.world.phys.shapes.VoxelShape
    getOcclusionShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter worldIn, net.minecraft.core.BlockPos pos)
     
    net.minecraft.world.level.block.RenderShape
    getRenderShape(net.minecraft.world.level.block.state.BlockState state)
     
    @NotNull net.minecraft.world.phys.shapes.VoxelShape
    getShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter worldIn, 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 context)
     
    void
    neighborChanged(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level worldIn, @NotNull net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.Block blockIn, net.minecraft.core.BlockPos fromPos, boolean isMoving)
    Mostly redstone stuff for opening
    boolean
    placeLiquid(@NotNull net.minecraft.world.level.LevelAccessor accessor, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull net.minecraft.world.level.material.FluidState fluid)
     
    net.minecraft.world.level.block.state.BlockState
    playerWillDestroy(net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.player.Player player)
     
    registerBlock(net.minecraft.core.Registry<net.minecraft.world.level.block.Block> registry)
    Registery block at gameregistry.
    void
    registerBlockItem(net.minecraft.core.Registry<net.minecraft.world.item.Item> registry, net.minecraft.world.item.Item.Properties properties)
    Registery block at gameregistry.
    int
    removeGate(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos startPos, net.minecraft.core.Direction facing)
    Removes the whole gate blocks
    void
    setOpen(@Nullable net.minecraft.world.entity.Entity p_153166_, net.minecraft.world.level.Level worldIn, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, boolean open)
     
    void
    setPlacedBy(@NotNull net.minecraft.world.level.Level worldIn, @NotNull net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.LivingEntity placer, net.minecraft.world.item.ItemStack stack)
     
    void
    toggleGate(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos clickedBlock, net.minecraft.core.Direction facing)
    Used for activating the gate.
    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)
     
    protected net.minecraft.world.ItemInteractionResult
    useItemOn(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand handIn, net.minecraft.world.phys.BlockHitResult hit)
     

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

    codec, createBlockStateDefinition, getSeed, isOpen, isPathfindable, isWoodenDoor, isWoodenDoor, mirror, onExplosionHit, playSound, rotate, type, useWithoutItem

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

    animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, popExperience, popResource, popResourceFromFace, 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, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getShadeBrightness, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isRandomlyTicking, isSignalSource, onPlace, onProjectileHit, onRemove, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, simpleCodec, 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.flag.FeatureElement

    isEnabled

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension

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

    • IRON_GATE

      public static final String IRON_GATE
      Variant reg names
      See Also:
    • WOODEN_GATE

      public static final String WOODEN_GATE
      See Also:
    • E_W_SHAPE

      protected static final net.minecraft.world.phys.shapes.VoxelShape E_W_SHAPE
      The bounding boxes.
    • N_S_SHAPE

      protected static final net.minecraft.world.phys.shapes.VoxelShape N_S_SHAPE
  • Constructor Details

    • AbstractBlockGate

      public AbstractBlockGate(String name, float hardness, int maxWidth, int maxHeight)
  • Method Details

    • getMaxWidth

      public int getMaxWidth()
    • getMaxHeight

      public int getMaxHeight()
    • useItemOn

      protected net.minecraft.world.ItemInteractionResult useItemOn(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand handIn, net.minecraft.world.phys.BlockHitResult hit)
      Overrides:
      useItemOn in class net.minecraft.world.level.block.state.BlockBehaviour
    • playerWillDestroy

      public net.minecraft.world.level.block.state.BlockState playerWillDestroy(net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.player.Player player)
      Overrides:
      playerWillDestroy in class net.minecraft.world.level.block.DoorBlock
    • removeGate

      public int removeGate(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos startPos, net.minecraft.core.Direction facing)
      Removes the whole gate blocks
      Parameters:
      world - world to use
      startPos - start pos
      facing - gate facing
      Returns:
      amount of removed blocks
    • getBlockHardness

      @Deprecated public float getBlockHardness(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter worldIn, net.minecraft.core.BlockPos pos)
      Deprecated.
    • 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 net.minecraft.world.level.block.DoorBlock
    • canSurvive

      public boolean canSurvive(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader worldIn, net.minecraft.core.BlockPos pos)
      Overrides:
      canSurvive in class net.minecraft.world.level.block.DoorBlock
    • setPlacedBy

      public void setPlacedBy(@NotNull @NotNull net.minecraft.world.level.Level worldIn, @NotNull @NotNull net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.LivingEntity placer, net.minecraft.world.item.ItemStack stack)
      Overrides:
      setPlacedBy in class net.minecraft.world.level.block.DoorBlock
    • getShape

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

      public net.minecraft.world.phys.shapes.VoxelShape getCollisionShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.CollisionContext context)
      Overrides:
      getCollisionShape in class net.minecraft.world.level.block.state.BlockBehaviour
    • getOcclusionShape

      public net.minecraft.world.phys.shapes.VoxelShape getOcclusionShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter worldIn, net.minecraft.core.BlockPos pos)
      Overrides:
      getOcclusionShape in class net.minecraft.world.level.block.state.BlockBehaviour
    • getRenderShape

      public net.minecraft.world.level.block.RenderShape getRenderShape(net.minecraft.world.level.block.state.BlockState state)
      Overrides:
      getRenderShape in class net.minecraft.world.level.block.state.BlockBehaviour
    • setOpen

      public void setOpen(@Nullable @Nullable net.minecraft.world.entity.Entity p_153166_, net.minecraft.world.level.Level worldIn, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, boolean open)
      Overrides:
      setOpen in class net.minecraft.world.level.block.DoorBlock
    • toggleGate

      public void toggleGate(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos clickedBlock, net.minecraft.core.Direction facing)
      Used for activating the gate.
      Parameters:
      world - world to use
      clickedBlock - block thats clicked/used
      facing - facing to check
    • neighborChanged

      public void neighborChanged(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level worldIn, @NotNull @NotNull net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.Block blockIn, net.minecraft.core.BlockPos fromPos, boolean isMoving)
      Mostly redstone stuff for opening
      Overrides:
      neighborChanged in class net.minecraft.world.level.block.DoorBlock
    • getStateForPlacement

      public net.minecraft.world.level.block.state.BlockState getStateForPlacement(net.minecraft.world.item.context.BlockPlaceContext context)
      Overrides:
      getStateForPlacement in class net.minecraft.world.level.block.DoorBlock
    • registerBlock

      public AbstractBlockGate registerBlock(net.minecraft.core.Registry<net.minecraft.world.level.block.Block> registry)
      Registery block at gameregistry.
      Parameters:
      registry - the registry to use.
      Returns:
      the block itself.
    • registerBlockItem

      public void registerBlockItem(net.minecraft.core.Registry<net.minecraft.world.item.Item> registry, net.minecraft.world.item.Item.Properties properties)
      Registery block at gameregistry.
      Parameters:
      registry - the registry to use.
      properties - the item properties.
    • canPlaceLiquid

      public boolean canPlaceLiquid(@Nullable @Nullable net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.level.BlockGetter blockGetter, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull @NotNull net.minecraft.world.level.material.Fluid fluid)
      Specified by:
      canPlaceLiquid in interface net.minecraft.world.level.block.LiquidBlockContainer
    • placeLiquid

      public boolean placeLiquid(@NotNull @NotNull net.minecraft.world.level.LevelAccessor accessor, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.level.block.state.BlockState state, @NotNull @NotNull net.minecraft.world.level.material.FluidState fluid)
      Specified by:
      placeLiquid in interface net.minecraft.world.level.block.LiquidBlockContainer