Class BlockEntitySculkSensor

All Implemented Interfaces:
VibrationListener, Cloneable

@PowerNukkitXOnly @Since("1.6.0.0-PNX") public class BlockEntitySculkSensor extends BlockEntity implements VibrationListener
Author:
Kevims KCodeYT
  • Field Details

    • lastActiveTime

      protected int lastActiveTime
    • lastVibrationEvent

      protected VibrationEvent lastVibrationEvent
    • power

      protected int power
    • comparatorPower

      protected int comparatorPower
    • waitForVibration

      protected boolean waitForVibration
  • Constructor Details

  • Method Details

    • initBlockEntity

      protected void initBlockEntity()
      Overrides:
      initBlockEntity in class BlockEntity
    • onBreak

      public void onBreak()
      Overrides:
      onBreak in class BlockEntity
    • close

      public void close()
      Overrides:
      close in class BlockEntity
    • isBlockEntityValid

      public boolean isBlockEntityValid()
      Specified by:
      isBlockEntityValid in class BlockEntity
    • getListenerVector

      public Position getListenerVector()
      Description copied from interface: VibrationListener
      返回振动监听器的位置
      Specified by:
      getListenerVector in interface VibrationListener
      Returns:
      Vector3
    • onVibrationOccur

      public boolean onVibrationOccur(VibrationEvent event)
      Description copied from interface: VibrationListener
      是否响应此振动 若响应,将会从声波源发射声波到监听器位置,并在到达时调用 onVibrationArrive() 方法 请注意,若此方法被调用,则声波必定可到达
      Specified by:
      onVibrationOccur in interface VibrationListener
      Parameters:
      event - 振动事件
      Returns:
      boolean
    • onVibrationArrive

      public void onVibrationArrive(VibrationEvent event)
      Description copied from interface: VibrationListener
      声波到达事件
      Specified by:
      onVibrationArrive in interface VibrationListener
      Parameters:
      event - 振动事件
    • getLastVibrationEvent

      public VibrationEvent getLastVibrationEvent()
    • getLastActiveTime

      public int getLastActiveTime()
    • getPower

      public int getPower()
    • getComparatorPower

      public int getComparatorPower()
    • getListenRange

      public double getListenRange()
      Description copied from interface: VibrationListener
      返回振动监听半径
      Specified by:
      getListenRange in interface VibrationListener
      Returns:
      double
    • updateLastActiveTime

      protected void updateLastActiveTime()
    • calPower

      public void calPower()