mastery3 / sharpness6

Extended enchantment levels for OP weapons.
Other
3 stars 3 forks source link

Update to 1.18.2 and beyond? #2

Closed astridos2go closed 2 years ago

astridos2go commented 2 years ago

Hi, I think this mod would be perfect for a vanilla-ish server I'm running, but it's currently on 1.18.2, and eventually will be moved to 1.19.X, while the latest version of this mod is listed as for 1.17.

On Modrinth, your FAQ says that it would be very easy for you to port to new versions, so I was wondering if you were planning on releasing new versions for the newer version of Minecraft, or if the mod just still works on these newer versions?

Thank you!

ghost commented 2 years ago

Hello, I would also love to see a version for 1.19. Greetings.

mastery3 commented 2 years ago

I was inactive for a while, but I am currently creating a 1.19 port of the mod (something changed with the shouldPreventDamage method and the decompiled Minecraft source code isn't picking it up). In the meantime, there is a fork of this mod that supports 1.18.2 (not 1.19): https://github.com/Falaxir/sharpness6 (Edit: the referenced link is now outdated)

ghost commented 2 years ago

Awesome - looking forward to the 1.19 version 🥰

mastery3 commented 2 years ago

Uploaded 1.19 version

mastery3 commented 2 years ago

For some reason Minecraft stopped using java.util.Random and used their own net.minecraft.util.math.random.Random. No idea why the decompiler didn't pick that up though, might be something wrong with it (either that or I didn't read the source code properly).

mastery3 commented 2 years ago

Nothing wrong with the decompiler, turns out someone did this change near the top, which is nowhere near the shouldPreventDamage method:

- import java.util.Random;
+ import net.minecraft.util.math.random.Random;

... 28 lines ...

public static boolean shouldPreventDamage(ItemStack item, int level, Random random) {
ghost commented 2 years ago

Thank you for this super fast update - I will use the mod later:)