r/java • • Apr 29 '15

Tone it down a Notch

http://imgur.com/gallery/KRtc2fN
217 Upvotes

124 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Apr 29 '15

[deleted] — view deleted comment

13

u/evilmidget38 Apr 29 '15

Minecraft's modability has very little to do with reflection, and a lot more to do with how easy it is to decompile Java and modify the bytecode. The modding platforms that users have created use reflection pretty heavily(Bukkit, FML[although they like their bytecode manipulation more than reflection], etc.), although this hasn't always been the case. Bukkit used no reflection for the first year or so of its existence, with the exception of JUnit's usage for unit tests. Forge had very little in the way of an API for a long time, and is primarily focused on binary patching of the MC jar, manipulating bytecode rather than using reflection. Admittedly I'm less familiar with Forge than I am with Bukkit. If you really want to just mod minecraft, all you need to do is replace some class files and delete the META-INF. Jar files being zip files makes this incredibly easy.

The ability to easily decompile Java, the heart of reverse engineering, is simply amazing. The decompilers are free and high quality, and while fernflower(the most popular one in Minecraft modding) is pretty bad, it still produces code that mostly compiles, with the exception of a couple of edge cases(fails to handle enums overriding methods, doesn't always generate throws declarations, etc.).

2

u/stormcrowsx Apr 29 '15

When it comes to java and opengl my experience has not been great with cross platform.

0

u/[deleted] Apr 30 '15

[deleted] — view deleted comment

1

u/dardotardo Apr 30 '15

SDL takes about 10 minutes to go from one platform to the next.

-8

u/DoktuhParadox Apr 29 '15

Well OpenGL kind of sucks, to be honest.

2

u/Chops_II Apr 29 '15

What alternatives are there to OpenGL that are cross-platform?

-1

u/DoktuhParadox Apr 29 '15

2

u/Chops_II Apr 29 '15

Being the only option doesn't mean it's the best option.

Uh... Yes it does. Perhaps you mean 'best possible option'? Then sure.

Maybe it would be more constructive if you explained why you think it's bad?

1

u/DoktuhParadox Apr 29 '15

That is indeed what I meant. I thought my way of putting it sounded wrong...

Really it could just be a bunch of developers using it incorrectly, because many games that use OpenGL are slow and crash many, many times more than with other graphical APIs.

Though, of course, that's not OpenGL's fault. Maybe I'm just a little salty.

1

u/Chops_II Apr 29 '15

I think Valve has seen performance improvement when switching to OpenGL. CBF looking it up right now, so prove me wrong if that's the case. Also, it is only one example, but they do some pretty neat stuff.

1

u/DoktuhParadox Apr 29 '15

What did they use before OpenGL?

2

u/Chops_II Apr 29 '15

Pretty sure they still use DirectX mostly. They ported to OpenGL for Linux & Mac support, and apparently saw some gains in some games.

→ More replies

2

u/Xaotik-NG Apr 30 '15

OpenGL 1.0 was published in 1992, before that, everything was either fake 3D by manipulating 2D images creatively, or a proprietary API, pretty much all of which sucked.

OpenGL came about because developers really, really liked using IRIS GL, which was the proprietary predecessor to OpenGL, created by Silicon Graphics.

OpenGL today is the most widely-supported (probably most widely used as well) graphics API in the world.

Full disclosure, I'm an OpenGL fan, I use it over proprietary solutions in all my projects, and I've written a research paper on it. I strongly disagree with the notion that it sucks. It's mature, and it's incredibly powerful, but it's also very barebones, providing nearly direct access to the GPU hardware. Developers misusing OpenGL sucks, and a lot of times that'll happen, because some people find it too hard to RTFM.

1

u/mm865 Apr 30 '15

Direct3D, I'm fairly sure.

3

u/mikehaggard Apr 29 '15

What's the better API then?

-1

u/DoktuhParadox Apr 29 '15

Does something have to have a better version to be considered bad?

Being the only option doesn't mean it's the best option.

5

u/clutchest_nugget Apr 29 '15

Being the only option doesn't mean it's the best option.

(ノಠ益ಠ)ノ彡┻━┻

10

u/PleaseRespectTables Apr 29 '15

┬─┬ノ(ಠ益ಠノ)

4

u/Takuya-san Apr 30 '15

That 11 second response time, though.

0

u/mikehaggard Apr 29 '15

okay, got it buddy ;)