r/badcode • • Mar 19 '23

java converting an integer to a string then converting it to an integer

Post image
486 Upvotes

89 comments sorted by

View all comments

1

u/TorbenKoehn Mar 20 '23

The „setAccessible(true)“ looks like the worst thing here for me. Looks like you’re setting private properties to public to directly access their values. Your software architect will thank you a lot

0

u/[deleted] Mar 20 '23

This is the only way i can get NMS fields. I know NMS and Bukkit api sucks

1

u/Auxilor Mar 20 '23

it's not the only way!!! use paperweight userdev and you can code against mojang-mapped NMS code, and you can even set it up to work cross-version like I do in https://github.com/Auxilor/eco

1

u/[deleted] Mar 20 '23

is it for 1.12.2?

1

u/Auxilor Mar 20 '23

why the hell are you using 1.12.2? if you say any sentence containing the word 'performance' ill kill you

1

u/[deleted] Mar 20 '23
  1. cause my plugins are not updated to 1.12.2, and i will not spend my time updating them
  2. cause it uses less ram and cpu

whats the point updating to new versions? just for the new "features"?

1

u/TorbenKoehn Mar 20 '23

Because other people are using the newest versions of things and you’re keeping it incompatible by force

1

u/[deleted] Mar 20 '23

and what? hypixel still runs on 1.7. they just use plugins to add 1.7+ support.

1

u/TorbenKoehn Mar 20 '23

I really don't care, if you want to use whataboutism to justify it, you do you.

I'm just saying there are probably a lot of players that would like to use your stuff, but don't want to downgrade, especially since other mods they like only exist for newer versions.

1

u/[deleted] Mar 20 '23

I use viaversion and viabackward plugins, means people can join from any minecraft version to 1.12.2 server - no need for them to downgrade their mc version

→ More replies