Package codechicken.multipart.minecraft
Class ButtonPart
java.lang.Object
codechicken.multipart.api.part.BaseMultipart
codechicken.multipart.minecraft.McStatePart
codechicken.multipart.minecraft.McSidedStatePart
codechicken.multipart.minecraft.ButtonPart
- All Implemented Interfaces:
FacePart,IconHitEffectsPart,ModelRenderPart,MultiPart,NormalOcclusionPart,FaceRedstonePart,RedstonePart,SlottedPart
- Direct Known Subclasses:
ButtonPart.AcaciaButtonPart,ButtonPart.BirchButtonPart,ButtonPart.CrimsonButtonPart,ButtonPart.DarkOakButtonPart,ButtonPart.JungleButtonPart,ButtonPart.OakButtonPart,ButtonPart.PolishedBlackstoneButtonPart,ButtonPart.SpruceButtonPart,ButtonPart.StoneButtonPart,ButtonPart.WarpedButtonPart
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Field Summary
Fields inherited from class codechicken.multipart.minecraft.McStatePart
state -
Constructor Summary
ConstructorsConstructorDescriptionButtonPart(MultipartType<?> type, net.minecraft.world.level.block.ButtonBlock block) ButtonPart(MultipartType<?> type, net.minecraft.world.level.block.ButtonBlock block, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanConnectRedstone(int side) Returns weather this part can connect to redstone on the specified side.net.minecraft.world.level.block.state.BlockStateintdelay()net.minecraft.world.item.ItemStackintgetFace()Returns the face which this Redstone part is attached.net.minecraft.core.DirectiongetSide()getType()Returns theMultipartTyperegistry entry for this part.voidonEntityCollision(net.minecraft.world.entity.Entity entity) Called when an entity is within this block space.voidCalled when this part is removed from the block space.booleanpressed()voidCalled when a scheduled tick is executed.@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, onConverted, onEntityStanding, onMoved, onNeighborBlockChanged, onPartChanged, onWorldJoin, onWorldSeparate, pos, preRemove, readDesc, readUpdate, save, scheduleTick, sendUpdate, tile, useItemOn, writeDesc
-
Constructor Details
-
ButtonPart
-
ButtonPart
public ButtonPart(MultipartType<?> type, net.minecraft.world.level.block.ButtonBlock block, 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
-
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
-
delay
public int delay() -
canArrowsPress
public boolean canArrowsPress() -
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.
-
scheduledTick
public void scheduledTick()Description copied from interface:MultiPartCalled when a scheduled tick is executed.- Specified by:
scheduledTickin interfaceMultiPart- See Also:
-
pressed
public boolean pressed() -
onEntityCollision
public void onEntityCollision(net.minecraft.world.entity.Entity entity) Description copied from interface:MultiPartCalled when an entity is within this block space.The entity may not actually be colliding with this part.
- Specified by:
onEntityCollisionin interfaceMultiPart- Parameters:
entity- TheEntity.
-
onRemoved
public void onRemoved()Description copied from interface:MultiPartCalled when this part is removed from the block space. -
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.
-