Class 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 Details

    • renderBounds

      @Nullable public @Nullable codechicken.lib.vec.Cuboid6 renderBounds
    • renderMask

      public int renderMask
  • Constructor Details

    • StandardMicroblockPart

      public StandardMicroblockPart(MicroMaterial material)
  • Method Details

    • getMicroFactory

      public abstract StandardMicroFactory getMicroFactory()
      Specified by:
      getMicroFactory in class MicroblockPart
    • 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.
    • getSlot

      public int getSlot()
      Specified by:
      getSlot in interface IMicroOcclusion
      Specified by:
      getSlot in interface IMicroShrinkRender
    • getSlotMask

      public int getSlotMask()
      Description copied from interface: SlottedPart
      a bitmask of slots that this part fills. slot x is 1invalid input: '<'invalid input: '<'x
      Specified by:
      getSlotMask in interface SlottedPart
    • 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
      Parameters:
      npart - The part to run the test against.
      Returns:
      true if both this part and npart are able to share this block space.
    • 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.
    • 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()
    • getPriorityClass

      public int getPriorityClass()
      Specified by:
      getPriorityClass in interface IMicroShrinkRender