Jump to content

Kaworru

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by Kaworru

  1. In the newer version there is no "OreDictionary" and it's replaced by tags instead.

    You can use the tags in your recipes or in your code, to cover all kind of variants from minecraft or your own mod.

    See: https://mcforge.readthedocs.io/en/1.18.x/resources/server/tags/#migration-from-oredictionary

    The mods normally extends these, by using the tags you automatically add the needed compatibility with other mods.

  2. Thanks for the feedback. But first of all it's sound simple what you want to do, but technically it's the most complicated things as mod, because you need to adjust mostly everything related to display the player and it includes a lot of sub parts.

    My suggestion would be that you forget your current code and just start with a basic task like: "Hide the head of the player".

    Just create something which disables the default player renderer (over mixin, render event, ...) and use something like "head.visibile = false" to render the player without a head.

    Try this in single player mode, third party view and in multiplayer mod with another player.

    If this works you can try the same for the other body parts and later replace the default renderer with your own.

  3. 1 hour ago, BadFox49 said:

    This is quite helpful, but again, I need to see how to apply a render in-game once the player has decided on their race. So, essentially to do the render to a specific player when they actually choose.

    If you already able to perform the above steps without any problems then the next steps would be:

    In general the Morph mod is a good example and includes everything which is needed in your case.

    Keep in mind that the PlayerRenderer is only an instance of the LivingEntityRenderer, so everything which works with mobs models extending LivingEntityRenderer will also work with the player models to some extend.

    That's the reason why I recommend to try this first with pseudo mobs, because it's easier to test / learn and includes basically the same steps.

  4. 2 hours ago, diesieben07 said:

    FML provides the IModLocator service interface that allows you to hook into the mod discovery process. However I think this is overkill for this use-case. The truth is: If a mod does not properly load on a server, that mod is broken. A client-only mod should simply do nothing on a server. Report a bug to the mod author.

    Thanks for the feedback. I fully agree that in an ideal world this should cause no issues. The reality is that most mod authors don't care and just add a comment that their mod is "client-side" only.

    I have an mod pack which has about 240 mods and about 35 of these causing issues on servers, I need to manually sort out these mods every time they get updated.

    I tried to contacted some of the mod authors, but in most cases they just pointed out it's a client side mod and don't want to fix it. 😔

  5. It's sounds like a nice project, but also like a lot of work.

    If you want to replace the player model you need to replace all animation, textures and poses as well to make sure that they are matching for 1st and 3rd view.

    Maybe instead of replacing the player model, you can use additional render layer instead, like you already mentioned with the ears ?

    My recommendation would be to try to add your player models as simple mobs to the world, to get familiar with all of these steps.

    Basically the steps are similar for player models like:

    You can also give your pseudo mobs items and armors to see if they are rendered correctly.

  6. Dear Forge Community,

    I wonder what is the best / compatible way to check the list of mods which are installed before they are actually get loaded?

    At the moment creating mod packs requires a lot of manually work, so I want to automate some of the tasks for myself.

    An basic example would be to automatically disable Opti-fine on dedicated servers before it crashes the server.

    Optifine is using the transformation service to get loaded before other mods, but not sure if this is the way.

     

    Thanks for any relevant feedback and/or references.

  7. Hi,

    this is more a theoretical question, so I have no code to show. I'm working on a new project where I need to create some animated entities.

    It looks like in the vanilla code all of the entity models (e.g. ParrotModel) are directly implemented in the .java file to get access to their different parts like head, arms, legs and so on.

    I wonder if it is possible to load the entity block model or parts over a .json file instead and access the different parts over their defined name / groups instead?

    I have no issues to convert a .json model to the corresponding .java code, but want to make it easier for others to adjust the models without touching the code.

  8. 45 minutes ago, Draco18s said:

    That said, it wouldn't be hard to write that function.
    You just have to do the following:

    X1 -> -Y2
    Y1 -> X2

    Unfortunately that's not the case. I tried to write a function for this, but the VoxelShape is based on 3D points (x, y, z).

    The problem is you need to define a 3D rotation point and need to move all other points related to this rotation point. 

    In the end it was easier for me to draw (or rotate) a box in Blockbench and just write down the needed points. 😅

  9. 4 hours ago, diesieben07 said:

    Check whether the LivingEntity you get is not null and if the ItemStack being rendered is == to LivingEntity#getMainHandItem.

    Thanks. Works like a charm. 

    Example for the record:

    ItemProperties.register(ModItems.STEEL_LIGHTER.get(),
        new ResourceLocation(Constants.MOD_ID, "open"),
        (itemStack, clientLevel, livingEntity, id) -> {
          return (livingEntity == null || !itemStack.is(ModItems.STEEL_LIGHTER.get())
              || livingEntity.getMainHandItem().isEmpty()
              || itemStack != livingEntity.getMainHandItem()) ? 0.0F : 1.0F;
        });

     

  10. Hi,

    I created a simple steel lighter item, which has a item property "open" with "1.0" or "0.0" to display two different models, see:

    https://github.com/MarkusBordihn/BOs-Steel-Armor-Tools-Weapons/blob/main/src/main/resources/assets/steel_armor_tools_weapons/models/item/steel_lighter.json

    This works fine, but I want to change the state in the case the steel lighter is currently selected in the hotbar or not.

    I tried the LivingEquipmentChangeEvent which offers exactly the needed functionality, see:

    https://github.com/MarkusBordihn/BOs-Steel-Armor-Tools-Weapons/blob/main/src/main/java/de/markusbordihn/steelarmortoolsweapons/client/equipment/EquipmentChange.java

    But it seems that the ItemStack from this event is different from the ItemStack which is used for the ItemProperties.register(...), even both should be client side only.

    What I tried so far:

    • Using itemStack.getOrCreateTag().putBoolean(...) and itemStack.getOrCreateTag().getBoolean(...)
    • Using a hashmap with <itemStack, boolean>
    • Using a local variable (current version)

    A debug of the hashmap with <itemStack, boolean> shows that the itemStack within the ItemProperties.register(...) is different from the itemStack in LivingEquipmentChangeEvent.

    So I wonder if there is a alternative event / approach I could use in this case or any other client only item state which I could share between these two events.

  11. 14 hours ago, Luis_ST said:

    Unfortunately it looks like, that's only possible with mixin/core modding (which is not supported on this forum)

    Yeah this is exactly the thing I want to avoid. I got so many false positive error reports with other mods which using mixin/core modifications.

    But no worries, I got a working version and learned more about the render events.  

  12. Quote

    I will look at this, and try to find a solution for your problem 

    Thanks for the feedback. But it seems there is not really an easy way for this, most of the code is hard-coded and could not be accessed directly. 😞

    I worked around this by using the "RenderHandEvent" and "RenderPlayerEvent" to create a dedicated render for my crossbow item.

  13. Sorry, but this is not correct. If you search for "Items.CROSSBOW" in the vanilla source code you will see some references in the ItemInHandRenderer.java and PlayerRenderer.java for the animation for e.g. which hand should be visible at which state.

    The models works fine in the 3rd person view and the inventory slot, but not in the first person view which use the custom render mentioned above.

  14. Hi,

    I'm not new to forge modding, but new to client render with 1.17 and working on a mod which adds steel tools and weapons.

    Currently I'm stuck with the crossbow item by using the default CrossbowItem with a different registration name and texture for a steel version, see:

    https://github.com/MarkusBordihn/BOs-Steel-Armor-Tools-Weapons/blob/main/src/main/java/de/markusbordihn/steelarmortoolsweapons/item/ModItems.java#L56

     

    My currently problem is that it seems that the ItemInHandRender and PlayerRender has a hard reference to Items.CROSSBOW, which mean that the render is not working for my steel crossbow version.

    Normally I would somehow register a listener for the render event and replace it with a custom one as soon I detect my item in the hand.

    But have not really an idea how to do this correct with the version 1.17.1.

    I took a look at the original code but was not able to see how these render a register or how I could intercept the existing ones.

    Would be thankful for any pointers in the right direction (e.g. registration / listener methods) or maybe a basic example how this works in general.

    Thanks a lot.

×
×
  • Create New...

Important Information

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