Help on an old Notch game (Herp Fortress)

Hello! Around a decade ago, Markus Persson (Notch), the creator of Minecraft, began working on a demake of Team Fortress 2 called Herp Fortress. He developed it as a personal Java project and even live-streamed the process on his Twitch account. The streams were later archived. After a few months, Notch canceled the project but shared the source code on Twitter. I run a YouTube channel and was interested in potentially making a video on the game, so I decided to download the source code with hopes of compiling or running it. However, I’m not familiar with Java (my experience is in C#), so this is all quite new to me. The first thing I did was follow YouTube tutorials on how Eclipse works (the IDE used for development). After setting it up, I tried running Herp Fortress, but it only opened a blank window. I even tried compiling it into a .jar file, but got the same result. The console output showed the following message:
<terminated> HerpFortress [Java Application] C:\Program Files\Java\jre1.8.0_431\bin\javaw.exe (Dec 14, 2024, 12:52:44 PM) Exception in thread "Game Thread" java.lang.IllegalArgumentException: input == null at javax.imageio.ImageIO.read(Unknown Source) at com.mojang.herpfortress.Art.loadAndCut (Art.java:26) at com.mojang.herpfortress.Art.<init>(Art.java:14) at com.mojang.herpfortress.Art.init(Art.java:11) at com.mojang.herpfortress.HerpFortress.init (HerpFortress.java:46) at com.mojang.herpfortress.HerpFortress.run(HerpFortress.java:59) at java.lang.Thread.run (Unknown Source)
<terminated> HerpFortress [Java Application] C:\Program Files\Java\jre1.8.0_431\bin\javaw.exe (Dec 14, 2024, 12:52:44 PM) Exception in thread "Game Thread" java.lang.IllegalArgumentException: input == null at javax.imageio.ImageIO.read(Unknown Source) at com.mojang.herpfortress.Art.loadAndCut (Art.java:26) at com.mojang.herpfortress.Art.<init>(Art.java:14) at com.mojang.herpfortress.Art.init(Art.java:11) at com.mojang.herpfortress.HerpFortress.init (HerpFortress.java:46) at com.mojang.herpfortress.HerpFortress.run(HerpFortress.java:59) at java.lang.Thread.run (Unknown Source)
From what I gather, it seems to be an issue related to loading an image file, but I’m unsure how to resolve it. I’d appreciate any guidance or tips from anyone experienced with Java or who has worked with this source code (if there are any). Any help would be greatly appreciated!
Hike's Archive
YouTube
Notch Coding Herp Fortress [PART 1/5]
Originally streamed on February 24th 2012 on twitch.tv/notch
notch (@notch) on X
Since I totally failed to do any 0x10c stuff today, here's the entire source code for Herp Fortress: http://t.co/ok7HqcqT
Twitter
No description
No description
No description
20 Replies
JavaBot
JavaBot2w ago
This post has been reserved for your question.
Hey @Realest Billy! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st2w ago
the error seems to be originating from loading a nonexistent image in linr 26 of com.mojang.herpfortress.Art see also lines 14 and 11
Realest Billy
Realest BillyOP2w ago
The thing is, the images exist, they are in the resources folder
No description
dan1st
dan1st2w ago
no, it doesn't work like that
Realest Billy
Realest BillyOP2w ago
dam
dan1st
dan1st2w ago
Class#getResourceAsStream loads a resource located next to the class so if you do Art.class.getResourceAsStream("abc.png"), it loads it from res/com/mojang/herpfortress/abc.png if res is registered as a resource folder Art.class.getResourceAsStream("/abc.png") would load it from res/abc.png (again, if res is a resource folder) And that code doesn't seem like it ever worked
Realest Billy
Realest BillyOP2w ago
Yeah but there's footage of it online working so I don't know what's up
dan1st
dan1st2w ago
Did you modify the Art file?
Realest Billy
Realest BillyOP2w ago
No
dan1st
dan1st2w ago
ok so first mark res as a resource folder and then remove the res from the strings so you have things like loadAndCut("data/red.png")
Realest Billy
Realest BillyOP2w ago
alright
dan1st
dan1st2w ago
right click on res > build path > use as source folder
Realest Billy
Realest BillyOP2w ago
Done Now i removed the res from the loadAndCut strings
Realest Billy
Realest BillyOP2w ago
So what now, doesn't look like anythings changed
No description
dan1st
dan1st2w ago
Can you show the code and project structure again?
Realest Billy
Realest BillyOP2w ago
This is the Art.java code
dan1st
dan1st2w ago
oh I forgot to say that you still need a slash at the beginning public Bitmap[][] red = loadAndCut("/chars/red.png", 16, 16);
Realest Billy
Realest BillyOP2w ago
it works Thanks for your help
JavaBot
JavaBot2w ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot2w ago
Post Closed
This post has been closed by <@1313557097564344391>.
Want results from more Discord servers?
Add your server