Package codechicken.multipart.minecraft
Class LeverPart
java.lang.Object
codechicken.multipart.api.part.BaseMultipart
codechicken.multipart.minecraft.McStatePart
codechicken.multipart.minecraft.McSidedStatePart
codechicken.multipart.minecraft.LeverPart
- All Implemented Interfaces:
FacePart,IconHitEffectsPart,ModelRenderPart,MultiPart,NormalOcclusionPart,FaceRedstonePart,RedstonePart,SlottedPart
-
Field Summary
Fields inherited from class codechicken.multipart.minecraft.McStatePart
state -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()booleancanConnectRedstone(int side) Returns weather this part can connect to redstone on the specified side.net.minecraft.world.level.block.state.BlockStatenet.minecraft.world.item.ItemStackintgetFace()Returns the face which this Redstone part is attached.net.minecraft.core.DirectiongetSide()getType()Returns theMultipartTyperegistry entry for this part.voidCalled when this part is converted from a normal block or tile.voidCalled when this part is removed from the block space.voidreadUpdate(codechicken.lib.data.MCDataInput packet) Read a packet sent viaMultiPart.sendUpdate(java.util.function.Consumer<codechicken.lib.data.MCDataOutput>).@Nullable MultiPartsetStateOnPlacement(net.minecraft.world.item.context.BlockPlaceContext context) intstrongPowerLevel(int side) Returns the strong (indirect, through blocks) signal being emitted by this part on the specified side.net.minecraft.world.InteractionResultuseWithoutItem(net.minecraft.world.entity.player.Player player, PartRayTraceResult hit) Called on block right-click without an item.intweakPowerLevel(int side) Returns the weak (direct) being emitted by this part on the specified side.Methods inherited from class codechicken.multipart.minecraft.McSidedStatePart
canStay, drop, dropIfCantStay, getSlotMask, onNeighborBlockChanged, redstoneConductionMapMethods inherited from class codechicken.multipart.minecraft.McStatePart
getBlockSupportShape, getBounds, getBreakingIcon, getBrokenIcon, getCloneStack, getCollisionShape, getCurrentState, getDrops, getInteractionShape, getLightEmission, getOcclusionShape, 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, onAdded, onChunkLoad, onChunkUnload, onEntityCollision, onEntityStanding, onMoved, onNeighborBlockChanged, onPartChanged, onWorldJoin, onWorldSeparate, pos, preRemove, readDesc, save, scheduledTick, scheduleTick, sendUpdate, tile, useItemOn, writeDesc
-
Constructor Details
-
LeverPart
public LeverPart() -
LeverPart
public LeverPart(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- Returns:
- The
MultipartType. - See Also:
-
defaultBlockState
public net.minecraft.world.level.block.state.BlockState defaultBlockState()- Specified by:
defaultBlockStatein classMcStatePart
-
getDropStack
public net.minecraft.world.item.ItemStack getDropStack()- Specified by:
getDropStackin classMcStatePart
-
active
public boolean active() -
getSide
public net.minecraft.core.Direction getSide()- Specified by:
getSidein classMcSidedStatePart
-
setStateOnPlacement
@Nullable public @Nullable MultiPart setStateOnPlacement(net.minecraft.world.item.context.BlockPlaceContext context) - Overrides:
setStateOnPlacementin classMcStatePart
-
useWithoutItem
public net.minecraft.world.InteractionResult useWithoutItem(net.minecraft.world.entity.player.Player player, PartRayTraceResult hit) Description copied from interface:MultiPartCalled on block right-click without an item.This should not modify the part client-side.
- Specified by:
useWithoutItemin interfaceMultiPart- Parameters:
player- The player that right-clicked the part.hit- ThePartRayTraceResulthit result.- Returns:
- The
InteractionResult.
-
onRemoved
public void onRemoved()Description copied from interface:MultiPartCalled when this part is removed from the block space. -
onConverted
public void onConverted()Description copied from interface:MultiPartCalled when this part is converted from a normal block or tile.Only applicable if a converter has been registered.
- Specified by:
onConvertedin interfaceMultiPart- See Also:
-
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.
-
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.
-
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.
-
readUpdate
public void readUpdate(codechicken.lib.data.MCDataInput packet) Description copied from interface:MultiPartRead a packet sent viaMultiPart.sendUpdate(java.util.function.Consumer<codechicken.lib.data.MCDataOutput>).- Specified by:
readUpdatein interfaceMultiPart- Parameters:
packet- THe packet to read.
-