Jump to content

Recommended Posts

Posted

Ok, so I am working on a mod which requires composite models (item models made from a set of sub-models joined together).

 

Now, I am on track for getting a basic composite model which would fit my minimum requirements, but as I do not know enough at the moment about how models (and mostly quads) work, I am asking about some information regarding the power of models.

 

Composite Models MUST have the following:

*MUST be able to be formed from two or more models, the number and type of which are determiend by an input ItemStack. (This I believe I can do.)

 

Composite Models SHOULD have the following:

*SHOULD be able to define arbitrary rotations relative to "base" rotation, which is determined by the model determined by the input ItemStack.

*SHOULD be able to define arbitrary translations relative to "base" translation, which is determined by the model determined by the input ItemStack. (This I believe I can do.)

 

Composite Models MAY have the following:

*MAY be able to define arbitrary scales relative to "base" scale, which is determined by the model determined by the input ItemStack.  (This I believe I can do.)

*MAY be able to define arbitrary rotations, translations and offsets relative to model relative rotation, translation and offset, which is determined by code determined by the input ItemStack.

*MAY be able to specify a simple hierarchy within models, which is used to allow models to share with their parents relative rotation, translation and scale.

 

For example, I might want to have a magical stone. The stone is made of three models, a core, a glyph and a ring. The core is the base model (determines the rotation, translation and scale relative to the hand), the glyph shares its rotation and translation with the core but has twice the scale (causing it to stick out) and the ring has the same translation and scale as the core but is rotated 90° to the core.

 

The stone also gently floats above the players hand following a sine wave (giving it a floating effect), the core and glyph additionally slowly rotate clockwise at the same rate, and the ring rotates counter-clockwise at a faster rate (giving it a spinning effect). When right clicked the entire model would increase in scale, then decrease again, following a simple curve.

 

So, before I waste time trying something which is impossible, which of those requirements are possible and which aren't?

Posted

Okay, so I believe that I have gotten the basic system set up. Just a few questions:

 

1: How can I have a texture stitched into the texture atlas without an associated item or block to go with it (or does it automatically do this with everything in textures/items?)

 

2: How can I load a model without an associated item or block (for components to be used in composite models) (again, does it automatically do this with everything in the models folder?)

 

3: How can I load non-standard data from a model file (for use in composite models, things like relative translation and scales)?

 

Edit: For (2), I basically want to turn a ModelResourceLocation into an IBakedModel. My attempts are failing... :'(

Posted

Ok, so I think I have gotten the basics down. I just need some help with getting models from ModelResourceLocations, or preferably a String. I may also need help with getting custom data from a model's json.

Posted

Okay, this is really annoying me. Currently I have managed to do it, but it seems really inefficient.

 

ModelLoaderRegistry.getModel(new ResourceLocation(model_location)).bake(new SimpleModelState(ImmutableMap.<IModelPart, TRSRTransformation>of()), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter());

 

I have gotten it to work for models which belong to pre-existing items with this, but when I try to load a model which does not belong to an actual item it returns the default model (the pink/black cube thing)

 

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getModel(model_location);

 

What am I missing? There must be a method that I have simply overlooked...

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello , when I try to launch the forge installer it just crash with a message for 0,5 secondes. I'm using java 17 to launch it. Here's the link of the error :https://cdn.corenexis.com/view/?img=d/ma24/qs7u4U.jpg  
    • You will find the crash-report or log in your minecraft directory (crash-report or logs folder)
    • Use a modpack which is using these 2 mods as working base:   https://www.curseforge.com/minecraft/modpacks/life-in-the-village-3
    • inicie un mundo donde instale Croptopia y Farmer's Delight, entonces instale el addon Croptopia Delight pero no funciona. es la version 1.18.2
    • Hello all. I'm currently grappling with the updateShape method in a custom class extending Block.  My code currently looks like this: The conditionals in CheckState are there to switch blockstate properties, which is working fine, as it functions correctly every time in getStateForPlacement.  The problem I'm running into is that when I update a state, the blocks seem to call CheckState with the position of the block which was changed updated last.  If I build a wall I can see the same change propagate across. My question thus is this: is updateShape sending its return to the neighbouring block?  Is each block not independently executing the updateShape method, thus inserting its own current position?  The first statement appears to be true, and the second false (each block is not independently executing the method). I have tried to fix this by saving the block's own position to a variable myPos at inception, and then feeding this in as CheckState(myPos) but this causes a worse outcome, where all blocks take the update of the first modified block, rather than just their neighbour.  This raises more questions than it answers, obviously: how is a different instance's variable propagating here?  I also tried changing it so that CheckState did not take a BlockPos, but had myPos built into the body - same problem. I have previously looked at neighbourUpdate and onNeighbourUpdate, but could not find a way to get this to work at all.  One post on here about updatePostPlacement and other methods has proven itself long superceded.  All other sources on the net seem to be out of date. Many thanks in advance for any help you might offer me, it's been several days now of trying to get this work and several weeks of generally trying to get round this roadblock.  - Sandermall
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.