public final class Items
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static ItemInfo |
get(net.minecraft.item.ItemStack stack)
Get a descriptor object for the block or item represented by the
specified item stack.
|
static ItemInfo |
get(java.lang.String name)
Get a descriptor object for the block or item with the specified name.
|
static net.minecraft.item.ItemStack |
registerEEPROM(java.lang.String name,
byte[] code,
byte[] data,
boolean readonly)
Register a single custom EEPROM.
|
static net.minecraft.item.ItemStack |
registerFloppy(java.lang.String name,
int color,
java.util.concurrent.Callable<FileSystem> factory)
Deprecated.
use
registerFloppy(String, int, Callable, boolean) instead. |
static net.minecraft.item.ItemStack |
registerFloppy(java.lang.String name,
int color,
java.util.concurrent.Callable<FileSystem> factory,
boolean doRecipeCycling)
Register a single loot floppy disk.
|
public static ItemInfo get(java.lang.String name)
API.items
may not have been initialized
at that time. Only start calling these methods in the init phase or later.name
- the name of the item to get the descriptor for.public static ItemInfo get(net.minecraft.item.ItemStack stack)
stack
- the stack to get the descriptor for.@Deprecated public static net.minecraft.item.ItemStack registerFloppy(java.lang.String name, int color, java.util.concurrent.Callable<FileSystem> factory)
registerFloppy(String, int, Callable, boolean)
instead.FileSystem.fromClass(java.lang.Class<?>, java.lang.String, java.lang.String)
in your callable.
Call this in the init phase or later, not in pre-init.name
- the label and identifier to use for the loot disk.color
- the color of the disk, as a Minecraft color (so 0-15,
with 0 being black, 1 red and so on).factory
- the callable to call for creating file system instances.public static net.minecraft.item.ItemStack registerFloppy(java.lang.String name, int color, java.util.concurrent.Callable<FileSystem> factory, boolean doRecipeCycling)
FileSystem.fromClass(java.lang.Class<?>, java.lang.String, java.lang.String)
in your callable.
If doRecipeCycling is true, the floppy disk will be
included in the floppy disk recipe cycle if that is enabled.
Call this in the init phase or later, not in pre-init.name
- the label and identifier to use for the loot disk.color
- the color of the disk, as a Minecraft color (so 0-15,
with 0 being black, 1 red and so on).factory
- the callable to call for creating file system instances.doRecipeCycling
- whether to include this floppy disk in floppy disk cycling.public static net.minecraft.item.ItemStack registerEEPROM(java.lang.String name, byte[] code, byte[] data, boolean readonly)
name
- the label of the EEPROM.code
- the code section of the EEPROM.data
- the data section of the EEPROM.readonly
- whether the code section is read-only.