· 6 years ago · Jan 04, 2020, 04:22 AM
1Pams HarvestCraftToday at 10:43 PM
2Anyone have a clue why this code is registering the ItemBlock but not the Block? https://pastebin.com/RPcCmQ7p >.<
3Pastebin
4package pam.pamhc2crops.init; import java.util.HashMap; import...
5
6
7tterragToday at 10:43 PM
8random thought
9host the API key on a pastebin
10then you can edit it
11:smile:
12
13LatvianModderToday at 10:44 PM
14...
15:donk:
16
17tterragToday at 10:45 PM
18@Pams HarvestCraft nothing in that code registers an item
19
20LatvianModderToday at 10:45 PM
21@Pams HarvestCraft addGenericListener instead of addListener for your item/block registry methods
22
23tterragToday at 10:45 PM
24that too
25
26LatvianModderToday at 10:46 PM
27Also pls, that code needs to be cleaned up
28
29Pams HarvestCraftToday at 10:46 PM
30What's a generic listener
31So line 149 does not register the block?
32
33tterragToday at 10:48 PM
34it registers a block but not an item...
35
36LatvianModderToday at 10:48 PM
37Oh god wth
38
39tterragToday at 10:48 PM
40and that's assuming it's called
41are you sure it is?
42there's like 5 pointless levels of indirection here
43
44LatvianModderToday at 10:49 PM
45You have to use events for registry.. right?
46
47Pams HarvestCraftToday at 10:49 PM
48I get this error when it loads
49java.lang.NullPointerException: Initializing game
50 at net.minecraft.item.BlockItem.fillItemGroup(BlockItem.java:195) ~[forge-1.14.4-28.1.90_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
51
52tterragToday at 10:50 PM
53well, what's at that line
54NPEs are the easiest to debug
55find the line, find what's null
56make it not
57
58Pams HarvestCraftToday at 10:50 PM
59BlockItem class
60I'm not sure what the heck in my own class is a null
61
62tterragToday at 10:51 PM
63the stacktrace tells you the exact line
64
65Pams HarvestCraftToday at 10:51 PM
66I had a hard enough time getting my 1.12.2 code working in 1.14.4
67
68LatvianModderToday at 10:51 PM
69I wonder why
70
71Pams HarvestCraftToday at 10:52 PM
72If the stacktrace showed me my own code to fix, I'd fix it.
73You guys really love making fun of people don't you?
74
75tterragToday at 10:53 PM
76when did I make fun of you
77
78Pams HarvestCraftToday at 10:54 PM
79You know damn well I don't know Java very well, and I'm trying very hard. It's a well known fact in the community I've taught myself and I'm not as good as the rest of you. I'm just asking for help.
80LatvianModderToday at 10:51 PM
81I wonder why
82
83tterragToday at 10:54 PM
84that was uncalled for
85
86Pams HarvestCraftToday at 10:54 PM
87I'm just trying to update my mods for everyone else to enjoy
88And so I can bloody eat
89Jesus
90I'm sorry I'm fucking dumb
91This literally happens in every chatroom I go in. Why? Why do programmers act like this?
92=(
93
94tterragToday at 10:56 PM
95I was trying to be helpful
96but I don't want to skip to the answer. if you find the answer yourself (with help) it won't be so hard next time
97
98Pams HarvestCraftToday at 10:56 PM
99My entire stacktrace does not reference my code.
100
101tterragToday at 10:56 PM
102this isn't special treatment for you either
103
104Pams HarvestCraftToday at 10:56 PM
105Which is why I am having an issue.
106
107tterragToday at 10:57 PM
108okay, but that doesn't really matter. your code is still causing the crash, in some way. so the information in the stacktrace is still useful
109
110Pams HarvestCraftToday at 11:00 PM
111Something is coming up null, and I have no idea why. Other people having the same issue say it's because the item block is getting register but not the block.
112
113tterragToday at 11:00 PM
114that's an incomplete explanation
115I want to help you do this yourself. the stacktrace does say what line crashed, yes?
116
117Pams HarvestCraftToday at 11:01 PM
118No, it doesn't.
119
120tterragToday at 11:01 PM
121can you post it in its entirety?
122nvm
123 at net.minecraft.item.BlockItem.fillItemGroup(BlockItem.java:195)
124
125Pams HarvestCraftToday at 11:02 PM
126https://pastebin.com/wJg7fqdW
127Pastebin
128java.lang.NullPointerException: Initializing game at net.minecra...
129
130
131tterragToday at 11:02 PM
132that gives an exact line of code, BlockItem line 195
133
134Pams HarvestCraftToday at 11:04 PM
135But I do not understand why it's crashing.
136
137tterragToday at 11:04 PM
138a NPE always has the same cause
139the code tried to call something on null
140so what's the line of code there
141
142LatvianModderToday at 11:05 PM
143Im sorry if I hurt you, but I don't do nice. Your code problem is you are trying to drag old code forward when it would be much easier to rewrite from ground up only keeping models and textures. I bet it would be far less code aswell. It just feeld weird to say one of the biggest mod owners "Look at tutorial"
144
145Pams HarvestCraftToday at 11:05 PM
146It's trying to populate the creative menu with the ItemBlocks.
147
148tterragToday at 11:06 PM
149right, but let's break it down
150 this.getBlock().fillItemGroup(group, items);
151what can cause an NPE here?
152
153Pams HarvestCraftToday at 11:09 PM
154Your excuse of "I don't do nice" is inexcusable. You're a well known person and someone to look towards. While you don't have to hold people's hands and baby people, being a snide person is horrible. There is no reason to spit on me when I was down like that. I don't care if I am the largest modder out there, you see that I am asking for help, obviously I am having an issue. Why must there be this air of competition and "I'm better than you" in the modding world? Why must you rub my face in the state of my code because it's messy? You are senior, I am not. Act like it.
155It's absolutely shitty that people in the modding community keep acting like this.
156
157ShadowsToday at 11:09 PM
158you've been doing this for like
1597+ years
160
161???? ☃Today at 11:10 PM
162bruh
163
164Pams HarvestCraftToday at 11:10 PM
165Yeah, I treat other modders like shit?
166
167ShadowsToday at 11:11 PM
168you should know how to solve an npe
169
170LatvianModderToday at 11:11 PM
171Where did I even rub that in face? Initially I said to use generic event listener and you didn't even know there is an event for registering things which already should have been used in 1.12 years ago
172
173Pams HarvestCraftToday at 11:11 PM
174I have fucking mental issues. I taught my god damn self.
175I know I'm fucking behind.
176
177???? ☃Today at 11:11 PM
178people who dont go out of their way to learn the lang before getting into modding get banned off of the forge forums
179
180Pams HarvestCraftToday at 11:11 PM
181I'm lucky to even be where I am.
182LatvianModderToday at 10:46 PM
183Also pls, that code needs to be cleaned up This is pointless
184You're just flaunting
185
186LatvianModderToday at 11:12 PM
187Cleaning up code?
188:thwonk:
189
190tterragToday at 11:13 PM
191it's not
192messy code is hard to maintain
193and hard to help with
194
195Pams HarvestCraftToday at 11:13 PM
196I'm coming in with a problem. Can it wait till after I'm done?
197
198tterragToday at 11:13 PM
199your problem is, at least in part, caused by it
200
201Pams HarvestCraftToday at 11:13 PM
202Especially when two minutes later you're saying this LatvianModderToday at 10:51 PM
203I wonder why
204That is flaunting it
205
206LatvianModderToday at 11:14 PM
207Your code is a mess. You don't have to defend it. You can either yell that it isn't/its good as it is or you could at least ask "how do I clean it up"
208
209Pams HarvestCraftToday at 11:14 PM
210This happens to me over and over and over
211No matter where I go.
212People have this attitude because I am not as intelligent as them
213In coding
214
215LatvianModderToday at 11:14 PM
216Maybe the problem is not everyone else then
217
218Pams HarvestCraftToday at 11:14 PM
219It's sickening
220
221???? ☃Today at 11:14 PM
222i hope you realize this is towards EVERYONE who refuses to learn the language
223
224Pams HarvestCraftToday at 11:14 PM
225Oh, because I'm not as intelligent as you, I should be treated like shit?
226
227LatvianModderToday at 11:15 PM
228Your intelligence has nothing to do with your attitude
229
230Pams HarvestCraftToday at 11:15 PM
231I have no attitude till you start acting like an asshole.
232
233ShadowsToday at 11:16 PM
234eh
235tt did everything but spoonfeed you and you got mad at him
236so
237
238Pams HarvestCraftToday at 11:16 PM
239I did not mean to include TT in my anger at LM
240So that is definitly my fault.
241
242LatvianModderToday at 11:16 PM
243I'm not gonna argue anymore or I'll get banned of discord I moderate :donk: