JsMacros
com.jsmacrosce.jsmacros.client.JsMacros
Shared bootstrap constants, loader access, and integer-array utilities.
Class initialization requests ConfigFolder and ModLoader service providers;
at least one provider of each must be available.
js
const JsMacros = Java.type('com.jsmacrosce.jsmacros.client.JsMacros');
const values = JsMacros.range(3);
Chat.log(values[2]);Constructors
new JsMacros
new JsMacros()#Fields
LOGGER
MOD_ID
Methods
getModLoader
onInitialize
static onInitialize(): void#Common initialization hook; currently performs no initialization.
range
static range(int end): int[]#Returns consecutive integers from zero up to, but not including,
end. The array length is end.Parameters:
end: exclusive upper bound; must be nonnegative and representable as an array length
Returns: the consecutive values from zero to
end - 1static range(int start, int end): int[]#Returns consecutive integers from
start up to, but not including, end. The array length is end - start, which must be nonnegative and representable as an array length.Parameters:
start: inclusive first valueend: exclusive upper bound, at leaststart
Returns: the consecutive values from
start to end - 1static range(int start, int end, int iter): int[]#Allocates an array of length
end - start; values reached by repeatedly adding iter from start are stored at their offset from start. Unvisited offsets remain zero; for example, range(2, 7, 2) returns [2, 0, 4, 0, 6]. A positive step advances toward end only if integer addition does not overflow; zero does not advance and the loop does not terminate when start < end, and a negative step is not a descending-range mode. The difference must produce a nonnegative array length; integer overflow and invalid steps are not checked.Parameters:
start: inclusive first valueend: exclusive upper bounditer: step added after each value; use a positive step that does not overflow when added to advance towardend
Returns: the allocated array with reached values at their corresponding offsets