Skip to content
Open
3 changes: 3 additions & 0 deletions wiki/global-scope/bindings/Java/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: "Java"
description: "Methods for working with Java classes. Reflection utilities for loading and working with Java classes from JavaScript."

77 changes: 77 additions & 0 deletions wiki/global-scope/bindings/Java/page.kubedoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Java

**Java Class:** `dev.latvian.mods.kubejs.plugin.builtin.wrapper.JavaWrapper` - [View on GitHub](https://github.com/KubeJS-Mods/KubeJS)

Methods for working with Java classes. Reflection utilities for loading and working with Java classes from JavaScript.

|> 1.21.1

**Source:** [JavaWrapper.java](https://github.com/KubeJS-Mods/KubeJS/blob/main/src/main/java/dev/latvian/mods/kubejs/plugin/builtin/wrapper/JavaWrapper.java)

## Script Types

- Startup: ✓
- Server: ✓
- Client: ✓

## Members

### Static Methods

- `loadClass(className: string)`: Object - Loads the specified class, and throws error if class is not found or allowed. The returned object can have public static methods and fields accessed directly from it. Constructors can be used with the new keyword.
- `tryLoadClass(className: string)`: Object | null - Loads the specified class, and returns null if class is not found or allowed. The returned object can have public static methods and fields accessed directly from it. Constructors can be used with the new keyword.
- `createConsole(name: string)`: ConsoleJS - Creates a custom ConsoleJS instance for logging
- `cast(targetClass: Class, object: Object)`: T - Cast the object to a target type, use if Rhino can't determine the parameter type due to type erasure.

## Examples

WIP

<||> 1.20.1

**Source:** [JavaWrapper.java](https://github.com/KubeJS-Mods/KubeJS/blob/2001/common/src/main/java/dev/latvian/mods/kubejs/bindings/JavaWrapper.java)

## Script Types

- Startup: ✓
- Server: ✓
- Client: ✓

## Members

### Static Methods

- `loadClass(className: string)`: Object - Loads the specified class, and throws error if class is not found or allowed. The returned object can have public static methods and fields accessed directly from it. Constructors can be used with the new keyword.
- `tryLoadClass(className: string)`: Object | null - Loads the specified class, and returns null if class is not found or allowed. The returned object can have public static methods and fields accessed directly from it. Constructors can be used with the new keyword.
- `createConsole(name: string)`: ConsoleJS - Creates a custom ConsoleJS instance for logging
- `cast(targetClass: Class, object: Object)`: T - Cast the object to a target type, use if Rhino can't determine the parameter type due to type erasure.

## Examples

WIP

<||> 1.19.2

**Source:** [JavaWrapper.java](https://github.com/KubeJS-Mods/KubeJS/blob/1902/common/src/main/java/dev/latvian/mods/kubejs/bindings/JavaWrapper.java)

## Script Types

- Startup: ✓
- Server: ✓
- Client: ✓

## Members

### Static Methods

- `loadClass(className: string)`: Object - Loads the specified class, and throws error if class is not found or allowed. The returned object can have public static methods and fields accessed directly from it. Constructors can be used with the new keyword.
- `tryLoadClass(className: string)`: Object | null - Loads the specified class, and returns null if class is not found or allowed. The returned object can have public static methods and fields accessed directly from it. Constructors can be used with the new keyword.
- `createConsole(name: string)`: ConsoleJS - Creates a custom ConsoleJS instance for logging
- `cast(targetClass: Class, object: Object)`: T - Cast the object to a target type, use if Rhino can't determine the parameter type due to type erasure.

## Examples

WIP

<|

3 changes: 3 additions & 0 deletions wiki/global-scope/bindings/Platform/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: "Platform"
description: "Platform information and utilities for accessing mod and Minecraft version information"

134 changes: 134 additions & 0 deletions wiki/global-scope/bindings/Platform/page.kubedoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Platform

**Java Class:** `dev.latvian.mods.kubejs.script.PlatformWrapper` - [View on GitHub](https://github.com/KubeJS-Mods/KubeJS)

Platform information and utilities for accessing mod and Minecraft version information.

|> 1.21.1

**Source:** [PlatformWrapper.java](https://github.com/KubeJS-Mods/KubeJS/blob/main/src/main/java/dev/latvian/mods/kubejs/script/PlatformWrapper.java)

## Script Types

- Startup: ✓
- Server: ✓
- Client: ✓

## Members

### Static Methods

- `getMcVersion()`: string - Returns the Minecraft version string
- `getModVersion()`: string - Returns the KubeJS mod version
- `getMinecraftVersion()`: number - Returns the Minecraft version number
- `getMinecraftVersionString()`: string - Returns the Minecraft version string
- `getList()`: Set<string> - Returns a set of all loaded mod IDs
- `isLoaded(modId: string)`: boolean - Checks if a mod with the given ID is loaded
- `getInfo(modId: string)`: ModInfo - Gets information about a mod
- `getMods()`: Map<string, ModInfo> - Returns a map of all loaded mods
- `isDevelopmentEnvironment()`: boolean - Checks if running in development environment
- `isClientEnvironment()`: boolean - Checks if running in client environment
- `setModName(modId: string, name: string)`: void - Sets the display name of a mod
- `isGeneratingData()`: boolean - Checks if data generation is running
- `breakpoint(...args)`: void - Debug breakpoint function
- `getCurrentThreadName()`: string - Returns the current thread name
- `getPackMode()`: string - Returns the current pack mode

### ModInfo Class

- `getId()`: string - Returns the mod ID
- `getName()`: string - Returns the mod name
- `getVersion()`: string - Returns the mod version
- `getCustomName()`: string - Returns the custom name
- `setName(name: string)`: void - Sets the mod name

## Examples

WIP

<||> 1.20.1

**Source:** [PlatformWrapper.java](https://github.com/KubeJS-Mods/KubeJS/blob/2001/common/src/main/java/dev/latvian/mods/kubejs/script/PlatformWrapper.java)

## Script Types

- Startup: ✓
- Server: ✓
- Client: ✓

## Members

### Static Methods

- `getMcVersion()`: string - Returns the Minecraft version string
- `getModVersion()`: string - Returns the KubeJS mod version
- `getMinecraftVersion()`: number - Returns the Minecraft version number
- `getMinecraftVersionString()`: string - Returns the Minecraft version string
- `getList()`: Set<string> - Returns a set of all loaded mod IDs
- `isLoaded(modId: string)`: boolean - Checks if a mod with the given ID is loaded
- `getInfo(modId: string)`: ModInfo - Gets information about a mod
- `getMods()`: Map<string, ModInfo> - Returns a map of all loaded mods
- `isDevelopmentEnvironment()`: boolean - Checks if running in development environment
- `isClientEnvironment()`: boolean - Checks if running in client environment
- `setModName(modId: string, name: string)`: void - Sets the display name of a mod
- `isGeneratingData()`: boolean - Checks if data generation is running
- `breakpoint(...args)`: void - Debug breakpoint function
- `getCurrentThreadName()`: string - Returns the current thread name
- `getPackMode()`: string - Returns the current pack mode

### ModInfo Class

- `getId()`: string - Returns the mod ID
- `getName()`: string - Returns the mod name
- `getVersion()`: string - Returns the mod version
- `getCustomName()`: string - Returns the custom name
- `setName(name: string)`: void - Sets the mod name

## Examples

WIP

<||> 1.19.2

**Source:** [PlatformWrapper.java](https://github.com/KubeJS-Mods/KubeJS/blob/1902/common/src/main/java/dev/latvian/mods/kubejs/script/PlatformWrapper.java)

## Script Types

- Startup: ✓
- Server: ✓
- Client: ✓

## Members

### Static Methods

- `getMcVersion()`: string - Returns the Minecraft version string
- `getModVersion()`: string - Returns the KubeJS mod version
- `getMinecraftVersion()`: number - Returns the Minecraft version number
- `getMinecraftVersionString()`: string - Returns the Minecraft version string
- `getList()`: Set<string> - Returns a set of all loaded mod IDs
- `isLoaded(modId: string)`: boolean - Checks if a mod with the given ID is loaded
- `getInfo(modId: string)`: ModInfo - Gets information about a mod
- `getMods()`: Map<string, ModInfo> - Returns a map of all loaded mods
- `isDevelopmentEnvironment()`: boolean - Checks if running in development environment
- `isClientEnvironment()`: boolean - Checks if running in client environment
- `setModName(modId: string, name: string)`: void - Sets the display name of a mod
- `isGeneratingData()`: boolean - Checks if data generation is running
- `breakpoint(...args)`: void - Debug breakpoint function
- `getCurrentThreadName()`: string - Returns the current thread name
- `getPackMode()`: string - Returns the current pack mode

### ModInfo Class

- `getId()`: string - Returns the mod ID
- `getName()`: string - Returns the mod name
- `getVersion()`: string - Returns the mod version
- `getCustomName()`: string - Returns the custom name
- `setName(name: string)`: void - Sets the mod name

## Examples

WIP

<|

3 changes: 3 additions & 0 deletions wiki/global-scope/bindings/Text/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: "Text"
description: "The hub for all things text components. Format text to your hearts content!"

86 changes: 86 additions & 0 deletions wiki/global-scope/bindings/Text/page.kubedoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Text

**Java Class:** `dev.latvian.mods.kubejs.plugin.builtin.wrapper.TextWrapper` - [View on GitHub](https://github.com/KubeJS-Mods/KubeJS)

The hub for all things text components. Format text to your hearts content!

|> 1.21.1

**Source:** [TextWrapper.java](https://github.com/KubeJS-Mods/KubeJS/blob/main/src/main/java/dev/latvian/mods/kubejs/plugin/builtin/wrapper/TextWrapper.java)

## Script Types

- Startup: ✓
- Server: ✓
- Client: ✓

## Members

### Static Methods

- `of(component: MutableComponent)`: MutableComponent - Returns a Component of the input
- `ofString(text: string)`: MutableComponent - Creates a literal text component
- `translatable(key: string, ...args)`: MutableComponent - Creates a translatable text component
- `keybind(key: string)`: MutableComponent - Creates a keybind text component
- `score(name: string, objective: string)`: MutableComponent - Creates a score text component
- `selector(selector: string)`: MutableComponent - Creates a selector text component
- `lore(lore: List<Component>)`: ItemLore - Creates an ItemLore from a list of components

## Examples

WIP

<||> 1.20.1

**Source:** [TextWrapper.java](https://github.com/KubeJS-Mods/KubeJS/blob/2001/common/src/main/java/dev/latvian/mods/kubejs/bindings/TextWrapper.java)

## Script Types

- Startup: ✓
- Server: ✓
- Client: ✓

## Members

### Static Methods

- `of(component: MutableComponent)`: MutableComponent - Returns a Component of the input
- `ofString(text: string)`: MutableComponent - Creates a literal text component
- `translatable(key: string, ...args)`: MutableComponent - Creates a translatable text component
- `keybind(key: string)`: MutableComponent - Creates a keybind text component
- `score(name: string, objective: string)`: MutableComponent - Creates a score text component
- `selector(selector: string)`: MutableComponent - Creates a selector text component
- `lore(lore: List<Component>)`: ItemLore - Creates an ItemLore from a list of components

## Examples

WIP

<||> 1.19.2

**Source:** [TextWrapper.java](https://github.com/KubeJS-Mods/KubeJS/blob/1902/common/src/main/java/dev/latvian/mods/kubejs/bindings/TextWrapper.java)

## Script Types

- Startup: ✓
- Server: ✓
- Client: ✓

## Members

### Static Methods

- `of(component: MutableComponent)`: MutableComponent - Returns a Component of the input
- `ofString(text: string)`: MutableComponent - Creates a literal text component
- `translatable(key: string, ...args)`: MutableComponent - Creates a translatable text component
- `keybind(key: string)`: MutableComponent - Creates a keybind text component
- `score(name: string, objective: string)`: MutableComponent - Creates a score text component
- `selector(selector: string)`: MutableComponent - Creates a selector text component
- `lore(lore: List<Component>)`: ItemLore - Creates an ItemLore from a list of components

## Examples

WIP

<|

3 changes: 3 additions & 0 deletions wiki/global-scope/bindings/Utils/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: "Utils"
description: "A collection of utilities for common operations"

Loading