Posted February 27, 20178 yr Hello. I'm trying to render an item with a 2d sprite in the inventory and a 3d json model while in hand, on ground, etc. I think this is possible through the json system but either I can't figure out the tag structure, or it's not possible with the normal json system. Google/forums searches have not given me any results. Any help would be great, thanks
February 27, 20178 yr Author No, I'm stuck. all the stuff I found, no one had the final solution All I've got so far is http://pastebin.com/GxMVKtLt
February 27, 20178 yr Author @Override public Pair<? extends IBakedModel, Matrix4f> handlePerspective( TransformType cameraTransformType) { switch(cameraTransformType) { case GUI: if(Model2d instanceof IPerspectiveAwareModel){ Pair<? extends IBakedModel, Matrix4f> result =((IPerspectiveAwareModel) Model2d).handlePerspective(cameraTransformType); return Pair.of([2dmodel],result); } return Pair.of([2dmodel],null); default: return Pair.of([3dmodel],null); } } how's this? I don't know how to get my model for those brackets then
February 27, 20178 yr Author Okay. Fixed. What do I need to do with my item and this perspective model class? I used this bit of code @SubscribeEvent public void modelBakeEvent(ModelBakeEvent event) { IBakedModel model2d = event.getModelRegistry().getObject(MasterRegistrar.model2d); IBakedModel model3d = event.getModelRegistry().getObject(MasterRegistrar.model3d); ItemModelPerspective customModel = new ItemModelPerspective(model2d,model3d); event.getModelRegistry().putObject(MasterRegistrar.model2d, customModel); } and the inventory model looks like a side projection of my 3d model, not the one with parent "item/generated", Edited February 27, 20178 yr by Cleverpanda
February 27, 20178 yr Author I did, registered it with both model variants and the names for my 2d and 3d model files, that's just the mrl. I also put the check in my handleperspective method in a similar way to the 2d one. Edited February 27, 20178 yr by Cleverpanda
February 27, 20178 yr Author http://pastebin.com/fWRxj18T Hope this is adequate, that registry file is quite big
February 28, 20178 yr Author I only used ModelBakery.registerItemVariants(item,model2d,model3d ); this time to register, no console errors, missing model model for all views
February 28, 20178 yr Author Okay, that got me to a point I could get everything working properly! Now I need to apply some transforms for each case to make it look right, what code would I use to do that? I need to do multiple transform operations EDIT: this can be done in the json now Edited February 28, 20178 yr by Cleverpanda
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.