Class RandomizerBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
dev.jaxydog.astral.content.block.AstralBlock
dev.jaxydog.astral.content.block.custom.RandomizerBlock
- All Implemented Interfaces:
BlockConvertible,Custom,Registered,Registered.Common,Registered.Generated,net.fabricmc.fabric.api.block.v1.FabricBlock,net.minecraft.item.ItemConvertible,net.minecraft.resource.featuretoggle.ToggleableFeature
A block that allows for randomly-generated numbers within redstone.
- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
net.minecraft.block.Block.NeighborGroupNested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
net.minecraft.block.AbstractBlock.AbstractBlockState, net.minecraft.block.AbstractBlock.ContextPredicate, net.minecraft.block.AbstractBlock.Offsetter, net.minecraft.block.AbstractBlock.OffsetType, net.minecraft.block.AbstractBlock.Settings, net.minecraft.block.AbstractBlock.TypedContextPredicate<A>Nested classes/interfaces inherited from interface dev.jaxydog.astral.register.Registered
Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.state.property.IntPropertyStores the active generated value until the `retain_state` property is false.static final net.minecraft.state.property.BooleanPropertyWhether the block should be in "boolean mode", where it outputs either 0 or 15 at random.static final net.minecraft.state.property.BooleanPropertyTells the block to reset its generated output when set to false.Fields inherited from class net.minecraft.block.Block
field_31022, field_31023, field_31024, field_31025, field_31035, FORCE_STATE, MOVED, NO_REDRAW, NOTIFY_ALL, NOTIFY_LISTENERS, NOTIFY_NEIGHBORS, REDRAW_ON_MAIN_THREAD, SKIP_DROPS, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableId, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, velocityMultiplierFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
ConstructorsConstructorDescriptionRandomizerBlock(String path, net.minecraft.block.AbstractBlock.Settings settings) Creates a new randomizer block. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendProperties(net.minecraft.state.StateManager.Builder<net.minecraft.block.Block, net.minecraft.block.BlockState> builder) voidgenerate()Generates game assets or data.intgetComparatorOutput(net.minecraft.block.BlockState state, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos) booleanhasComparatorOutput(net.minecraft.block.BlockState state) net.minecraft.util.ActionResultonUse(net.minecraft.block.BlockState state, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand hand, net.minecraft.util.hit.BlockHitResult hit) Methods inherited from class dev.jaxydog.astral.content.block.AstralBlock
asBlock, getRegistryPathMethods inherited from class net.minecraft.block.Block
afterBreak, appendTooltip, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropExperienceWhenMined, dropStack, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getPlacementState, getRawIdFromState, getRegistryEntry, getShapesForStates, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getStateWithProperties, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, isFaceFullSquare, isShapeFullCube, isTransparent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getLootTableId, getMaxHorizontalModelOffset, getOpacity, getOutlineShape, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVerticalModelOffsetMultiplier, getWeakRedstonePower, hasSidedTransparency, isCullingShapeFullCube, isShapeFullCube, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, rotate, scheduledTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.jaxydog.astral.content.block.Custom
registerCommonMethods inherited from interface net.fabricmc.fabric.api.block.v1.FabricBlock
getAppearanceMethods inherited from interface dev.jaxydog.astral.register.Registered
getRegistryId, getRegistryPathMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
ACTIVE_VALUE
public static final net.minecraft.state.property.IntProperty ACTIVE_VALUEStores the active generated value until the `retain_state` property is false.- Since:
- 1.0.0
-
RETAIN_STATE
public static final net.minecraft.state.property.BooleanProperty RETAIN_STATETells the block to reset its generated output when set to false.- Since:
- 1.0.0
-
BOOLEAN_MODE
public static final net.minecraft.state.property.BooleanProperty BOOLEAN_MODEWhether the block should be in "boolean mode", where it outputs either 0 or 15 at random.- Since:
- 1.0.0
-
-
Constructor Details
-
RandomizerBlock
Creates a new randomizer block.- Parameters:
path- The block's identifier path.settings- The block's settings.- Since:
- 1.0.0
-
-
Method Details
-
appendProperties
protected void appendProperties(net.minecraft.state.StateManager.Builder<net.minecraft.block.Block, net.minecraft.block.BlockState> builder) - Overrides:
appendPropertiesin classnet.minecraft.block.Block
-
onUse
public net.minecraft.util.ActionResult onUse(net.minecraft.block.BlockState state, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand hand, net.minecraft.util.hit.BlockHitResult hit) - Overrides:
onUsein classnet.minecraft.block.AbstractBlock
-
hasComparatorOutput
public boolean hasComparatorOutput(net.minecraft.block.BlockState state) - Overrides:
hasComparatorOutputin classnet.minecraft.block.AbstractBlock
-
getComparatorOutput
public int getComparatorOutput(net.minecraft.block.BlockState state, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos) - Overrides:
getComparatorOutputin classnet.minecraft.block.AbstractBlock
-
generate
public void generate()Description copied from interface:Registered.GeneratedGenerates game assets or data.It should be assumed that the contained code will only ever run on the server environment.
- Specified by:
generatein interfaceRegistered.Generated
-