public static void setBucketModelDefinition(Item item) { ModelLoader.setCustomMeshDefinition( item, new ItemMeshDefinition() { @Override public ModelResourceLocation getModelLocation(ItemStack stack) { return ModelDynBucket.LOCATION; } }); ModelBakery.registerItemVariants(item, ModelDynBucket.LOCATION); }
/** * Adds a simple mapping from Item + metadata to the model variant. Registers the variant with the * ModelBakery too. */ public static void setCustomModelResourceLocation( Item item, int metadata, ModelResourceLocation model) { customModels.put(Pair.of(item.delegate, metadata), model); ModelBakery.registerItemVariants(item, model); }