public class ItemFactory extends Factory<ItemFactory,Item> implements Identifiable, Translatable
constructor, id, processor, type| Constructor and Description |
|---|
ItemFactory(java.lang.String id,
java.lang.Class<? extends Item> type) |
ItemFactory(java.lang.String id,
java.lang.Class<? extends Item> type,
java.util.function.Function<Item,Item> processor) |
ItemFactory(java.lang.String id,
java.lang.Class<? extends Item> type,
java.util.function.Function<Item,Item> processor,
java.util.function.Function<java.lang.Class<?>,java.util.Optional<?>> mapping) |
ItemFactory(java.lang.String id,
java.util.function.Supplier<Item> constructor) |
ItemFactory(java.lang.String id,
java.util.function.Supplier<Item> constructor,
java.util.function.Function<Item,Item> processor) |
| Modifier and Type | Method and Description |
|---|---|
Item |
build()
Makes a new item with no data
|
Item |
build(Data data)
Creates a new instance of the Item.
|
java.lang.String |
getLocalizedName()
Gets the localized name of this object.
|
java.lang.String |
getUnlocalizedName()
Gets the unlocalized name of this object.
|
Data |
save(Item item) |
protected ItemFactory |
selfConstructor(java.lang.String id,
java.util.function.Supplier<Item> constructor,
java.util.function.Function<Item,Item> processor) |
ItemFactory |
setUnlocalizedName(java.lang.String unlocalizedName) |
getID, getType, process, selfConstructorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetID, sameTypegetReplacementspublic ItemFactory(java.lang.String id,
java.lang.Class<? extends Item> type,
java.util.function.Function<Item,Item> processor,
java.util.function.Function<java.lang.Class<?>,java.util.Optional<?>> mapping)
public ItemFactory(java.lang.String id,
java.lang.Class<? extends Item> type,
java.util.function.Function<Item,Item> processor)
public ItemFactory(java.lang.String id,
java.lang.Class<? extends Item> type)
public ItemFactory(java.lang.String id,
java.util.function.Supplier<Item> constructor,
java.util.function.Function<Item,Item> processor)
public ItemFactory(java.lang.String id,
java.util.function.Supplier<Item> constructor)
public Item build()
build in class Factory<ItemFactory,Item>public Item build(Data data)
data - Item data, used if item is Storablepublic ItemFactory setUnlocalizedName(java.lang.String unlocalizedName)
public java.lang.String getUnlocalizedName()
TranslatablegetUnlocalizedName in interface Translatablepublic java.lang.String getLocalizedName()
TranslatablegetLocalizedName in interface Translatableprotected ItemFactory selfConstructor(java.lang.String id, java.util.function.Supplier<Item> constructor, java.util.function.Function<Item,Item> processor)
selfConstructor in class Factory<ItemFactory,Item>