-
Posts
1830 -
Joined
-
Last visited
-
Days Won
12
Everything posted by DavidM
-
The HashSet class is filled with Javadoc. I would suggest getting familiar with your IDE. 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.
-
It seems like you are unfamiliar with Java. Please learn Java before making a mod (generics, inheritance, etc).
-
[SOLVED] [1.12.2] world is null when reading NBT
DavidM replied to scrouthtv's topic in Modder Support
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). -
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.
-
AnvilUpdateEvents don't fire if the middle slot is empty
DavidM replied to leod's topic in Suggestions
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. -
MY 2 mods can't lode in the 1.16.1of Forge
DavidM replied to Robertpuggle's topic in Support & Bug Reports
Please read the EAQ and post logs. I would also suggest to not use cape mod. -
Try removing all your mods. Does this still happen?
-
You might want to get familiar with Google. I can find at least 20 tutorials online with a simple Google search.
-
AnvilUpdateEvents don't fire if the middle slot is empty
DavidM replied to leod's topic in Suggestions
I’m pretty sure that the anvil is supposed to work that way (with a center item, since the anvil combines the two). If you want a crafting method that turns one item into another at the cost of experience, you should make a custom crafting block instead. -
Please post your code (the entire class). I don’t think you need anything “half” in stairs.
-
What are you trying to create?
-
[1.16.1] How create a new slab block with Eclipse?
DavidM replied to beestrug's topic in Modder Support
Try looking at vanilla examples of slabs first. -
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.
-
Please read the EAQ and post the debug.log.
-
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).
-
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).
-
Forge does not work with Window 10 Edition; it is designed for the Java Edition only.
-
Post logs.
-
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/.