mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-21 20:42:26 +00:00
Change ItemMeta to use blockstates instead of separate item model files. Much more convenient >_>
This commit is contained in:
1 parent
8461f768d7
commit
d3e18d2a45
2 files changed
+6
-8
No files matched your search
@@ -104,7 +104,7 @@ public class ItemEdible extends ItemFood {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerItemModels(final String prefix) {
|
||||
dynamic.registerItemModels(prefix, this);
|
||||
public void registerItemModels() {
|
||||
dynamic.registerItemModels(this);
|
||||
}
|
||||
}
|
||||
@@ -99,20 +99,18 @@ public class ItemMetaDynamic extends Item {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerItemModels(final String prefix) {
|
||||
registerItemModels(prefix, this);
|
||||
public void registerItemModels() {
|
||||
registerItemModels(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected void registerItemModels(final String prefix, final Item item) {
|
||||
protected void registerItemModels(final Item item) {
|
||||
final String resourceId = Loader.instance().activeModContainer().getModId().toLowerCase();
|
||||
names.forEachEntry(new TIntObjectProcedure<String>() {
|
||||
@Override
|
||||
public boolean execute(int meta, String name) {
|
||||
name = String.format("%s:%s%s", resourceId, prefix, name);
|
||||
ModelBakery.addVariantName(item, name);
|
||||
// tell the game which model to use for this item-meta combination
|
||||
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(name, "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), name));
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user