Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SubscribeEvent
- public void onModelBakeEvent(ModelBakeEvent event){
- try {
- TextureAtlasSprite atlas = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(fancyItemLocation.toString());
- IModel model = OBJLoader.instance.loadModel(fancyItemLocation);
- TRSRTransformation transformation = new TRSRTransformation(
- new Vector3f(0, -1, 0),
- new Quat4f(0, 0, 0, 0),
- new Vector3f(1, 1, 1),
- new Quat4f(0, 0, 0, 0));
- event.modelRegistry.putObject(fancyItemLocation,
- model.bake(
- new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true, transformation),
- new VertexFormat(),
- loc -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(fancyItemLocation.toString())
- )
- );
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement