Jump to content

DavidM

Members
  • Posts

    1830
  • Joined

  • Last visited

  • Days Won

    12

Posts posted by DavidM

  1. 12 hours ago, VaalAlves said:

    If there was a javadoc, i wouldn't even be making a thread in the first place.

    The HashSet class is filled with Javadoc. I would suggest getting familiar with your IDE.

     

    9 hours ago, VaalAlves said:

    Thanks for pointing it out, made me realize all i had to do was create a variable before creating the tool instead of creating a variable on the spot.

    If you are referring to passing the set into the constructor, then you can pass in a set directly (instead of creating a field). However this depends on if you are going to reuse it.

  2. You are not supposed to access the World in readFromNBT. The world is can be uninitialized at that time.

    Like the name suggests, you should only read data from NBT during that time.

    If you want to get another tile entity during initialization, you can make it a lazy value and initialize (when first used/first tick in world depending on how you want to use it) based on the BlockPos (which is read from NBT).

    • Like 1
  3. 17 hours ago, T-Dark_ said:

    You mean like

    
            BlockState blockState1 = Blocks.OBSIDIAN.getDefaultState();
            BlockState blockState2 = Blocks.OBSIDIAN.getDefaultState(); 

    and then the two calls to renderBlock are identical except one gets blockState1 and the other gets blockState2?

    Isn't that the same blockstate anyway?

    (Even if it isn't, tried that, doesn't work. The problem remains)

    Ah my bad, I was thinking about mutable block states from Spigot.

  4. I would recommend looking at sources of other mods.

    I used to learn modding via looking at Botania, which provides a pretty good example of various systems (particles, recipes, etc).

     

    I personally find examples of Forge API not as necessary as code examples in other API/framework, as the vanilla code serves as a pretty good example itself. However, if you prefer examples, TGG has a tutorial consisting of examples: here.

  5. On 7/5/2020 at 10:21 PM, leod said:

    I don't think I should have to create a custom crafting block when the anvil fulfills exactly what I need

    It doesn't fulfill your need, since it doesn't update when the middle item changes.

     

    I would say that since anvil is almost never used without a middle item (renaming is its own case), it would bring extra fuss (unnecessary event subscriber calls) to fire the event subscriber when the middle item changes. It can be made to do stuff without a center item, but it shouldn't design-wise IMO.

    However you could propose a PR and see what others think.

  6. 1 hour ago, JWooderson said:

    but i do not know how to launch the forge server with more allocated ram and there is no damn tutorials online

    You might want to get familiar with Google. I can find at least 20 tutorials online with a simple Google search.

  7. 15 minutes ago, clubmax27 said:

    throws IOException

    That method never cause this exception. There is no point in adding it here.

    Even if some of your code might cause this, you should handle it inside the method properly (you are making a mod, not an API).

     

    LivingDamageEvent is a Forge event. You are putting it in the Mod event subscriber.

  8. 1 hour ago, xanderindalzone said:

    PD: I didn't have time to properly upload the project to the repo, but all the java classes are there.

    You need to post a proper Gradle repo, as otherwise other people cannot debug it.

     

    As for your mod, I would suggest starting off with a simple mod that adds a few items/blocks first before tackling a gun mod. It seems that what you are trying to do is beyond your knowledge of modding, and therefore is hard for you to do everything at once. A less steep learning curve would suit you better (start with adding items, then adding functionalities to them, then learn about sides and networking, then entities, etc).

  9. I would say that in terms of actual rendering, you just need to be familiar with OpenGL. The non-generic part of rendering are mostly changes in the particle system and rendering system, which is not that huge of a deal to adapt to when Forge updates (might takes a few days to learn, but you will get there).

     

    Other than that, just check out the vanilla rendering examples (including usage of buffer builder, tessellator, etc) as well as the documentations on the model system. These change a lot between Forge versions.

     

    As for LTS, modders took a vote on that and 1.14 is preferred by most people.

    Modern versions of Minecraft is actually more stable and have better performance (compare the code with, say, 1.7.10). A lot of popular mods in 1.7.10 and 1.12.2 are rather... terribly written in terms of code (check their sources; most of them are open sourced). There isn’t any reason to not move on to newer versions apart from the large player base (which eventually moves on to newer versions anyways).

    • Like 1
  10. I'll triple that; the rendering has changed drastically in recent versions of Forge. It might be easier for you to rewrite the mod from scratch rather than updating it, which would require proper programming in Java (there is no "quick tools/ways" for updating mod, and videos on YouTube who claim they can "quickly" update any mod from any version is nonsense). There will be a lot of learning before you can successfully port the mod.

     

    This is no discouragement though; we encourage you to learn modding and programming, and use your knowledge to port the mod.

    After you are done with learning the basics, I would suggest checking out the model system of Forge: https://mcforge.readthedocs.io/en/1.15.x/models/introduction/.

     

×
×
  • Create New...

Important Information

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