Serilum / .issue-tracker

Tracks all issues for Serilum's Minecraft mods on CurseForge and Modrinth.
https://serilum.com/
153 stars 40 forks source link

Bottle Your XP doesn't decrease levels if level curve is changed #2418

Open Partonetrain opened 2 months ago

Partonetrain commented 2 months ago

Information

Minecraft version: 1.20.1 Modloader: Fabric Fabric loader version: 0.15.11 Environment: Both Singleplayer / Multiplayer

Mod name: Bottle Your XP Mod version: 3.3

Collective version 1.20.1-7.6.1 (I think this is where the issue lies ... seems like experience curve is hardcoded here instead of referencing Player#getXpNeededForNextLevel)

Description

When experience level curve is changed, Bottling does not decrease level amount, only points, making experience dupable. To reproduce, set own level with commands, then shift-click glass bottle

No crash.

ricksouth commented 1 month ago

I am unsure how to fix this. I see you're the author of the mod, could you help me out?

I'm already checking for player.getXpNeededForNextLevel():

https://github.com/Serilum/Collective/blob/1.21.0/Common/src/main/java/com/natamus/collective/functions/ExperienceFunctions.java#L31

But I guess this is hardcoded?

https://github.com/Serilum/Collective/blob/1.21.0/Common/src/main/java/com/natamus/collective/functions/ExperienceFunctions.java#L70

Partonetrain commented 1 month ago

Unfortunately I don't think there's a better way to re-implement getExperienceForLevel than just making it build a list of level->exp conversions (using player.getXpNeededForNextLevel())