Class ChainConveyorBlockEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
All Implemented Interfaces:
TransformableBlockEntity, IHaveCustomOverlayIcon, IHaveGoggleInformation, IHaveHoveringInformation, PartialSafeNBT, SpecialBlockEntityItemRequirement, IInteractionChecker, net.createmod.ponder.api.VirtualBlockEntity, net.minecraft.world.Clearable, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.IBlockEntityExtension

public class ChainConveyorBlockEntity extends KineticBlockEntity implements TransformableBlockEntity, net.minecraft.world.Clearable
  • Field Details

  • Constructor Details

    • ChainConveyorBlockEntity

      public ChainConveyorBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> typeIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • createRenderBoundingBox

      protected net.minecraft.world.phys.AABB createRenderBoundingBox()
      Overrides:
      createRenderBoundingBox in class CachedRenderBBBlockEntity
    • lazyTick

      public void lazyTick()
      Overrides:
      lazyTick in class SmartBlockEntity
    • canAcceptMorePackages

      public boolean canAcceptMorePackages()
    • canAcceptPackagesFor

      public boolean canAcceptPackagesFor(@Nullable @Nullable net.minecraft.core.BlockPos connection)
    • canAcceptMorePackagesFromOtherConveyor

      public boolean canAcceptMorePackagesFromOtherConveyor()
    • addToTooltip

      public boolean addToTooltip(List<net.minecraft.network.chat.Component> tooltip, boolean isPlayerSneaking)
      Description copied from interface: IHaveHoveringInformation
      This method will be called when looking at a BlockEntity that implements this interface
      Specified by:
      addToTooltip in interface IHaveHoveringInformation
      Overrides:
      addToTooltip in class KineticBlockEntity
      Returns:
      true if the tooltip creation was successful and should be displayed, or false if the overlay should not be displayed
    • tick

      public void tick()
      Overrides:
      tick in class KineticBlockEntity
    • removeInvalidConnections

      public void removeInvalidConnections()
    • notifyConnectedToValidate

      public void notifyConnectedToValidate()
    • tickBoxVisuals

      public void tickBoxVisuals()
    • loopThresholdCrossed

      public boolean loopThresholdCrossed(float chainPosition, float prevChainPosition, float offBranchAngle)
    • addTravellingPackage

      public boolean addTravellingPackage(ChainConveyorPackage box, net.minecraft.core.BlockPos connection)
    • notifyUpdate

      public void notifyUpdate()
      Overrides:
      notifyUpdate in class SyncedBlockEntity
    • addLoopingPackage

      public boolean addLoopingPackage(ChainConveyorPackage box)
    • prepareStats

      public void prepareStats()
    • updateBoxWorldPositions

      public void updateBoxWorldPositions()
    • getPackagePosition

      public net.minecraft.world.phys.Vec3 getPackagePosition(float chainPosition, @Nullable @Nullable net.minecraft.core.BlockPos travelTarget)
    • addConnectionTo

      public boolean addConnectionTo(net.minecraft.core.BlockPos target)
    • chainDestroyed

      public void chainDestroyed(net.minecraft.core.BlockPos target, boolean spawnDrops, boolean sendEffect)
    • removeConnectionTo

      public boolean removeConnectionTo(net.minecraft.core.BlockPos target)
    • remove

      public void remove()
      Description copied from class: SmartBlockEntity
      Block destroyed or picked up by a contraption. Usually detaches kinetics
      Overrides:
      remove in class KineticBlockEntity
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface net.minecraft.world.Clearable
    • destroy

      public void destroy()
      Description copied from class: SmartBlockEntity
      Block destroyed or replaced. Requires Block to call IBE::onRemove
      Overrides:
      destroy in class SmartBlockEntity
    • forPointsAlongChains

      public boolean forPointsAlongChains(net.minecraft.core.BlockPos connection, int positions, Consumer<net.minecraft.world.phys.Vec3> callback)
    • invalidate

      public void invalidate()
      Description copied from class: SmartBlockEntity
      Block destroyed or Chunk unloaded. Usually invalidates capabilities
      Overrides:
      invalidate in class SmartBlockEntity
    • addPropagationLocations

      public List<net.minecraft.core.BlockPos> addPropagationLocations(IRotate block, net.minecraft.world.level.block.state.BlockState state, List<net.minecraft.core.BlockPos> neighbours)
      Description copied from class: KineticBlockEntity
      Specify additional locations the rotation propagator should look for potentially connected components. Neighbour list contains offset positions in all 6 directions by default.
      Overrides:
      addPropagationLocations in class KineticBlockEntity
      Parameters:
      block -
      state -
      neighbours -
      Returns:
    • propagateRotationTo

      public float propagateRotationTo(KineticBlockEntity target, net.minecraft.world.level.block.state.BlockState stateFrom, net.minecraft.world.level.block.state.BlockState stateTo, net.minecraft.core.BlockPos diff, boolean connectedViaAxes, boolean connectedViaCogs)
      Description copied from class: KineticBlockEntity
      Specify ratio of transferred rotation from this kinetic component to a specific other.
      Overrides:
      propagateRotationTo in class KineticBlockEntity
      Parameters:
      target - other Kinetic BE to transfer to
      stateFrom - this BE's blockstate
      stateTo - other BE's blockstate
      diff - difference in position (to.pos - from.pos)
      connectedViaAxes - whether these kinetic blocks are connected via mutual IRotate.hasShaftTowards()
      connectedViaCogs - whether these kinetic blocks are connected via mutual IRotate.hasIntegratedCogwheel()
      Returns:
      factor of rotation speed from this BE to other. 0 if no rotation is transferred, or the standard rules apply (integrated shafts/cogs)
    • writeSafe

      public void writeSafe(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries)
      Description copied from interface: PartialSafeNBT
      This will always be called from the logical server
      Specified by:
      writeSafe in interface PartialSafeNBT
      Overrides:
      writeSafe in class SmartBlockEntity
    • write

      protected void write(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
      Description copied from class: SmartBlockEntity
      Hook only these in future subclasses of STE
      Overrides:
      write in class KineticBlockEntity
    • read

      protected void read(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
      Description copied from class: SmartBlockEntity
      Hook only these in future subclasses of STE
      Overrides:
      read in class KineticBlockEntity
    • wrapAngle

      public float wrapAngle(float angle)
    • getChainCost

      public static int getChainCost(net.minecraft.core.BlockPos connection)
    • getChainsFromInventory

      public static boolean getChainsFromInventory(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack chain, int cost, boolean simulate)
    • getLoopingPackages

      public List<ChainConveyorPackage> getLoopingPackages()
    • getTravellingPackages

      public Map<net.minecraft.core.BlockPos,List<ChainConveyorPackage>> getTravellingPackages()
    • getRequiredItems

      public ItemRequirement getRequiredItems(net.minecraft.world.level.block.state.BlockState state)
      Specified by:
      getRequiredItems in interface SpecialBlockEntityItemRequirement
      Overrides:
      getRequiredItems in class SmartBlockEntity
    • transform

      public void transform(net.minecraft.world.level.block.entity.BlockEntity be, StructureTransform transform)
      Specified by:
      transform in interface TransformableBlockEntity