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.minecraftforge.common.extensions.IForgeBlock
- 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.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 TypeFieldDescriptionprotected static final net.minecraft.world.phys.shapes.VoxelShapeThe bounding boxes.static final StringVariant reg namesprotected static final net.minecraft.world.phys.shapes.VoxelShapestatic final StringFields inherited from class net.minecraft.world.level.block.DoorBlock
AABB_DOOR_THICKNESS, EAST_AABB, FACING, HALF, HINGE, NORTH_AABB, OPEN, POWERED, SOUTH_AABB, WEST_AABBFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlaceLiquid(@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) booleancanSurvive(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader worldIn, net.minecraft.core.BlockPos pos) floatgetBlockHardness(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.VoxelShapegetCollisionShape(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) intintnet.minecraft.world.phys.shapes.VoxelShapegetOcclusionShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter worldIn, net.minecraft.core.BlockPos pos) net.minecraft.world.level.block.RenderShapegetRenderShape(net.minecraft.world.level.block.state.BlockState state) @NotNull net.minecraft.world.phys.shapes.VoxelShapegetShape(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.BlockStategetStateForPlacement(net.minecraft.world.item.context.BlockPlaceContext context) voidneighborChanged(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 openingbooleanplaceLiquid(@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) voidplayerWillDestroy(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.minecraftforge.registries.IForgeRegistry<net.minecraft.world.level.block.Block> registry) Registery block at gameregistry.voidregisterBlockItem(net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.item.Item> registry, net.minecraft.world.item.Item.Properties properties) Registery block at gameregistry.intremoveGate(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos startPos, net.minecraft.core.Direction facing) Removes the whole gate blocksvoidsetOpen(@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) voidsetPlacedBy(@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) voidtoggleGate(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.BlockStateupdateShape(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.InteractionResultuse(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
createBlockStateDefinition, getSeed, isOpen, isPathfindable, isWoodenDoor, isWoodenDoor, mirror, playSound, rotate, typeMethods 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, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, 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, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getShadeBrightness, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isSignalSource, onPlace, onProjectileHit, onRemove, randomTick, requiredFeatures, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, useShapeForLightOcclusionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
-
IRON_GATE
Variant reg names- See Also:
-
WOODEN_GATE
- See Also:
-
E_W_SHAPE
protected static final net.minecraft.world.phys.shapes.VoxelShape E_W_SHAPEThe bounding boxes. -
N_S_SHAPE
protected static final net.minecraft.world.phys.shapes.VoxelShape N_S_SHAPE
-
-
Constructor Details
-
AbstractBlockGate
-
-
Method Details
-
getMaxWidth
public int getMaxWidth() -
getMaxHeight
public int getMaxHeight() -
use
public net.minecraft.world.InteractionResult use(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:
usein classnet.minecraft.world.level.block.DoorBlock
-
playerWillDestroy
public void 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:
playerWillDestroyin classnet.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 usestartPos- start posfacing- 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:
updateShapein classnet.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:
canSurvivein classnet.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:
setPlacedByin classnet.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:
getShapein classnet.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:
getCollisionShapein classnet.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:
getOcclusionShapein classnet.minecraft.world.level.block.state.BlockBehaviour
-
getRenderShape
public net.minecraft.world.level.block.RenderShape getRenderShape(net.minecraft.world.level.block.state.BlockState state) - Overrides:
getRenderShapein classnet.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:
setOpenin classnet.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 useclickedBlock- block thats clicked/usedfacing- 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:
neighborChangedin classnet.minecraft.world.level.block.DoorBlock
-
getStateForPlacement
public net.minecraft.world.level.block.state.BlockState getStateForPlacement(net.minecraft.world.item.context.BlockPlaceContext context) - Overrides:
getStateForPlacementin classnet.minecraft.world.level.block.DoorBlock
-
registerBlock
public AbstractBlockGate registerBlock(net.minecraftforge.registries.IForgeRegistry<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.minecraftforge.registries.IForgeRegistry<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(@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:
canPlaceLiquidin interfacenet.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:
placeLiquidin interfacenet.minecraft.world.level.block.LiquidBlockContainer
-