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 Summary
Modifier and TypeMethodDescriptiondefault voidgetAdditionalInfo(List<net.minecraft.network.chat.Component> info) Return some descriptive text to be displayed above the optional textboxSeegetDescription()default StringOnly used ifgetHelpText()returns a non-empty string; return a translation key for a "Hold F1" type message for this sensor.default StringIf 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.Return the upgrades required by this sensor.Return the button path the player has to follow in which this setting is stored.default RangedIntFor numeric textboxes (seeneedsTextBox()), get the permitted numeric range.getTextBoxOptions(net.minecraft.world.entity.player.Player player) If a textbox is to be displayed (seeneedsTextBox()), this can be used to return a list of possible values.default booleanDeprecated.booleanShould this sensor's GUI display a text box for extra information to be entered?default booleanIfgetTextBoxOptions(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.
-
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
For numeric textboxes (seeneedsTextBox()), get the permitted numeric range.- Returns:
- the numeric range, or null if the textbox should allow freeform text
-
isEntityFilter
Deprecated.don't override this; usegetHelpText()If a textbox is to be displayed (seeneedsTextBox()), is this textbox for an entity filter?- Returns:
- true if this is an entity filter, false otherwise
-
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
Only used ifgetHelpText()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
If a textbox is to be displayed (seeneedsTextBox()), 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()IfgetTextBoxOptions(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
SeegetDescription()- Returns:
-
getAdditionalInfo
Return some descriptive text to be displayed above the optional textbox- Parameters:
info- a text component list to be appended to
-
getHelpText()