public class StructureGelBlock extends net.minecraft.block.Block implements IStructureGel
IStructureGel
that you can override for custom behavior. All methods
containing hooks are documented with "@see"net.minecraft.block.Block.RenderSideCacheKey
net.minecraft.block.AbstractBlock.AbstractBlockState, net.minecraft.block.AbstractBlock.IExtendedPositionPredicate<A>, net.minecraft.block.AbstractBlock.IPositionPredicate, net.minecraft.block.AbstractBlock.OffsetType, net.minecraft.block.AbstractBlock.Properties
IStructureGel.Behavior, IStructureGel.IBehavior
Modifier and Type | Field and Description |
---|---|
java.util.List<IStructureGel.IBehavior> |
behaviors
List of behaviors that this block will use.
|
static net.minecraft.state.IntegerProperty |
COUNT
0-49 causes spreading, 50 does nothing, and 51 causes it to remove itself.
|
Constructor and Description |
---|
StructureGelBlock(IStructureGel.IBehavior... behaviors) |
Modifier and Type | Method and Description |
---|---|
void |
addGel(net.minecraft.block.BlockState state,
net.minecraft.world.World worldIn,
net.minecraft.util.math.BlockPos pos,
int count)
Called when adding structure gel to the world.
|
boolean |
checkAbove(net.minecraft.world.World worldIn,
net.minecraft.util.math.BlockPos pos)
Checks to see if the blocks above this are either air or gel.
|
float |
getAmbientOcclusionLightValue(net.minecraft.block.BlockState state,
net.minecraft.world.IBlockReader worldIn,
net.minecraft.util.math.BlockPos pos) |
net.minecraft.util.math.shapes.VoxelShape |
getCollisionShape(net.minecraft.block.BlockState state,
net.minecraft.world.IBlockReader worldIn,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.math.shapes.ISelectionContext context) |
net.minecraft.block.BlockState |
getStateForPlacement(net.minecraft.item.BlockItemUseContext context)
Ensures that only creative players can place this block.
|
boolean |
isSideInvisible(net.minecraft.block.BlockState state,
net.minecraft.block.BlockState adjacentBlockState,
net.minecraft.util.Direction side) |
net.minecraft.util.ActionResultType |
onBlockActivated(net.minecraft.block.BlockState state,
net.minecraft.world.World worldIn,
net.minecraft.util.math.BlockPos pos,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.Hand handIn,
net.minecraft.util.math.BlockRayTraceResult hit)
When right clicked with gunpowder, a chain reaction starts destroying all
connected gels.
|
void |
onBlockHarvested(net.minecraft.world.World worldIn,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.entity.player.PlayerEntity player)
Triggers a chain break reaction if broken in survival mode in case a survival
player finds it.
|
void |
onBlockPlacedBy(net.minecraft.world.World worldIn,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.entity.LivingEntity placer,
net.minecraft.item.ItemStack stack)
Schedule a block update after this places.
|
boolean |
propagatesSkylightDown(net.minecraft.block.BlockState state,
net.minecraft.world.IBlockReader reader,
net.minecraft.util.math.BlockPos pos) |
void |
removeGel(net.minecraft.block.BlockState state,
net.minecraft.world.World worldIn,
net.minecraft.util.math.BlockPos pos)
Called when removing structure gel from the world from the gunpowder chain
reaction.
|
void |
setGel(net.minecraft.block.BlockState state,
net.minecraft.world.World worldIn,
net.minecraft.util.math.BlockPos pos,
int count)
Places structure gel with the proper state and then schedules a block update
on it to continue the spread.
|
void |
tick(net.minecraft.block.BlockState state,
net.minecraft.world.server.ServerWorld worldIn,
net.minecraft.util.math.BlockPos pos,
java.util.Random random)
Called on block update to either spread or remove the structure gel.
|
addInformation, animateTick, asItem, canDropFromExplosion, cannotAttach, canSpawnInBlock, canSustainPlant, doesSideFillSquare, dropXpOnBlockBreak, fillItemGroup, fillWithRain, getBlockFromItem, getDefaultState, getDrops, getDrops, getExplosionResistance, getHarvestLevel, getHarvestTool, getItem, getJumpFactor, getSlipperiness, getSlipperiness, getSoundType, getSpeedFactor, getStateById, getStateContainer, getStateId, getTags, getTranslatedName, getTranslationKey, getValidBlockForPosition, harvestBlock, hasEnoughSolidSide, hasSolidSideOnTop, isIn, isOpaque, isVariableOpacity, makeCuboidShape, matchesBlock, nudgeEntitiesWithNewState, onEntityWalk, onExplosionDestroy, onFallenUpon, onLanded, onPlayerDestroy, replaceBlock, replaceBlockState, shouldSideBeRendered, spawnAsEntity, spawnDrops, spawnDrops, spawnDrops, ticksRandomly, toString
allowsMovement, canProvidePower, eventReceived, getCollisionShape, getComparatorInputOverride, getContainer, getDrops, getFluidState, getLootTable, getMaterialColor, getOffsetType, getOpacity, getPlayerRelativeBlockHardness, getPositionRandom, getPushReaction, getRaytraceShape, getRayTraceShape, getRenderShape, getRenderType, getShape, getStrongPower, getWeakPower, hasComparatorInputOverride, isReplaceable, isReplaceable, isTileEntityProvider, isTransparent, isValidPosition, mirror, neighborChanged, onBlockAdded, onBlockClicked, onEntityCollision, onProjectileCollision, onReplaced, randomTick, rotate, spawnAdditionalDrops, updateDiagonalNeighbors, updatePostPlacement
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
checkPlacementHook, onHandPlaceHook, removalHookPost, removalHookPre, spreadHookPost, spreadHookPre
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, canBeReplacedByLeaves, canBeReplacedByLogs, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, createTileEntity, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getBedSpawnPosition, getBlock, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFogColor, getLightValue, getPickBlock, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasTileEntity, isAir, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isToolEffective, observedNeighborChange, onBlockExploded, onNeighborChange, onPlantGrow, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay
public static final net.minecraft.state.IntegerProperty COUNT
public final java.util.List<IStructureGel.IBehavior> behaviors
Behavior
public StructureGelBlock(IStructureGel.IBehavior... behaviors)
behaviors
- Behavior
,
StructureGelBlock
public net.minecraft.block.BlockState getStateForPlacement(net.minecraft.item.BlockItemUseContext context)
getStateForPlacement
in class net.minecraft.block.Block
IStructureGel.onHandPlaceHook(BlockItemUseContext)
public void onBlockPlacedBy(net.minecraft.world.World worldIn, net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, @Nullable net.minecraft.entity.LivingEntity placer, net.minecraft.item.ItemStack stack)
onBlockPlacedBy
in class net.minecraft.block.Block
public void tick(net.minecraft.block.BlockState state, net.minecraft.world.server.ServerWorld worldIn, net.minecraft.util.math.BlockPos pos, java.util.Random random)
tick
in class net.minecraft.block.AbstractBlock
IStructureGel.spreadHookPre(BlockState, World, BlockPos, Random)
,
IStructureGel.spreadHookPost(BlockState, World, BlockPos, Random)
,
IStructureGel.removalHookPre(BlockState, World, BlockPos, Random)
,
IStructureGel.removalHookPost(BlockState, World, BlockPos, Random)
,
addGel(BlockState, World, BlockPos, int)
,
removeGel(BlockState, World, BlockPos)
public net.minecraft.util.ActionResultType onBlockActivated(net.minecraft.block.BlockState state, net.minecraft.world.World worldIn, net.minecraft.util.math.BlockPos pos, net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand handIn, net.minecraft.util.math.BlockRayTraceResult hit)
onBlockActivated
in class net.minecraft.block.AbstractBlock
public void onBlockHarvested(net.minecraft.world.World worldIn, net.minecraft.util.math.BlockPos pos, net.minecraft.block.BlockState state, net.minecraft.entity.player.PlayerEntity player)
onBlockHarvested
in class net.minecraft.block.Block
public void addGel(net.minecraft.block.BlockState state, net.minecraft.world.World worldIn, net.minecraft.util.math.BlockPos pos, int count)
state
- worldIn
- pos
- count
- IStructureGel.checkPlacementHook(World, BlockPos, int)
,
setGel(BlockState, World, BlockPos, int)
public void removeGel(net.minecraft.block.BlockState state, net.minecraft.world.World worldIn, net.minecraft.util.math.BlockPos pos)
state
- worldIn
- pos
- setGel(BlockState, World, BlockPos, int)
public void setGel(net.minecraft.block.BlockState state, net.minecraft.world.World worldIn, net.minecraft.util.math.BlockPos pos, int count)
state
- worldIn
- pos
- count
- public boolean checkAbove(net.minecraft.world.World worldIn, net.minecraft.util.math.BlockPos pos)
worldIn
- pos
- Boolean
public net.minecraft.util.math.shapes.VoxelShape getCollisionShape(net.minecraft.block.BlockState state, net.minecraft.world.IBlockReader worldIn, net.minecraft.util.math.BlockPos pos, net.minecraft.util.math.shapes.ISelectionContext context)
getCollisionShape
in class net.minecraft.block.AbstractBlock
public boolean propagatesSkylightDown(net.minecraft.block.BlockState state, net.minecraft.world.IBlockReader reader, net.minecraft.util.math.BlockPos pos)
propagatesSkylightDown
in class net.minecraft.block.Block
public boolean isSideInvisible(net.minecraft.block.BlockState state, net.minecraft.block.BlockState adjacentBlockState, net.minecraft.util.Direction side)
isSideInvisible
in class net.minecraft.block.AbstractBlock
public float getAmbientOcclusionLightValue(net.minecraft.block.BlockState state, net.minecraft.world.IBlockReader worldIn, net.minecraft.util.math.BlockPos pos)
getAmbientOcclusionLightValue
in class net.minecraft.block.AbstractBlock