Created
March 4, 2016 22:55
-
-
Save sirsavary/9aab1ed04ff31fc6f274 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IRetexturableModel itemModel = (IRetexturableModel) ModelLoaderRegistry.getModel(new ResourceLocation("minecraft:builtin/generated")); | |
| String itemName = "copper_axe"; | |
| IModel retexture = itemModel.retexture(ImmutableMap.of("layer0", ASSETS + "items/" + itemName)); | |
| TextureMap textures = Minecraft.getMinecraft().getTextureMapBlocks(); | |
| IFlexibleBakedModel bakedModel = retexture.bake(retexture.getDefaultState(), Attributes.DEFAULT_BAKED_FORMAT, (location) -> textures.getAtlasSprite(location.toString())); | |
| event.modelRegistry.putObject(new ModelResourceLocation(MODID + ":" + itemName + "#normal"), bakedModel); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment