@@ -109,20 +109,12 @@ public void onComponentAdded(
109109 return ;
110110 var xpAmountHealth = Math .max (1 , (long ) (maxHealth * this .config .get ().getDefaultXPGainPercentage ()));
111111 var getXPMapping = xpMap .getOrDefault (entity .getNPCTypeId (), Math .toIntExact (xpAmountHealth ));
112- var xpAmount = config .get ().isUseConfigXPMappingsInsteadOfHealthDefaults ()
113- ? getXPMapping
112+ double levelScale = Math .pow (mobLevel .level , config .get ().getMobLevelMultiplier ());
113+ long base = config .get ().isUseConfigXPMappingsInsteadOfHealthDefaults ()
114+ ? (long ) (getXPMapping )
114115 : xpAmountHealth ;
115- final var levelWindow = 5 ;
116- final var maxBonusMult = 1.25 ;
117-
118- int diff = Math .abs (playerLevel - mobLevel .level );
119- if (diff <= levelWindow ) {
120- var t = 1.0 - (diff / (double ) levelWindow );
121- var mult = 1.0 + (maxBonusMult - 1.0 ) * t ;
122- xpAmount = Math .max (1L , Math .round (xpAmount * mult ));
123- }
124- long finalXpAmount = xpAmount ;
125- if (finalXpAmount <= 0 )
116+ long xpAmount = Math .round (base * levelScale );
117+ if (xpAmount <= 0 )
126118 return ;
127119 store .getExternalData ().getWorld ().execute (() -> {
128120 LevelingCoreApi .getLevelServiceIfPresent ().ifPresent (levelService -> {
@@ -131,13 +123,13 @@ public void onComponentAdded(
131123 PluginManager .get ()
132124 .getPlugin (new PluginIdentifier ("tsumori" , "partypro" )) != null
133125 ) {
134- PartyProCompat .onXPGain (finalXpAmount , player .getUuid (), levelService , config , playerRef );
126+ PartyProCompat .onXPGain (xpAmount , player .getUuid (), levelService , config , playerRef );
135127 } else if (
136128 PluginManager .get ()
137129 .getPlugin (new PluginIdentifier ("com.carsonk" , "Party Plugin" )) != null
138130 ) {
139131 PartyPluginCompat .onXPGain (
140- finalXpAmount ,
132+ xpAmount ,
141133 player .getUuid (),
142134 levelService ,
143135 config ,
@@ -148,9 +140,9 @@ public void onComponentAdded(
148140 if (!config .get ().isDisableXPGainNotification ())
149141 NotificationsUtil .sendNotification (
150142 playerRef ,
151- CommandLang .GAINED .param ("xp" , finalXpAmount )
143+ CommandLang .GAINED .param ("xp" , xpAmount )
152144 );
153- levelService .addXp (player .getUuid (), finalXpAmount );
145+ levelService .addXp (player .getUuid (), xpAmount );
154146 XPBarHud .updateHud (playerRef );
155147 }
156148 LevelingCore .mobLevelRegistry .remove (entity .getUuid ());
0 commit comments