Class PostMicroblockPart

All Implemented Interfaces:
MultiPart, NormalOcclusionPart, PartialOcclusionPart

public class PostMicroblockPart extends MicroblockPart implements PartialOcclusionPart, NormalOcclusionPart
Created by covers1624 on 21/10/22.
  • Field Details

    • aBounds

      public static final codechicken.lib.vec.Cuboid6[] aBounds
    • aShapes

      public static final net.minecraft.world.phys.shapes.VoxelShape[] aShapes
    • renderBounds1

      @Nullable public @Nullable codechicken.lib.vec.Cuboid6 renderBounds1
    • renderBounds2

      @Nullable public @Nullable codechicken.lib.vec.Cuboid6 renderBounds2
  • Constructor Details

    • PostMicroblockPart

      public PostMicroblockPart(MicroMaterial material)
  • Method Details

    • getMicroFactory

      public MicroblockPartFactory getMicroFactory()
      Specified by:
      getMicroFactory in class MicroblockPart
    • getBounds

      public codechicken.lib.vec.Cuboid6 getBounds()
      Specified by:
      getBounds in class MicroblockPart
    • getShape

      public net.minecraft.world.phys.shapes.VoxelShape getShape(net.minecraft.world.phys.shapes.CollisionContext context)
      Description copied from interface: MultiPart
      Maps to BlockBehaviour.getShape(BlockState, BlockGetter, BlockPos, CollisionContext).

      The returned shape here will be used in keys of maps and such. Please ensure that it is cached within the part, to avoid memory churn.

      Specified by:
      getShape in interface MultiPart
    • getItemFactoryId

      public int getItemFactoryId()
      Description copied from class: MicroblockPart
      The Micro factory that controls placement from item stack form.
      Specified by:
      getItemFactoryId in class MicroblockPart
      Returns:
      The id of said factory.
    • getRenderCuboids

      public com.google.common.collect.ImmutableSet<MaskedCuboid> getRenderCuboids(boolean isInventory)
      Description copied from class: MicroblockPart
      Get all the boxes this part wishes to render as.

      It is HIGHLY recommended that implementors cache these returned sets.

      Specified by:
      getRenderCuboids in class MicroblockPart
      Parameters:
      isInventory - If the intent is to be rendered in inventory.
      Returns:
      The boxes to render as.
    • getOcclusionShape

      public net.minecraft.world.phys.shapes.VoxelShape getOcclusionShape()
      Specified by:
      getOcclusionShape in interface NormalOcclusionPart
    • getPartialOcclusionShape

      public net.minecraft.world.phys.shapes.VoxelShape getPartialOcclusionShape()
      Description copied from interface: PartialOcclusionPart
      The VoxelShape to use for Partial occlusion tests, this shape must not be occluded by any other PartialOcclusionPart's shape, unless PartialOcclusionPart.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:
      getPartialOcclusionShape in interface PartialOcclusionPart
      Returns:
      the VoxelShape for partial occlusion tests.
    • occlusionTest

      public boolean occlusionTest(MultiPart nPart)
      Description copied from interface: MultiPart
      Perform an occlusion test to determine weather this part and npart can 'fit' into this block space.
      Specified by:
      occlusionTest in interface MultiPart
      Specified by:
      occlusionTest in interface NormalOcclusionPart
      Parameters:
      nPart - The part to run the test against.
      Returns:
      true if both this part and npart are able to share this block space.
    • onPartChanged

      public void onPartChanged(@Nullable @Nullable MultiPart part)
      Description copied from interface: MultiPart
      Called when a part is added or removed from this block space.
      Specified by:
      onPartChanged in interface MultiPart
      Parameters:
      part - The part which changed. May be null if multiple parts are changed.
    • onAdded

      public void onAdded()
      Description copied from interface: MultiPart
      Called when this part is added to the block space.
      Specified by:
      onAdded in interface MultiPart
    • readUpdate

      public void readUpdate(codechicken.lib.data.MCDataInput packet)
      Description copied from interface: MultiPart
      Specified by:
      readUpdate in interface MultiPart
      Overrides:
      readUpdate in class MicroblockPart
      Parameters:
      packet - THe packet to read.
    • recalcBounds

      public void recalcBounds()