Enum Class Instruction
java.lang.Object
java.lang.Enum<Instruction>
io.github.thebusybiscuit.slimefun4.implementation.items.androids.Instruction
- All Implemented Interfaces:
Serializable,Comparable<Instruction>,Constable
This enum holds every
Instruction for the ProgrammableAndroid
added by Slimefun itself.- Author:
- TheBusyBiscuit
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis will make aButcherAndroidattack anyAnimalahead of them.This will make aButcherAndroidattack any adultAnimalahead of them.This will make aButcherAndroidattack anyMonsterahead of them.This will make aButcherAndroidattack anyLivingEntityahead of them.ThisInstructionmakes aFishermanAndroidtry to catch fish from the water below.This will make aWoodcutterAndroidchop down the tree in front of them.This will make aMinerAndroiddig theBlockbelow.This will make aMinerAndroiddig theBlockahead.This will make aMinerAndroiddig theBlockabove.This will make theProgrammableAndroidgo down.This will make theProgrammableAndroidgo forward.This will make theProgrammableAndroidgo up.ThisInstructionwill force theProgrammableAndroidto pull fuel from anAndroidInterfaceahead of them.ThisInstructionwill force theProgrammableAndroidto push their items into anAndroidInterfaceahead of them.ThisInstructionis the end token of aScript.ThisInstructionis the starting point of aScript.This will make theProgrammableAndroidrotate to the left side.This will make theProgrammableAndroidrotate to the right side.ThisInstructionwill make theProgrammableAndroidwait for one Slimefun tick. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(ProgrammableAndroid android, Block b, BlockMenu inventory, BlockFace face) static InstructiongetInstruction(String value) Get a value from the cache map rather than callingEnum.valueOf(Class, String).getItem()static InstructionReturns the enum constant of this class with the specified name.static Instruction[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
START
ThisInstructionis the starting point of aScript. -
REPEAT
ThisInstructionis the end token of aScript. Once thisInstructionis reached, theScriptwill start again. -
WAIT
ThisInstructionwill make theProgrammableAndroidwait for one Slimefun tick. -
GO_FORWARD
This will make theProgrammableAndroidgo forward. -
GO_UP
This will make theProgrammableAndroidgo up. -
GO_DOWN
This will make theProgrammableAndroidgo down. -
TURN_LEFT
This will make theProgrammableAndroidrotate to the left side. -
TURN_RIGHT
This will make theProgrammableAndroidrotate to the right side. -
DIG_UP
This will make aMinerAndroiddig theBlockabove. -
DIG_FORWARD
This will make aMinerAndroiddig theBlockahead. -
DIG_DOWN
This will make aMinerAndroiddig theBlockbelow. -
MOVE_AND_DIG_UP
-
MOVE_AND_DIG_FORWARD
-
MOVE_AND_DIG_DOWN
-
ATTACK_MOBS_ANIMALS
This will make aButcherAndroidattack anyLivingEntityahead of them. -
ATTACK_MOBS
This will make aButcherAndroidattack anyMonsterahead of them. -
ATTACK_ANIMALS
This will make aButcherAndroidattack anyAnimalahead of them. -
ATTACK_ANIMALS_ADULT
This will make aButcherAndroidattack any adultAnimalahead of them. -
CHOP_TREE
This will make aWoodcutterAndroidchop down the tree in front of them. -
CATCH_FISH
ThisInstructionmakes aFishermanAndroidtry to catch fish from the water below. -
FARM_FORWARD
-
FARM_DOWN
-
FARM_EXOTIC_FORWARD
ThisInstructionwill make aFarmerAndroidtry to harvest theBlockin front of them. This includes plants from ExoticGarden. -
FARM_EXOTIC_DOWN
ThisInstructionwill make aFarmerAndroidtry to harvest theBlockbelow. This includes plants from ExoticGarden. -
INTERFACE_ITEMS
ThisInstructionwill force theProgrammableAndroidto push their items into anAndroidInterfaceahead of them. -
INTERFACE_FUEL
ThisInstructionwill force theProgrammableAndroidto pull fuel from anAndroidInterfaceahead of them.
-
-
Field Details
-
valuesCache
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getItem
-
getRequiredType
-
execute
@ParametersAreNonnullByDefault public void execute(ProgrammableAndroid android, Block b, BlockMenu inventory, BlockFace face) -
getInstruction
Get a value from the cache map rather than callingEnum.valueOf(Class, String). This is 25-40% quicker than the standardEnum.valueOf(Class, String)depending on your Java version. It also means that you can avoid an IllegalArgumentException which let's face it is always good.- Parameters:
value- The value which you would like to look up.- Returns:
- The
Instructionor null if it does not exist.
-