public interface ModelInjector
CustomItem
or a class that extends the
CustomItem
. Otherwise, it will not be able to inject the textures,
unless the inject(ItemModel, File)
is overriden with your own
code.
This interface will allow you to define your own model for your custom item.
Created by fihgu, improved by chrismin13.
CustomTexturedItem
Modifier and Type | Method and Description |
---|---|
default void |
addTexture(java.lang.String texture)
Add a Texture Name that will be included with the Textured Item.
|
default void |
checkCustomItem()
Check if this instancce of ModelInjector is a CustomItem.
|
java.util.HashMap<java.lang.String,java.lang.Short> |
getAllTextures()
This is needed for later use and will be filled with Texture Names when
using
addTexture(String) and with the appropriate durability
values when the API is enabled. |
default DamageableItem |
getDamageableItem()
Get the DamageableItem of the CustomTexturedItem.
|
java.lang.String |
getDefaultTexture() |
java.util.HashMap<ModelInjection,java.lang.Short> |
getOverrideEntries()
Provide your override entry to define the model that you want to use.
The "damaged" and "damage" tag will be automatically defined by the toolbox, you don't need to worry about them. |
default java.lang.String |
getTexture(short durability)
This is only valid after the API has been enabled.
|
default void |
inject(ItemModel baseModel,
java.io.File workspace)
Inject the override entries into the base model.
|
java.util.HashMap<ModelInjection,java.lang.Short> getOverrideEntries()
Provide your override entry to define the model that you want to use.
The "damaged" and "damage" tag will be automatically defined by the
toolbox, you don't need to worry about them.
Note: You should at least provide an entry with a empty predicate tag that points to your basic model
-- The base model is the original item's model, we inject a override entry so it will display the model we defined when an itemstack matches our custom item id.
java.util.HashMap<java.lang.String,java.lang.Short> getAllTextures()
addTexture(String)
and with the appropriate durability
values when the API is enabled. Here's some example code: private Map overrideModels = new HashMap();
@Override
public Map getAllTextures() {
return overrideModels;
}
default void addTexture(java.lang.String texture)
texture
- The Texture Name.default java.lang.String getTexture(short durability)
durability
- The durability Value.java.lang.String getDefaultTexture()
default void checkCustomItem()
default void inject(ItemModel baseModel, java.io.File workspace)
default DamageableItem getDamageableItem()