Jump to content

kiou.23

Members
  • Posts

    444
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by kiou.23

  1. 6 hours ago, GhostGamesFSM said:

    I'm new to modding so I don't know how I can see that

    if you're on intelliJ, you can triple-shift iirc to open a search bar, then search for the Elytra Layer and you can see it's code.  if anything you can just google how to search for files in your IDE

    6 hours ago, GhostGamesFSM said:

    which layer renderer do you recommend me?

    wdym? you should create your own layer renderer, and override the render method.

    you "register" it by listening to the RenderPlayerEvent, and then adding a new instance of it to the player renderer

  2. Deferred Registers, well, defer the registration. so anytime before the common setup event, the object won't have been registered yet.

    what you can do is, instead of giving the enum the item instance, give them a Supplier of the Item.

    since the RegistryObject class implements Supplier, you can just pass the RegistryObject. then whenever you need the actual item, you call .get()

  3. 20 minutes ago, lupicus said:

    For #1 and #3 you can adjust position in json file (this looks about right):

    
    {
      "loader": "forge:obj",
      "model" : "dicehoard:models/dice/d_six.obj",
      "display": {
        "gui": {
          "translation": [ 10, 3, 5 ]
        },
        "ground": {
          "translation": [ 9.6, 5, 8 ]
        }
      }
    }

     

    yeah, I was just tinkering with the numbers

    I'm still gonna need to fine tune the translation for some other dispalys, but this already helps!

  4. 47 minutes ago, lupicus said:

    I should've mentioned that I only took assets and no code, sorry about that.

    For #2, you have 2 texture U coordinates above 1.0 (the last 2 defined in OBJ file). Changing them to 1.0 makes it look correct.

    Thank you!

    the uv thing is odd, I got the files exported from vectary and it rendered fine in the viewer.

  5. I'm thinking you can use capabilities. create a clas that has what you want, then attach it to the player with a default value that indicates the player hasn't picked a class yet

    next you can listen to the EntityJoinWorldEvent, check if the entity is a player and if the value is the default one, if it is send a packet to the client telling them to render this screen, then from the screen you can update the player capability

  6. 1 hour ago, lupicus said:

    Beethoven92 is correct, you need to change map_Kd line to (map_Kd dicehoard:item/white). I put your files is a test project and the texture loads. (Note: I used your png file and not the jpg in model folder)

    still won't work for me

    I updated the repo with the suggestion, can you confirm that what I tried is the same as what worked for you?


    EDIT: nervermind, it works, I'm dumb

    the reason why I thought it wasn't working was due to ItemColors returning pure black

  7. 24 minutes ago, Beethoven92 said:

    I haven't messed with OBJ models either but..don't you need to specify the texture path in the form modid:item/texture_name here: https://github.com/jvcmarcenes/dicehoard/blob/4e02044bec2bedceebf402ba875ecb9d73593da4/src/main/resources/assets/dicehoard/models/dice/d_six.mtl#L4? After relocating your texture file of course

    I'll try that

    I didn't think I'd need to since the .mtl and the texture are in the same folder

    EDIT: did not solve it

  8. 7 minutes ago, vanilla______ said:

    kiuo.23 When you use i, it won't use a variable called i, it will create a new intiger because i is what a new intiger is called, it's just a throwaway, Capital I is not i, so it won't create a new variable and will use a variable that is called I.

    that's highly incorrect, where did you learn this?

    "i" is, in this case, a variable defined in the for loop, for each time the for loop runs, "i" will get incremented by one. it is a variable like any other, there's nothing special about it

  9. 13 minutes ago, vanilla______ said:

    2 well I don't know what your saying then

    Item Stacks and Items are different things

    14 minutes ago, vanilla______ said:

    it seems like I'm doing what you said but I guess i'm not

     

    correct, you're not, you're instantiating a new Item Stack and seeing if it is the same as another one, that's not the same as checking if the item from one item stack matches the static instance of the item that you want

    15 minutes ago, vanilla______ said:

    could you go into a bit more detail thx, specifically wdym by "instances", thx.

    I shouldn't have too, instance are basic OOP, which you are expected to know

    in short: any time you use the keyword "new" to create a new variable, you are instantiating a class, therefore: an instance. what the player has in his inventory is an instance of the ItemStack class. what you want (and this is what I said), to check if the Item in the ItemStack is the Item that you're looking for

  10. 12 minutes ago, vanilla______ said:

    1 let's just ignore the first point it doesn't matter

    I'm trying to understand what's the difference between using i and I... i seems to accomplish the same thing that I does, logically

     

    edit: and ooops, accidentally send it, so I'm going to have to reply point 2 in another message

  11. 5 minutes ago, vanilla______ said:

    1 if I use i as an intiger, it create a new thing i bcs it's just what java does, if i use CAPITAL I it doesn't and I can use my custom variable

    ????

    5 minutes ago, vanilla______ said:

    2 that's what it does (I think), it gets the stack in slot I, which will increase 9 times from 0-8, and then it sees if it's equal to "obi" aka new ItemStack(Blocks.OBSIDIAN)

    that's not what I said, I explained why what you're doing won't work, and what you need to do

  12. 18 minutes ago, vanilla______ said:

    (1) i is a generic integer, capital I is not, so I made an int I because it was simple and easy to remember

    ?????

    18 minutes ago, vanilla______ said:

    (2) I know, I assume getSTACKinslot would use an itemstack, I made a new itemstack(Blocks.OBSIDIAN) and named it obi.

    then the Item Stacks would never be the same, since they're different instances, get the item from the player's inventory item stack, and then check if it matches against the instance of the item you want

  13. 36 minutes ago, vemerion said:

    I have never used an obj model before, but my guess is that you can still use the 'display' field in the item json model file to change the rotation/translation/scale of the item. Take a look at the Minecraft wiki article about it. That would solve issue 1 and 3 I think.

    okay, seems like that should solve some of the problems (although the trial and errors to get the numbers right is going to be a headache...)

    thanks!

  14. I've got an obj model rendering on an item, however I'm facing three issues:

    1- the model doesn't render correctly in the player inventory

    2- the model has a face that is missing (the model looks fine in the 3d editor)

    3- the model pivot point is weirdly placed when it is rotating on the ground

    4- the texture doesn't load and the model just renders all black

    here's a repo for the mod: https://github.com/jvcmarcenes/dicehoard

    and here are some images of the problem:

    2021-03-24_14_51_27.png.9d53275969f2d122c0ca0f765a7e62a9.png2021-03-24_14_51_26.png.4164b8e77ede936f6d936c5c030fdb0b.png

     

     

     

     

     

     

     

     

×
×
  • Create New...

Important Information

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