Class HbmDoorPartInteractionBehaviour

java.lang.Object
com.simibubi.create.api.behaviour.interaction.MovingInteractionBehaviour
com.hbm_m.compat.create.HbmDoorPartInteractionBehaviour

public class HbmDoorPartInteractionBehaviour extends com.simibubi.create.api.behaviour.interaction.MovingInteractionBehaviour
Right-click по блоку-ЧАСТИ двери (UniversalMachinePartBlock) на собранном поезде.

На земле UniversalMachinePartBlock.use роутит клик на контроллер через getControllerPos(). На контрапшене NBT-координаты контроллера — мировые, а blocks-map ключируется локальными позициями, поэтому прямой роутинг не работает. Контроллер достаётся из кэша ContraptionDoorState.getControllerForPart(net.minecraft.world.level.Level, net.minecraft.core.BlockPos), который наполняет DoorShapeComputer.populate на каждом тике behaviour; если записи ещё нет (дверь не успела тикнуть после сборки) — клик игнорируем, на следующем тике повторим.

Не-дверные parts (radar/launchpad/…) → в кэше отсутствуют → возвращаем false (клик не поглощаем).

  • Field Summary

    Fields inherited from class com.simibubi.create.api.behaviour.interaction.MovingInteractionBehaviour

    REGISTRY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    handlePlayerInteraction(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand activeHand, net.minecraft.core.BlockPos partLocalPos, com.simibubi.create.content.contraptions.AbstractContraptionEntity contraptionEntity)
     

    Methods inherited from class com.simibubi.create.api.behaviour.interaction.MovingInteractionBehaviour

    handleEntityCollision, interactionBehaviour, setContraptionActorData, setContraptionBlockData

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HbmDoorPartInteractionBehaviour

      public HbmDoorPartInteractionBehaviour()
  • Method Details

    • handlePlayerInteraction

      public boolean handlePlayerInteraction(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand activeHand, net.minecraft.core.BlockPos partLocalPos, com.simibubi.create.content.contraptions.AbstractContraptionEntity contraptionEntity)
      Overrides:
      handlePlayerInteraction in class com.simibubi.create.api.behaviour.interaction.MovingInteractionBehaviour