Sleep Sooner (Forge)

Sleep Sooner (Forge)

117k Downloads

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

Partonetrain opened this issue ยท 2 comments

commented

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.

commented

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

commented

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())