mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Dont do diminishing returns on command caused xp gains Fixes #3312
This commit is contained in:
parent
eb4960f307
commit
307d483323
@ -1,5 +1,6 @@
|
|||||||
package com.gmail.nossr50.listeners;
|
package com.gmail.nossr50.listeners;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@ -44,9 +45,10 @@ public class SelfListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void onPlayerXpGain(McMMOPlayerXpGainEvent event) {
|
public void onPlayerXpGain(McMMOPlayerXpGainEvent event) {
|
||||||
|
if (event.getXpGainReason() == XPGainReason.COMMAND)
|
||||||
|
return;
|
||||||
SkillType skillType = event.getSkill();
|
SkillType skillType = event.getSkill();
|
||||||
int threshold = ExperienceConfig.getInstance().getDiminishedReturnsThreshold(skillType);
|
int threshold = ExperienceConfig.getInstance().getDiminishedReturnsThreshold(skillType);
|
||||||
|
|
||||||
if (threshold <= 0 || !ExperienceConfig.getInstance().getDiminishedReturnsEnabled()) {
|
if (threshold <= 0 || !ExperienceConfig.getInstance().getDiminishedReturnsEnabled()) {
|
||||||
// Diminished returns is turned off
|
// Diminished returns is turned off
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user