Class LightCapacitorBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
etithespirit.orimod.common.block.light.connection.ConnectableLightTechBlock
etithespirit.orimod.common.block.light.LightCapacitorBlock
- All Implemented Interfaces:
IToolRequirementProvider
,ILightBlockIdentifier
,IBlockItemPropertiesProvider
,net.minecraft.world.level.block.EntityBlock
,net.minecraft.world.level.ItemLike
,net.minecraftforge.common.extensions.IForgeBlock
public class LightCapacitorBlock
extends ConnectableLightTechBlock
implements ILightBlockIdentifier, IToolRequirementProvider, net.minecraft.world.level.block.EntityBlock
Represents a Light Capacitor, used to store Light energy.
-
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.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 inherited from class etithespirit.orimod.common.block.light.connection.ConnectableLightTechBlock
AUTO, ENERGIZED
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, UPDATE_SUPPRESS_LIGHT
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, material, properties, soundType, speedFactor, UPDATE_SHAPE_ORDER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests if this block is set to always connect to any neighbor that is accepting connections in the appropriate direction.void
connectionStateChanged
(net.minecraft.world.level.block.state.BlockState originalState, net.minecraft.world.level.block.state.BlockState newState) Executes when the connection state of this block changes, like when connecting to or disconnecting from a neighboringConnectableLightTechBlock
.Iterable<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>>
Returns all tags that this block should be added to.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 world, net.minecraft.core.BlockPos at, net.minecraft.world.level.block.state.BlockState old, boolean isMoving) Methods inherited from class etithespirit.orimod.common.block.light.connection.ConnectableLightTechBlock
alwaysConnectsWhenPossible, alwaysConnectsWhenPossible, autoRegisterDefaultState, autoRegisterDefaultState, connectsAutomatically, createBlockStateDefinition, from, from, getPropertiesOfItem, getTicker, isConnectableBlock, isConnectableBlock, isConnectedTo, neighborChanged, shouldBeUpdatedToConnectTo
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, fillItemCategory, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, getStateForPlacement, 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, defaultMaterialColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getPistonPushReaction, getRenderShape, getSeed, getShadeBrightness, getShape, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, isSignalSource, mirror, onProjectileHit, onRemove, randomTick, rotate, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, updateShape, use, 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, getTicker
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlock
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, collisionExtendsVertically, getAdjacentBlockPathType, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hidesNeighborFace, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isValidSpawn, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onNeighborChange, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHiding
-
Constructor Details
-
LightCapacitorBlock
public LightCapacitorBlock()
-
-
Method Details
-
alwaysConnectsWhenPossible
public boolean alwaysConnectsWhenPossible()Description copied from class:ConnectableLightTechBlock
Tests if this block is set to always connect to any neighbor that is accepting connections in the appropriate direction. This is used for blocks like the Light Capacitor, which cannot have any given face turned on or off - under all circumstances, if something is connected to the face of a capacitor, then that connection is live.
To name an example, if a conduit and a capacitor are next to eachother, then whether or not they are connected is only dependent on the conduit - the capacitor always connects, so the conduit is the only remaining thing that would be conditional.
Note: When this is true, all six cardinal states as well as the automatic connection state are not meaningful, that is, it should be treated as if all seven of those states are true no matter what.- Overrides:
alwaysConnectsWhenPossible
in classConnectableLightTechBlock
- Returns:
- Whether or not this block can auto-connect to neighbors regardless of the cardinal
BooleanProperty
values / automatic state this block has.
-
onPlace
public void onPlace(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos at, net.minecraft.world.level.block.state.BlockState old, boolean isMoving) - Overrides:
onPlace
in classnet.minecraft.world.level.block.state.BlockBehaviour
-
connectionStateChanged
public void connectionStateChanged(net.minecraft.world.level.block.state.BlockState originalState, net.minecraft.world.level.block.state.BlockState newState) Description copied from class:ConnectableLightTechBlock
Executes when the connection state of this block changes, like when connecting to or disconnecting from a neighboringConnectableLightTechBlock
.- Specified by:
connectionStateChanged
in classConnectableLightTechBlock
- Parameters:
originalState
- The original state of this block prior to the connection changing.newState
- The new state of this block after the connection changed.
-
newBlockEntity
@Nullable public net.minecraft.world.level.block.entity.BlockEntity newBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) - Specified by:
newBlockEntity
in interfacenet.minecraft.world.level.block.EntityBlock
-
getTagsForBlock
Description copied from interface:IToolRequirementProvider
Returns all tags that this block should be added to. The tags must come fromBlockTags
. Reminder to self: Because it keeps eluding you, this is not a MC method. This is your method.- Specified by:
getTagsForBlock
in interfaceIToolRequirementProvider
- Returns:
- A list of tags that this block must use.
-