Interface IBaseSensor

All Known Subinterfaces:
IBlockAndCoordinateEventSensor, IBlockAndCoordinatePollSensor, IEventSensorSetting, IPollSensorSetting, ISensorSetting
All Known Implementing Classes:
BlockComparatorSensor, BlockHeatSensor, BlockInteractSensor, BlockLightLevelSensor, BlockPresenceSensor, BlockRedstoneSensor, ConstantSensor, EntityInRangeSensor, PlayerAttackSensor, PlayerHealthSensor, PlayerItemPickupSensor, TwitchStreamerSensor, WorldDayLightSensor, WorldGlobalVariableAnalogSensor, WorldGlobalVariableSensor, WorldPlayersInServerSensor, WorldRainingSensor, WorldTicktimeSensor, WorldTimeSensor, WorldWeatherForecaster

public interface IBaseSensor
  • Method Details

    • getSensorPath

      String getSensorPath()
      Return the button path the player has to follow in which this setting is stored. For instance, when the sensor should be located in player and is called speed, you should return "player/speed".
      Returns:
      a string path to the sensor
    • getRequiredUpgrades

      Set<PNCUpgrade> getRequiredUpgrades()
      Return the upgrades required by this sensor. This will automatically include a GPS Tool for sensors that require a location.
      Returns:
      a set of upgrades
    • needsTextBox

      boolean needsTextBox()
      Should this sensor's GUI display a text box for extra information to be entered?
      Returns:
      true if this sensor needs a text box, false otherwise
    • getTextboxIntRange

      default RangedInt getTextboxIntRange()
      For numeric textboxes (see needsTextBox()), get the permitted numeric range.
      Returns:
      the numeric range, or null if the textbox should allow freeform text
    • isEntityFilter

      @Deprecated default boolean isEntityFilter()
      Deprecated.
      don't override this; use getHelpText()
      If a textbox is to be displayed (see needsTextBox()), is this textbox for an entity filter?
      Returns:
      true if this is an entity filter, false otherwise
    • getHelpText

      default String getHelpText()
      If this sensor should have a popup help panel, return a translation key here for the help text which should be shown when F1 is held down. The translated text can include line breaks; use the sequence {br} for that.
      Returns:
      help text translation key, or the empty string for no help text
    • getHelpPromptText

      default String getHelpPromptText()
      Only used if getHelpText() returns a non-empty string; return a translation key for a "Hold F1" type message for this sensor.
      Returns:
      a translation key, or the empty string for no help prompt text
    • getTextBoxOptions

      default List<String> getTextBoxOptions(net.minecraft.world.entity.player.Player player)
      If a textbox is to be displayed (see needsTextBox()), this can be used to return a list of possible values. If this returns a non-null result, the textbox will become a combo box with a drop-down for the values returned.
      Parameters:
      player - the client player
      Returns:
      a list of possible values, or null if the textbox should be purely free-form
    • strictComboBox

      default boolean strictComboBox()
      If getTextBoxOptions(Player) returns a non-null result, this can be used to control if the returned options are the only possible values, or whether the textbox should continue to allow free-form text insertion.
      Returns:
      true for strict combo box behaviour, false to allow freeform text insertion
    • getDescription

      default List<String> getDescription()
      Returns:
    • getAdditionalInfo

      default void getAdditionalInfo(List<net.minecraft.network.chat.Component> info)
      Return some descriptive text to be displayed above the optional textbox
      Parameters:
      info - a text component list to be appended to