Leaderboard
Popular Content
Showing content with the highest reputation on 10/21/20 in Posts
-
2 pointsAlright, occasionally I get bored and I do one of these posts. I looked at their latest (as of the time of this post) video: https://youtu.be/F79DNgi5d_o. Here is what I found: [0:40] "Call this calls ModSpawnEggItem" - completely irrelevant how you call this class. [1:00] "Click here, to add constructor matching super" - why? How is this relevant to modding? This is basic Java knowledge. Either you explain what you do here (which means you need to explain what constructors are and what inheritance is) or you assume this knowledge, which means you don't need to talk about this at all. [1:08] "I think it could be public, but we'll just make it protected" - He doesn't even know how Java visibility modifiers work himself. Great teacher for modding a game written in Java! (Side note here, this is just personal preference but god damn it TechnoVision, USE ALT-ENTER! Using the mouse is sooooo sloooooow). [1:49] Why using a Lazy? Instead of a Supplier? You get a Supplier out of the DeferredRegister anyways, no need to convert it to a Lazy. [1:55] He keeps calling "?" in a generic type "a generic". This is not the correct name. This is called a wildcard. [3:24] Him calling that super constructor with null as the type will result in a null key in SpawnEggItem#EGGS. That should be cleaned up. His explanation as to why it "doesn't matter" (it does...) is also not an explanation. He just mumbles a view techno-babble-esque words. [6:23] "This field is in SpawnEggItem and it's this map here" *highlights a local variable in a completely different class*. Yeah right. [7:05] Then he proceeds to type in and explain copy pasta code from vanilla as if it was his own creation. What the hell? [8:19] That is a terrible explanation of casting. [12:23] "We want this to be clear, every single time." In a method that is called once. Why? This is not an explanation. [13:11] "This is like a utility class". No. Not it is not. [13:56] Utterly broken. Why is this in a client-only event subscriber? This will make the mod not work on servers. [14:11] "Right when the entities have been registered" - No. That is not what this event does. This event fires when you should register your entities, not when they have already been registered. This event is also the wrong choice for most of what is done in the initSpawnEggs method. [17:05] Should be using data generators. [18:14] Again, should be using data generators. [18:30] "File > Save all" LOL this is not eclipse. On an overall note: This code is 1:1 the same crap that TurtyWurty showed in his video from a couple of days earlier. Oh but don't be fooled, he did not come up with it either. He copied it from Cadiboo, who I vaguely remember still spending the time (with me partly helping him if I remember correctly) to figure this crap out on the Forge discord and this forum. So. Question answered? That is the problem with TechnoVision, TurtyWurty, HarryTalks and all those "Modding tutorial" people on youtube (McJty specifically excluded!). They are unoriginal, unhelpful, promote bad coding practices and even outright broken code.
-
1 pointI love the irony here where you piped up solely to rip into me and not at all to help. Take your own advice why don't you?
-
1 pointFirst of all, ifPresent is just not the right choice here, as you can see by the ugly 1-element-array-hack you have to do. You most likely want orElseThrow. The error you see here is not caused by the GUI code at all. It is called by you sending a custom payload packet without registering the channel properly.
-
1 pointYou are adding potions to the empty ItemStack (or trying to, rather). You need to create a new ItemStack of Items.POTION.
-
1 pointMaybe it is not the best idea but what I do is apply 1 tick duration effect to the wearer if the wearer does not have the effect(isPotionActive) and has full equipped your armour set. By this you don't have to worry about the effect gets removed externally(milk, commands...), and the effect will disappear right after you take of your armour set. It also avoids you to remove the effect if the effect is applied externally via commands, potions...etc. Just my thoughts, may not be the best.
-
1 pointWhoops, I did not think about that when I wrote my response :P. If I remember correctly, you can get the equipment that was previously equipped from the event as well. Try checking that the previously equipped item was your custom armor, and the newly equipped armor is not, and only then remove the effect.
-
1 pointAnd those "pretty docs" are what attract people to make content for Forge in the first place. I can't write anything to the github pages myself because obviously I'm not sure what to put down. I like to think I know how to write technical documents, but I also need to know what the hell I'm talking about. I (or someone) need to sit down with at least one dev and go through at least some basics with them. Like, for example, what does Forge always expect a mod to have? What file structure does Forge expect? What are some examples of very simple mods, and how would they all work under the hood basically? Although, of course, you should be able to understand what a function does by looking at it, it doesn't answer other more pressing questions about the Forge API as a whole. Hell, if I just had a week with a dev where we just devoted a few hours to hammering out the documentation, then I'm sure we could make a huge dent, if not entirely complete it. I absolutely get that Forge is a big project and it needs a lot of time, but if these documentation needs aren't met, then many people are just gonna get frustrated and go work on something else. And you don't want that. You obviously want more people to use your API. I also get that documentation isn't exactly a glamorous job. It's a very underappreciated part of making an API. But I think it will absolutely pay off in the end. It would address a lot of threads that are constantly getting made in the Modding Support sub-forum asking things that good documentation could easily answer. It saves your users time and it saves you time as well. Everyone's happy.
-
1 point