mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-18 11:19:20 +00:00
Make registration of itemmeta-dynamic models more flexible
This commit is contained in:
1 parent
858c6ed033
commit
6721bd104a
1 file changed
+2
-2
@@ -96,13 +96,13 @@ public class ItemMetaDynamic extends Item {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerItemModels() {
|
||||
public void registerItemModels(final String prefix) {
|
||||
final String resourceId = Loader.instance().activeModContainer().getModId().toLowerCase();
|
||||
final Item item = this;
|
||||
names.forEachEntry(new TIntObjectProcedure<String>() {
|
||||
@Override
|
||||
public boolean execute(int meta, String name) {
|
||||
name = String.format("%s:%s", resourceId, 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"));
|
||||
|
||||
Reference in new issue
Block a user