Package codechicken.microblock.part
Class StandardMicroblockPart
java.lang.Object
codechicken.multipart.api.part.BaseMultipart
codechicken.microblock.part.MicroblockPart
codechicken.microblock.part.StandardMicroblockPart
- All Implemented Interfaces:
IMicroOcclusion,IMicroShrinkRender,MultiPart,PartialOcclusionPart,SlottedPart
- Direct Known Subclasses:
CornerMicroblockPart,EdgeMicroblockPart,FaceMicroblockPart,HollowMicroblockPart
public abstract class StandardMicroblockPart
extends MicroblockPart
implements IMicroOcclusion, PartialOcclusionPart, IMicroShrinkRender
Represents a 'standard' MicroblockPart.
Created by covers1624 on 27/6/22.
-
Field Summary
FieldsModifier and TypeFieldDescription@Nullable codechicken.lib.vec.Cuboid6intFields inherited from class codechicken.microblock.part.MicroblockPart
material, shape -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe Micro factory that controls placement from item stack form.abstract StandardMicroFactorynet.minecraft.world.phys.shapes.VoxelShapeThe VoxelShape to use for Partial occlusion tests, this shape must not be occluded by any otherPartialOcclusionPart's shape, unlessPartialOcclusionPart.allowCompleteOcclusion()returns true.intgetRenderCuboids(boolean isInventory) intgetSlot()inta bitmask of slots that this part fills.booleanocclusionTest(MultiPart npart) Perform an occlusion test to determine weather this part andnpartcan 'fit' into this block space.voidonAdded()Called when this part is added to the block space.voidonPartChanged(@Nullable MultiPart part) Called when a part is added or removed from this block space.voidreadUpdate(codechicken.lib.data.MCDataInput packet) Read a packet sent viaMultiPart.sendUpdate(java.util.function.Consumer<codechicken.lib.data.MCDataOutput>).voidMethods inherited from class codechicken.microblock.part.MicroblockPart
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, getBounds, getCloneStack, getDrops, getExplosionResistance, getLightEmission, getMaterial, getShapeSlot, getSize, getStrength, getType, isTransparent, load, readDesc, save, sendShapeUpdate, setShape, 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.microblock.part.IMicroOcclusion
getBounds, getMaterial, getSizeMethods inherited from interface codechicken.microblock.part.IMicroShrinkRender
getBounds, getSize, isTransparentMethods inherited from interface codechicken.multipart.api.part.MultiPart
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, capCache, click, getBlockSupportShape, getCloneStack, getCollisionShape, getDrops, getExplosionResistance, getInteractionShape, getLightEmission, getModelData, getPlacementSound, getRenderBounds, getRenderOcclusionShape, getShape, getStrength, getType, getVisualShape, harvest, hasLevel, hasTile, invalidateConvertedTile, level, load, onChunkLoad, onChunkUnload, onConverted, onEntityCollision, onEntityStanding, onMoved, onNeighborBlockChanged, onRemoved, onWorldJoin, onWorldSeparate, pos, preRemove, readDesc, save, scheduledTick, scheduleTick, sendUpdate, tile, useItemOn, useWithoutItem, writeDescMethods inherited from interface codechicken.multipart.api.part.PartialOcclusionPart
allowCompleteOcclusion
-
Field Details
-
renderBounds
@Nullable public @Nullable codechicken.lib.vec.Cuboid6 renderBounds -
renderMask
public int renderMask
-
-
Constructor Details
-
StandardMicroblockPart
-
-
Method Details
-
getMicroFactory
- Specified by:
getMicroFactoryin classMicroblockPart
-
getItemFactoryId
public int getItemFactoryId()Description copied from class:MicroblockPartThe Micro factory that controls placement from item stack form.- Specified by:
getItemFactoryIdin classMicroblockPart- Returns:
- The id of said factory.
-
getSlot
public int getSlot()- Specified by:
getSlotin interfaceIMicroOcclusion- Specified by:
getSlotin interfaceIMicroShrinkRender
-
getSlotMask
public int getSlotMask()Description copied from interface:SlottedParta bitmask of slots that this part fills. slot x is 1invalid input: '<'invalid input: '<'x- Specified by:
getSlotMaskin interfaceSlottedPart
-
getPartialOcclusionShape
public net.minecraft.world.phys.shapes.VoxelShape getPartialOcclusionShape()Description copied from interface:PartialOcclusionPartThe VoxelShape to use for Partial occlusion tests, this shape must not be occluded by any otherPartialOcclusionPart's shape, unlessPartialOcclusionPart.allowCompleteOcclusion()returns true.It is expected that this method return some form of cached instance that does NOT change each call, unless some internal state has changed.
If this shape changes after initial placement, call
TileMultipart.markShapeChange().- Specified by:
getPartialOcclusionShapein interfacePartialOcclusionPart- Returns:
- the VoxelShape for partial occlusion tests.
-
occlusionTest
Description copied from interface:MultiPartPerform an occlusion test to determine weather this part andnpartcan 'fit' into this block space.- Specified by:
occlusionTestin interfaceMultiPart- Parameters:
npart- The part to run the test against.- Returns:
trueif both this part andnpartare able to share this block space.
-
getRenderCuboids
- Specified by:
getRenderCuboidsin classMicroblockPart
-
onPartChanged
Description copied from interface:MultiPartCalled when a part is added or removed from this block space.- Specified by:
onPartChangedin interfaceMultiPart- Parameters:
part- The part which changed. May benullif multiple parts are changed.
-
onAdded
public void onAdded()Description copied from interface:MultiPartCalled when this part is added to the block space. -
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- Overrides:
readUpdatein classMicroblockPart- Parameters:
packet- THe packet to read.
-
recalcBounds
public void recalcBounds() -
getPriorityClass
public int getPriorityClass()- Specified by:
getPriorityClassin interfaceIMicroShrinkRender
-