public interface Arguments
extends java.lang.Iterable<java.lang.Object>
Callback
.
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
checkAny(int index)
Get whatever is at the specified index.
|
boolean |
checkBoolean(int index)
Try to get a boolean value at the specified index.
|
byte[] |
checkByteArray(int index)
Try to get a byte array at the specified index.
|
double |
checkDouble(int index)
Try to get a double value at the specified index.
|
int |
checkInteger(int index)
Try to get an integer value at the specified index.
|
net.minecraft.item.ItemStack |
checkItemStack(int index)
Try to get an item stack representation at the specified index.
|
long |
checkLong(int index)
Try to get a long value at the specified index.
|
java.lang.String |
checkString(int index)
Try to get a string value at the specified index.
|
java.util.Map |
checkTable(int index)
Try to get a table at the specified index.
|
int |
count()
The total number of arguments that were passed to the function.
|
boolean |
isBoolean(int index)
Tests whether the argument at the specified index is a boolean value.
|
boolean |
isByteArray(int index)
Tests whether the argument at the specified index is a byte array.
|
boolean |
isDouble(int index)
Tests whether the argument at the specified index is a double value.
|
boolean |
isInteger(int index)
Tests whether the argument at the specified index is an integer value.
|
boolean |
isItemStack(int index)
Tests whether the argument at the specified index is an item stack.
|
boolean |
isLong(int index)
Tests whether the argument at the specified index is a long value.
|
boolean |
isString(int index)
Tests whether the argument at the specified index is a string value.
|
boolean |
isTable(int index)
Tests whether the argument at the specified index is a table.
|
java.lang.Object |
optAny(int index,
java.lang.Object def)
Get whatever is at the specified index.
|
boolean |
optBoolean(int index,
boolean def)
Try to get a boolean value at the specified index.
|
byte[] |
optByteArray(int index,
byte[] def)
Try to get a byte array at the specified index.
|
double |
optDouble(int index,
double def)
Try to get a double value at the specified index.
|
int |
optInteger(int index,
int def)
Try to get an integer value at the specified index.
|
net.minecraft.item.ItemStack |
optItemStack(int index,
net.minecraft.item.ItemStack def)
Try to get an item stack at the specified index.
|
long |
optLong(int index,
long def)
Try to get a long value at the specified index.
|
java.lang.String |
optString(int index,
java.lang.String def)
Try to get a string value at the specified index.
|
java.util.Map |
optTable(int index,
java.util.Map def)
Try to get a table at the specified index.
|
java.lang.Object[] |
toArray()
Converts the argument list to a standard Java array, converting byte
arrays to strings automatically, since this is usually what others
want - if you need the actual raw byte arrays, don't use this method!
|
int count()
java.lang.Object checkAny(int index)
index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if there is no argument at that index.boolean checkBoolean(int index)
index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if there is no argument at that index,
or if the argument is not a boolean.int checkInteger(int index)
index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if there is no argument at that index,
or if the argument is not a number.long checkLong(int index)
index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if there is no argument at that index,
or if the argument is not a number.double checkDouble(int index)
index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if there is no argument at that index,
or if the argument is not a number.java.lang.String checkString(int index)
index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if there is no argument at that index,
or if the argument is not a string.byte[] checkByteArray(int index)
index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if there is no argument at that index,
or if the argument is not a byte array.java.util.Map checkTable(int index)
index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if there is no argument at that index,
or if the argument is not a table.net.minecraft.item.ItemStack checkItemStack(int index)
Database
component to get complete item stack descriptors.index
- the index from which to get the argument.java.lang.Object optAny(int index, java.lang.Object def)
checkAny(int)
otherwise.
index
- the index from which to get the argument.boolean optBoolean(int index, boolean def)
checkBoolean(int)
otherwise.index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if the argument exists and is not a boolean.int optInteger(int index, int def)
checkInteger(int)
otherwise.index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if the argument exists but is not a number.long optLong(int index, long def)
checkLong(int)
otherwise.index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if the argument exists but is not a number.double optDouble(int index, double def)
checkDouble(int)
otherwise.index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if the argument exists and is not a number.java.lang.String optString(int index, java.lang.String def)
checkString(int)
otherwise.
index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if the argument exists and is not a string.byte[] optByteArray(int index, byte[] def)
checkByteArray(int)
otherwise.index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if the argument exists and is not a byte array.java.util.Map optTable(int index, java.util.Map def)
checkTable(int)
otherwise.index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if the argument exists and is not a table.net.minecraft.item.ItemStack optItemStack(int index, net.minecraft.item.ItemStack def)
checkItemStack(int)
otherwise.index
- the index from which to get the argument.java.lang.IllegalArgumentException
- if the argument exists and is not an item stack.boolean isBoolean(int index)
index
- the index to check.boolean isInteger(int index)
index
- the index to check.boolean isLong(int index)
index
- the index to check.boolean isDouble(int index)
index
- the index to check.boolean isString(int index)
index
- the index to check.boolean isByteArray(int index)
index
- the index to check.boolean isTable(int index)
index
- the index to check.boolean isItemStack(int index)
index
- the index to check.java.lang.Object[] toArray()