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 ConstantDescriptionThis will make aButcherAndroid
attack anyAnimal
ahead of them.This will make aButcherAndroid
attack any adultAnimal
ahead of them.This will make aButcherAndroid
attack anyMonster
ahead of them.This will make aButcherAndroid
attack anyLivingEntity
ahead of them.ThisInstruction
makes aFishermanAndroid
try to catch fish from the water below.This will make aWoodcutterAndroid
chop down the tree in front of them.This will make aMinerAndroid
dig theBlock
below.This will make aMinerAndroid
dig theBlock
ahead.This will make aMinerAndroid
dig theBlock
above.This will make theProgrammableAndroid
go down.This will make theProgrammableAndroid
go forward.This will make theProgrammableAndroid
go up.ThisInstruction
will force theProgrammableAndroid
to pull fuel from anAndroidInterface
ahead of them.ThisInstruction
will force theProgrammableAndroid
to push their items into anAndroidInterface
ahead of them.ThisInstruction
is the end token of aScript
.ThisInstruction
is the starting point of aScript
.This will make theProgrammableAndroid
rotate to the left side.This will make theProgrammableAndroid
rotate to the right side.ThisInstruction
will make theProgrammableAndroid
wait for one Slimefun tick. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(ProgrammableAndroid android, Block b, BlockMenu inventory, BlockFace face) static Instruction
getInstruction
(String value) Get a value from the cache map rather than callingEnum.valueOf(Class, String)
.getItem()
static Instruction
Returns 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
ThisInstruction
is the starting point of aScript
. -
REPEAT
ThisInstruction
is the end token of aScript
. Once thisInstruction
is reached, theScript
will start again. -
WAIT
ThisInstruction
will make theProgrammableAndroid
wait for one Slimefun tick. -
GO_FORWARD
This will make theProgrammableAndroid
go forward. -
GO_UP
This will make theProgrammableAndroid
go up. -
GO_DOWN
This will make theProgrammableAndroid
go down. -
TURN_LEFT
This will make theProgrammableAndroid
rotate to the left side. -
TURN_RIGHT
This will make theProgrammableAndroid
rotate to the right side. -
DIG_UP
This will make aMinerAndroid
dig theBlock
above. -
DIG_FORWARD
This will make aMinerAndroid
dig theBlock
ahead. -
DIG_DOWN
This will make aMinerAndroid
dig theBlock
below. -
MOVE_AND_DIG_UP
-
MOVE_AND_DIG_FORWARD
-
MOVE_AND_DIG_DOWN
-
ATTACK_MOBS_ANIMALS
This will make aButcherAndroid
attack anyLivingEntity
ahead of them. -
ATTACK_MOBS
This will make aButcherAndroid
attack anyMonster
ahead of them. -
ATTACK_ANIMALS
This will make aButcherAndroid
attack anyAnimal
ahead of them. -
ATTACK_ANIMALS_ADULT
This will make aButcherAndroid
attack any adultAnimal
ahead of them. -
CHOP_TREE
This will make aWoodcutterAndroid
chop down the tree in front of them. -
CATCH_FISH
ThisInstruction
makes aFishermanAndroid
try to catch fish from the water below. -
FARM_FORWARD
-
FARM_DOWN
-
FARM_EXOTIC_FORWARD
ThisInstruction
will make aFarmerAndroid
try to harvest theBlock
in front of them. This includes plants from ExoticGarden. -
FARM_EXOTIC_DOWN
ThisInstruction
will make aFarmerAndroid
try to harvest theBlock
below. This includes plants from ExoticGarden. -
INTERFACE_ITEMS
ThisInstruction
will force theProgrammableAndroid
to push their items into anAndroidInterface
ahead of them. -
INTERFACE_FUEL
ThisInstruction
will force theProgrammableAndroid
to pull fuel from anAndroidInterface
ahead 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
Instruction
or null if it does not exist.
-