Package codechicken.multipart.minecraft
Class RedstoneTorchPart
java.lang.Object
codechicken.multipart.api.part.BaseMultipart
codechicken.multipart.minecraft.McStatePart
codechicken.multipart.minecraft.McSidedStatePart
codechicken.multipart.minecraft.TorchPart
codechicken.multipart.minecraft.RedstoneTorchPart
- All Implemented Interfaces:
AnimateTickPart,FacePart,IconHitEffectsPart,ModelRenderPart,MultiPart,NormalOcclusionPart,RandomTickPart,FaceRedstonePart,RedstonePart,SlottedPart
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class codechicken.multipart.minecraft.TorchPart
STANDING_OCCLUSION, WALL_OCCLUSIONFields inherited from class codechicken.multipart.minecraft.McStatePart
state -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()voidanimateTick(net.minecraft.util.RandomSource random) booleancanConnectRedstone(int side) Returns weather this part can connect to redstone on the specified side.intgetFace()Returns the face which this Redstone part is attached.protected net.minecraft.world.level.block.BlockgetType()Returns theMultipartTyperegistry entry for this part.protected net.minecraft.world.level.block.BlockbooleanvoidonAdded()Called when this part is added to the block space.voidonChunkLoad(net.minecraft.world.level.chunk.LevelChunk chunk) Called when the containing chunk is loaded on the server.voidonNeighborBlockChanged(net.minecraft.core.BlockPos from) Called when a neighbor block changes.voidCalled when this part is removed from the block space.voidCalled when this part joins the world.voidCalled on random update.voidCalled when a scheduled tick is executed.intstrongPowerLevel(int side) Returns the strong (indirect, through blocks) signal being emitted by this part on the specified side.intweakPowerLevel(int side) Returns the weak (direct) being emitted by this part on the specified side.Methods inherited from class codechicken.multipart.minecraft.TorchPart
defaultBlockState, getDropStack, getOcclusionShape, getSide, setStateOnPlacementMethods inherited from class codechicken.multipart.minecraft.McSidedStatePart
canStay, drop, dropIfCantStay, getSlotMask, redstoneConductionMapMethods inherited from class codechicken.multipart.minecraft.McStatePart
getBlockSupportShape, getBounds, getBreakingIcon, getBrokenIcon, getCloneStack, getCollisionShape, getCurrentState, getDrops, getInteractionShape, getLightEmission, getPlacementSound, getRenderOcclusionShape, getShape, getStrength, getVisualShape, load, occlusionTest, readDesc, save, writeDescMethods inherited from class codechicken.multipart.api.part.BaseMultipart
bind, hasTile, tileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface codechicken.multipart.api.part.IconHitEffectsPart
addDestroyEffects, addHitEffectsMethods inherited from interface codechicken.multipart.api.part.ModelRenderPart
getModelDataMethods inherited from interface codechicken.multipart.api.part.MultiPart
addLandingEffects, addRunningEffects, capCache, click, getBlockSupportShape, getCloneStack, getCollisionShape, getDrops, getExplosionResistance, getInteractionShape, getLightEmission, getPlacementSound, getRenderBounds, getRenderOcclusionShape, getShape, getStrength, getVisualShape, harvest, hasLevel, hasTile, invalidateConvertedTile, level, load, onChunkUnload, onConverted, onEntityCollision, onEntityStanding, onMoved, onPartChanged, onWorldSeparate, pos, preRemove, readDesc, readUpdate, save, scheduleTick, sendUpdate, tile, useItemOn, useWithoutItem, writeDesc
-
Constructor Details
-
RedstoneTorchPart
public RedstoneTorchPart() -
RedstoneTorchPart
public RedstoneTorchPart(net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
getType
Description copied from interface:MultiPartReturns theMultipartTyperegistry entry for this part.- Specified by:
getTypein interfaceMultiPart- Overrides:
getTypein classTorchPart- Returns:
- The
MultipartType. - See Also:
-
getStandingBlock
protected net.minecraft.world.level.block.Block getStandingBlock()- Overrides:
getStandingBlockin classTorchPart
-
getWallBlock
protected net.minecraft.world.level.block.Block getWallBlock()- Overrides:
getWallBlockin classTorchPart
-
active
public boolean active() -
animateTick
public void animateTick(net.minecraft.util.RandomSource random) - Specified by:
animateTickin interfaceAnimateTickPart- Overrides:
animateTickin classTorchPart
-
onNeighborBlockChanged
public void onNeighborBlockChanged(net.minecraft.core.BlockPos from) Description copied from interface:MultiPartCalled when a neighbor block changes.- Specified by:
onNeighborBlockChangedin interfaceMultiPart- Overrides:
onNeighborBlockChangedin classMcSidedStatePart- Parameters:
from- The neighbor block.
-
isBeingPowered
public boolean isBeingPowered() -
scheduledTick
public void scheduledTick()Description copied from interface:MultiPartCalled when a scheduled tick is executed.- Specified by:
scheduledTickin interfaceMultiPart- See Also:
-
randomTick
public void randomTick()Description copied from interface:RandomTickPartCalled on random update.Random ticks are between 800 and 1600 ticks from their last scheduled/random tick.
- Specified by:
randomTickin interfaceRandomTickPart
-
onChunkLoad
public void onChunkLoad(net.minecraft.world.level.chunk.LevelChunk chunk) Description copied from interface:MultiPartCalled when the containing chunk is loaded on the server.- Specified by:
onChunkLoadin interfaceMultiPart- Specified by:
onChunkLoadin interfaceRandomTickPart- Parameters:
chunk- The chunk.
-
onWorldJoin
public void onWorldJoin()Description copied from interface:MultiPartCalled when this part joins the world.This may be due to placement, chunk load, frames, etc.
Use this to sync with external data structures.
Called client and server side.
- Specified by:
onWorldJoinin interfaceMultiPart- Specified by:
onWorldJoinin interfaceRandomTickPart
-
onRemoved
public void onRemoved()Description copied from interface:MultiPartCalled when this part is removed from the block space. -
onAdded
public void onAdded()Description copied from interface:MultiPartCalled when this part is added to the block space. -
strongPowerLevel
public int strongPowerLevel(int side) Description copied from interface:RedstonePartReturns the strong (indirect, through blocks) signal being emitted by this part on the specified side.- Specified by:
strongPowerLevelin interfaceRedstonePart- Parameters:
side- The side index.- Returns:
- The redstone signal.
-
weakPowerLevel
public int weakPowerLevel(int side) Description copied from interface:RedstonePartReturns the weak (direct) being emitted by this part on the specified side.- Specified by:
weakPowerLevelin interfaceRedstonePart- Parameters:
side- The side index.- Returns:
- The redstone signal.
-
canConnectRedstone
public boolean canConnectRedstone(int side) Description copied from interface:RedstonePartReturns weather this part can connect to redstone on the specified side.Blocking parts like covers will be handled by RedstoneInteractions.
- Specified by:
canConnectRedstonein interfaceRedstonePart- Parameters:
side- The side index.- Returns:
- True if redstone can connect.
-
getFace
public int getFace()Description copied from interface:FaceRedstonePartReturns the face which this Redstone part is attached.- Specified by:
getFacein interfaceFaceRedstonePart- Returns:
- The face.
-