
mortinious
Members-
Posts
24 -
Joined
-
Last visited
Everything posted by mortinious
-
Looks like you have DNS problems amlost. Make sure cmd runs as administrator. EDIT: it doesn't look like a DNS problem. i'm just tired. Still make sure cmd runs as admin-
-
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
So now my model works as intended. I hard coded the transformations since i found no way of getting the to be read correctly from the base model. If any one knows a way, please tell. For others with the same problem, here's the code i used for the transformation of a handheld item (sword/axe/shovel). @Override public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType type) { Matrix4f m = new Matrix4f(); m.setIdentity(); TRSRTransformation trsrt = new TRSRTransformation(m); switch(type){ case FIRST_PERSON_RIGHT_HAND: trsrt = new TRSRTransformation(new Vector3f( 0.1f, 0.2f, 0.05f ), new Quat4f(-0.15304594f, -0.6903456f, 0.15304594f, 0.6903456f), new Vector3f(0.68f, 0.68f, 0.68f), new Quat4f(0.0f, 0.0f, 0.0f, 1.0f)); break; case FIRST_PERSON_LEFT_HAND: trsrt = new TRSRTransformation(new Vector3f( 0.1f, 0.2f, 0.05f ), new Quat4f(0.15304594f, -0.6903456f, 0.15304594f, -0.6903456f), new Vector3f(0.68f, 0.68f, 0.68f), new Quat4f(0.0f, 0.0f, 0.0f, 1.0f)); break; case THIRD_PERSON_RIGHT_HAND: trsrt = new TRSRTransformation(new Vector3f( 0.0f, 0.25f, 0.03f ), new Quat4f(-0.3265056f, -0.6272113f, 0.32650554f, 0.62721133f), new Vector3f(0.85f, 0.85f, 0.85f), new Quat4f(0.0f, 0.0f, 0.0f, 1.0f)); break; case THIRD_PERSON_LEFT_HAND: trsrt = new TRSRTransformation(new Vector3f( 0.0f, 0.25f, 0.03f ), new Quat4f(-0.3265056f, 0.6272113f, -0.32650554f, 0.62721133f), new Vector3f(0.85f, 0.85f, 0.85f), new Quat4f(0.0f, 0.0f, 0.0f, 1.0f)); break; case GROUND: trsrt = new TRSRTransformation(new Vector3f( 0.0f, 0.0f, 0.0f ), new Quat4f(0.0f, 0.0f, 0.0f, 1.0f), new Vector3f(0.5f, 0.5f, 0.5f), new Quat4f(0.0f, 0.0f, 0.0f, 1.0f)); break; default: break; } return Pair.of(this,trsrt.getMatrix()); } -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
ok, thanks -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
So i need to hard code the transformation into the model? -
[ABANDONED] [1.9] Alternative to ItemCameraTransforms.
mortinious replied to mortinious's topic in Modder Support
I try to apply tranform to my custom item model but getItemCameraTransforms only returns DEFAULT (the way items are rendered in the inventory, from the front in 1:1 scale) -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
So how am i supposed to pass the to the new model? -
[ABANDONED] [1.9] Alternative to ItemCameraTransforms.
mortinious replied to mortinious's topic in Modder Support
How do i utilize TRSRTransformation in a IBakedModel model? it has no overrideable functions to either getting or using TRSRTrans. -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
Thanks for the answer, now my problem is that i cant find where to get the transforms from the original models. The earliest i get them they are already baked by Forge (into ItemLayerModel$BakedItemModel) and their transforms are private. getItemCameraTransforms() are as i said decrepated and returns DEFUALT. -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
My needs is as follows: I have a base model of a sword. I also have an array of smaller models that are going on top of the sword model depending on a few NBT tags. All models work as intended except their transformations I get the merging to work but i cant get the transformation to be transferred from the json file to the final model. (the super classes only returns ItemCameraTransformation.DEFAULT) If i disable the custom model so i just get the base sword model it is transformed as it should based on the json file. I might be totally off couse since i based it on a tutorial for 1.8.9 but there is no documentation for 1.9 yet so i didnt have a choice -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
How do i apply the tranformation, or more specifically how do i read the transformations from the JSON files? Edit: Seems lite MultiModel is Deprecated too... -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
UPDATE: The model merging now works as it should, still the issue of it being rendered wierdly persists. I saw a post recently with someone having the same problem but i already had my item set to parent=item/handheld and without the custom model the item renders correctly (like a vanilla sword). I also updated the previous post with current code -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
UPDATED! I post what i think is needed, if you need more code just tell me, didnt wanna overdo it. Some code is not used and are there to future proof. SocketSwordItemModel aka my custom model public class SocketSwordItemModel implements IBakedModel{ public static final ModelResourceLocation modelResourceLocation = new ModelResourceLocation("mortiniousmods:socket_iron_sword", "inventory"); public static final ArrayList<ModelResourceLocation> socketModelResourceLocations = new ArrayList<ModelResourceLocation>(){{ add(new ModelResourceLocation("mortiniousmods:socket_vile", "inventory")); add(new ModelResourceLocation("mortiniousmods:socket_spectral", "inventory")); }}; public int socket; public ArrayList<IBakedModel> socketModels; public IBakedModel model; public SocketSwordItemModel(IBakedModel existingModel, ArrayList<IBakedModel> socketModels){ model = existingModel; this.socketModels = socketModels; } public SocketSwordItemModel getBakedModel(SocketSwordItemModel base, IBakedModel socket){ return base; } @Override public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) { ArrayList<BakedQuad> swordQuads = new ArrayList(model.getQuads(state, null, rand)); if(socket != -1){ ArrayList<BakedQuad> socketQuads = new ArrayList(socketModels.get(socket).getQuads(state, null, rand)); ArrayList<BakedQuad> newQuads = new ArrayList<BakedQuad>(); newQuads.addAll(swordQuads); newQuads.addAll(socketQuads); //swordQuads.addAll(socketQuads); return newQuads.subList(0, newQuads.size()); } return swordQuads.subList(0, swordQuads.size()); } @Override public boolean isAmbientOcclusion() { // TODO Auto-generated method stub return model.isAmbientOcclusion(); } @Override public boolean isGui3d() { // TODO Auto-generated method stub return model.isGui3d(); } @Override public boolean isBuiltInRenderer() { // TODO Auto-generated method stub return false; } @Override public TextureAtlasSprite getParticleTexture() { // TODO Auto-generated method stub return model.getParticleTexture(); } @Override public ItemCameraTransforms getItemCameraTransforms() { // TODO Auto-generated method stub return ItemCameraTransforms.DEFAULT; } @Override public ItemOverrideList getOverrides() { // TODO Auto-generated method stub return CustomOverrideList.INSTANCE; } ModelBakeEventHandler public class ModelBakeEventHandler { public static final ModelBakeEventHandler instance = new ModelBakeEventHandler(); private ModelBakeEventHandler(){}; // Called after all the other baked models have been added to the modelRegistry // Allows us to manipulate the modelRegistry before BlockModelShapes caches them. @SubscribeEvent public void onModelBakeEvent(ModelBakeEvent event) { // Find the existing mapping for ChessboardSmartItemModel - we added it in StartupClientOnly.initClientOnly(), which // caused it to be loaded from resources (model/items/mbe15_item_chessboard.json) just like an ordinary item // Replace the mapping with our ISmartBlockModel, using the existing mapped model as the base for the smart model. Object object = event.getModelRegistry().getObject(SocketSwordItemModel.modelResourceLocation); ArrayList<IBakedModel> socketModels = new ArrayList<IBakedModel>(); for(int i = 0; i < SocketSwordItemModel.socketModelResourceLocations.size(); i++){ socketModels.add((IBakedModel)event.getModelRegistry().getObject(SocketSwordItemModel.socketModelResourceLocations.get(i))); } if (object instanceof IBakedModel) { IBakedModel existingModel = (IBakedModel)object; SocketSwordItemModel customModel = new SocketSwordItemModel(existingModel,socketModels); event.getModelRegistry().putObject(SocketSwordItemModel.modelResourceLocation, customModel); Object object2 = event.getModelRegistry().getObject(SocketSwordItemModel.modelResourceLocation); object2.hashCode(); } } } CustomOverrideList public final class CustomOverrideList extends ItemOverrideList { public static final CustomOverrideList INSTANCE = new CustomOverrideList(); private CustomOverrideList() { super(ImmutableList.<ItemOverride>of()); } @Override public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) { if(stack.hasTagCompound()){ ((SocketSwordItemModel)originalModel).socket = stack.getTagCompound().getInteger("socket"); } return originalModel; } } ClientProxy public class ClientProxy extends CommonProxy { @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); } @Override public void init(FMLInitializationEvent e) { super.init(e); ItemRenderRegister.registerItemRenderer(); BlockRenderRegister.registerBlockRenderer(); ItemRenderRegister.init(); MinecraftForge.EVENT_BUS.register(ModelBakeEventHandler.instance); } @Override public void postInit(FMLPostInitializationEvent e) { super.postInit(e); } } ItemRenderRegister public final class ItemRenderRegister { public static String modid = ModMain.MODID; public static void init(){ ModelLoader.setCustomModelResourceLocation(ModItems.socket_crystal, 0, new ModelResourceLocation("mortiniousmods:vile_crystal","inventory")); ModelLoader.setCustomModelResourceLocation(ModItems.socket_crystal, 1, new ModelResourceLocation("mortiniousmods:spectral_crystal","inventory")); ModelLoader.setCustomModelResourceLocation(ModItems.socket_iron_sword, 0, new ModelResourceLocation("mortiniousmods:socket_iron_sword", "inventory")); ModelLoader.setCustomModelResourceLocation(ModItems.socket_iron_sword, 1, new ModelResourceLocation("mortiniousmods:socket_vile", "inventory")); ModelLoader.setCustomModelResourceLocation(ModItems.socket_iron_sword, 2, new ModelResourceLocation("mortiniousmods:socket_spectral", "inventory")); } public static void registerItemRenderer() { reg(ModItems.socket_crystal, 0, "vile_crystal"); reg(ModItems.socket_crystal, 1, "spectral_crystal"); reg(ModItems.socket_iron_sword, 0, "socket_iron_sword"); reg(ModItems.socket_iron_sword, 1, "socket_vile"); reg(ModItems.socket_iron_sword, 2, "socket_spectral"); //reg(ModItems.socket_iron_sword); } public static void reg(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher() .register(item, 0, new ModelResourceLocation(modid + ":" + item.getUnlocalizedName().substring(5), "inventory")); } public static void reg(Item item, int meta, String file) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher() .register(item, meta, new ModelResourceLocation(modid + ":" + file, "inventory")); } } -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
Oh, sorry i was a bit vague. I get my CustomModel to work with all the stuff you said. The thing is that now all the display settings from the json file is discarded and the sword (which is what the custom model is rendering) is rendered very wierd: image The json file is basicly a copy of the vanilla sword one and is i disable the custom model and everything surrounding it and render the item normally it works perfectly. I am able to modify how the item is rendered by implementing IPerspectiveAwareModel instead of IBakedModel but i have some troubles to make it look right. Therefor i ask if you have to manuallt render custom models or if im just doing something wrong. -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
For clarity, do you have to program the perspective yourself if you make a CustomModel instead of just letting the json file do it for you? -
UPDATE: problem sovled at this post: http://www.minecraftforge.net/forum/index.php/topic,37568.0.html I realized that all the tutorials and guides from 1.8 refers to ItemCameraTransforms so control item transforms but now that it it deprecated what shoudl i use now? I have done a few searches but found nothing on the topic.
-
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
Thanks for the confirmation, then it means ive done something wrong elsewhere. -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
Thanks for the answer, ofc i know i have to change the return but to what? The getOverrides() returns a ItemOverrideList which in turns needs a List<ItemOverrides> in its constructor. I looked at the constructor of ItemOverride and i dont understand what the variables are since they are not yet deobfuscated. What are the parameters in ItemOverride so i can create my own? Do i need to create a CustomOverrideHandler aswell as CustomOverrideList to handle the states? After a bit more research i found out that getOverride() is never ran by minecraft? It only runs from RenderItem and the specific function is never ran. Now i've traced the problem further, I get to the function getItemModelWithOverrides() in RenderITem with the CustomModel intact, there the fuction translates it into a standard SimpleBakedModel instead so all my custom settings in my CustomModels getOverrides() is removed. What am i doing wrong here? I think i've gotten it to work somewhat decently but now camera transforms from the JSON file doesnt work at all and the item is held like a normal item despite having the same JSON file as before. If i disable the custom model it goes back to normal. Also getItemCameraTransforms() in IBakedModel is marked as @Deprecated so how do i get the json-transforms now? -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
Ok, i said i wouldnt ask any more questions so answer if you like, if not i guess i have to wait for some decent documentation gets released on the issue. So now my custom model file implements IBakedModel and the getOverrides fuction automatically got added. From what i've read ItemOverrides are new to 1.9, how do i create/use them? The getOverrides() returns null and have no arguments, so what is the reason of having it if you have to create the ItemOverrides locally anyway? -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
From what i see it only, according to TheGreyGhost's tutorial, is that the event handler only translates a IBakedModel into a ISmartItemModel. -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
Thanks for the help, i think i'm on the right course, hopefully... One last question, do you still need to create a custom BakeEventHandler? -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
Should i extend the model to ItemOverrideList or do i even need a custom Model file anymore? This is the main problem i have, since i havent worked with ISmartItemModel i dont really know how to translate the guides and there is currently no good documentation on how to translate it either. -
[KINDA SOLVED] [1.9] Using IBakedModel instead of ISmartItemModel
mortinious replied to mortinious's topic in Modder Support
Thanks for the quick reply. I was following this tutorial from 1.8 https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe15_item_smartitemmodel There you have the ChessboardSmartItemModel.java that extends ISmartItenModel, do i just extend this to IBakedModel instead? -
Hi. I'm a returning oldschool modder (modded alot around 2011-2012) and are trying to make a return but a lot of stuff has changed. What I'm trying to do is to have an items texture based on 2 images depending on what NBT tags are set e.g "material"=1 and "socket"=2 generate a specific combination of 2 textures baked together. The thing is I've been searching for a guide or tutorial on how the baked models work but i only find guides/tutorials on ISmartItemModel which is removed from 1.9. Can someone give me a brief explanation or link to a guide the explains how to use the baked item models in 1.9? If this already exists on the forum you have to excuse me as I've been searching and googling for hours without finding anything that gave me any enlightenment on the issue.