Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group = "com.bitaspire"
version = "1.2.0"
version = "1.2.1"

repositories {
mavenLocal()
Expand Down
Binary file modified libraries/CyberCore-2.0.0.jar
Binary file not shown.
50 changes: 50 additions & 0 deletions src/main/java/com/bitaspire/cyberlevels/event/ExpChangeEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Getter;
import lombok.Setter;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -68,6 +69,55 @@ public void call() {
Bukkit.getPluginManager().callEvent(this);
}

/**
* Returns the live Bukkit player for integrations that expect a direct player method.
*
* <p>This is an alias for {@code getUser().getPlayer()} and is especially useful for
* reflection-based hooks that cannot consume CyberLevels' {@link LevelUser} wrapper directly.
*
* @return affected online player
*/
@NotNull
public Player getPlayer() {
return user.getPlayer();
}

/**
* Legacy-style alias for the mutable EXP delta.
*
* @return EXP amount that will be applied
*/
public double getAmount() {
return expAmount;
}

/**
* Legacy-style alias for changing the mutable EXP delta.
*
* @param amount replacement EXP amount
*/
public void setAmount(double amount) {
this.expAmount = amount;
}

/**
* Legacy-style alias for the previous EXP value.
*
* @return EXP before the change
*/
public double getOldXP() {
return oldExp;
}

/**
* Legacy-style alias for the projected EXP value.
*
* @return EXP after the change preview
*/
public double getNewXP() {
return newExp;
}

/**
* Returns the Bukkit handler list for this event type.
*
Expand Down
Loading