Class DecayLiquidBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.LiquidBlock
etithespirit.orimod.common.block.decay.DecayLiquidBlock
- All Implemented Interfaces:
IDecayBlock
,IDecayBlockIdentifier
,IBlockItemPropertiesProvider
,net.minecraft.world.level.block.BucketPickup
,net.minecraft.world.level.ItemLike
,net.minecraftforge.common.extensions.IForgeBlock
,net.minecraftforge.common.extensions.IForgeBucketPickup
public class DecayLiquidBlock
extends net.minecraft.world.level.block.LiquidBlock
implements IDecayBlock
A decay liquid block, which inherits the attributes of both liquid and decay materials.
-
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 net.minecraft.world.level.block.LiquidBlock
LEVEL, POSSIBLE_FLOW_DIRECTIONS, STABLE_SHAPE
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
ConstructorsConstructorDescriptionDecayLiquidBlock
(Supplier<? extends net.minecraft.world.level.material.FlowingFluid> fluid, net.minecraft.world.level.block.state.BlockBehaviour.Properties properties) DecayLiquidBlock
(Supplier<? extends net.minecraft.world.level.material.FlowingFluid> fluid, net.minecraft.world.level.block.state.BlockBehaviour.Properties properties, boolean spreads) -
Method Summary
Modifier and TypeMethodDescriptionvoid
createBlockStateDefinition
(net.minecraft.world.level.block.state.StateDefinition.Builder builder) void
doAdjacentSpread
(net.minecraft.world.level.block.state.StateHolder<?, ?> state, net.minecraft.server.level.ServerLevel worldIn, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource random) The default routine for spreading to / infecting adjacent blocks.void
doDiagonalSpread
(net.minecraft.world.level.block.state.StateHolder<?, ?> state, net.minecraft.server.level.ServerLevel worldIn, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource random) The default routine for spreading to / infecting diagonally oriented blocks (2D or 3D).net.minecraft.world.level.block.state.BlockState
healsInto
(net.minecraft.world.level.block.state.BlockState thisState) When this Decay block is cured, this is theBlockState
(of some vanilla or mod block) that it should heal into.net.minecraft.world.level.block.state.StateHolder<?,
?> mutateReplacementState
(net.minecraft.world.level.block.state.StateHolder<?, ?> replacementState, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos replacingBlockAt) Provides a means of altering the given state.void
neighborChanged
(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.Block blockIn, net.minecraft.core.BlockPos fromPos, boolean isMoving) void
randomTick
(net.minecraft.world.level.block.state.BlockState state, net.minecraft.server.level.ServerLevel worldIn, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource random) void
registerReplacements
(List<net.minecraft.world.level.block.state.StateHolder<?, ?>> blocksToReplaceWithSelf) Register all of the blocks or fluids that this decay block will replace with itself once those blocks are infected.void
stepOn
(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos at, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.Entity ent) Methods inherited from class net.minecraft.world.level.block.LiquidBlock
getCollisionShape, getDrops, getFluid, getFluidState, getPickupSound, getRenderShape, getShape, initFluidStateCache, isPathfindable, isRandomlyTicking, onPlace, pickupBlock, propagatesSkylightDown, skipRendering, updateShape
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, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, 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, getDestroyProgress, getDirectSignal, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getPistonPushReaction, getSeed, getShadeBrightness, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isSignalSource, mirror, onProjectileHit, onRemove, rotate, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, use, useShapeForLightOcclusion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface etithespirit.orimod.common.block.decay.IDecayBlock
defaultNeighborChanged, defaultOnEntityWalked, defaultRandomTick, getDecayReplacementFor, getNonDecayableAdjacents, hasDecayReplacementFor, needsToDoEdgeCheck, needsToSpread, randomUnoccupiedDiagonal, randomUnoccupiedDirection, shouldSpreadByRNG
Methods inherited from interface etithespirit.orimod.common.block.decay.IDecayBlockIdentifier
getPropertiesOfItem
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
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBucketPickup
getPickupSound
-
Constructor Details
-
DecayLiquidBlock
public DecayLiquidBlock(Supplier<? extends net.minecraft.world.level.material.FlowingFluid> fluid, net.minecraft.world.level.block.state.BlockBehaviour.Properties properties) - Parameters:
fluid
- A fluid supplier such as< FlowingFluid >
properties
- The properties of this fluid.
-
DecayLiquidBlock
public DecayLiquidBlock(Supplier<? extends net.minecraft.world.level.material.FlowingFluid> fluid, net.minecraft.world.level.block.state.BlockBehaviour.Properties properties, boolean spreads)
-
-
Method Details
-
registerReplacements
public void registerReplacements(List<net.minecraft.world.level.block.state.StateHolder<?, ?>> blocksToReplaceWithSelf) Description copied from interface:IDecayBlock
Register all of the blocks or fluids that this decay block will replace with itself once those blocks are infected.- Specified by:
registerReplacements
in interfaceIDecayBlock
- Parameters:
blocksToReplaceWithSelf
- A list of every block that is replaced by this upon infection.
-
mutateReplacementState
public net.minecraft.world.level.block.state.StateHolder<?,?> mutateReplacementState(net.minecraft.world.level.block.state.StateHolder<?, ?> replacementState, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos replacingBlockAt) Description copied from interface:IDecayBlock
Provides a means of altering the given state. The input state is the state of this block when it replaces a non-decay block.- Specified by:
mutateReplacementState
in interfaceIDecayBlock
- Parameters:
replacementState
- The default state of this decay blockworld
- The world that the state is being placed into.replacingBlockAt
- THe location of the block that is being replaced in the world.- Returns:
- The state of the decay block when replacing a given block.
-
createBlockStateDefinition
public void createBlockStateDefinition(net.minecraft.world.level.block.state.StateDefinition.Builder builder) - Overrides:
createBlockStateDefinition
in classnet.minecraft.world.level.block.LiquidBlock
-
healsInto
public net.minecraft.world.level.block.state.BlockState healsInto(net.minecraft.world.level.block.state.BlockState thisState) Description copied from interface:IDecayBlock
When this Decay block is cured, this is theBlockState
(of some vanilla or mod block) that it should heal into.- Specified by:
healsInto
in interfaceIDecayBlock
- Returns:
- The vanilla or mod block that this decay block turns into once cured.
-
doAdjacentSpread
public void doAdjacentSpread(net.minecraft.world.level.block.state.StateHolder<?, ?> state, net.minecraft.server.level.ServerLevel worldIn, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource random) The default routine for spreading to / infecting adjacent blocks.- Specified by:
doAdjacentSpread
in interfaceIDecayBlock
- Parameters:
state
- The block that is responsible for the spreading.worldIn
- TheLevel
that this spread is occurring in.pos
- The location at which this block exists.random
- The pseudorandomizer of this world.
-
doDiagonalSpread
public void doDiagonalSpread(net.minecraft.world.level.block.state.StateHolder<?, ?> state, net.minecraft.server.level.ServerLevel worldIn, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource random) The default routine for spreading to / infecting diagonally oriented blocks (2D or 3D). This can be imagined with the current block being the center of a 3x3x3 cube. It applies to all blocks that are not directly adjacent to one of the six faces of this block.- Specified by:
doDiagonalSpread
in interfaceIDecayBlock
- Parameters:
state
- The block that is responsible for the spreading.worldIn
- TheLevel
that this spread is occurring in.pos
- The location at which this block exists.random
- The pseudorandomizer of this world.
-
randomTick
public void randomTick(net.minecraft.world.level.block.state.BlockState state, net.minecraft.server.level.ServerLevel worldIn, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource random) - Overrides:
randomTick
in classnet.minecraft.world.level.block.LiquidBlock
-
neighborChanged
public void neighborChanged(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.Block blockIn, net.minecraft.core.BlockPos fromPos, boolean isMoving) - Overrides:
neighborChanged
in classnet.minecraft.world.level.block.LiquidBlock
-
stepOn
public void stepOn(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos at, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.Entity ent) - Overrides:
stepOn
in classnet.minecraft.world.level.block.Block
-