summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-09-15 05:13:10 +0100
committerDinnerbone <dinnerbone@dinnerbone.com>2011-09-15 05:13:10 +0100
commit1c95476a00958ff19dfb18ab1a621546b3ad5be4 (patch)
tree239671b526b5586b4f75a98035a9d6fd09a80f81 /src/main/java
parentca57a1a1af5af106ebb44952ed487f15d6107c3b (diff)
downloadcraftbukkit-1c95476a00958ff19dfb18ab1a621546b3ad5be4.tar
craftbukkit-1c95476a00958ff19dfb18ab1a621546b3ad5be4.tar.gz
craftbukkit-1c95476a00958ff19dfb18ab1a621546b3ad5be4.tar.lz
craftbukkit-1c95476a00958ff19dfb18ab1a621546b3ad5be4.tar.xz
craftbukkit-1c95476a00958ff19dfb18ab1a621546b3ad5be4.zip
Implemented player experience methods
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9548234b..86eeb82e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -396,4 +396,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public GameMode getGameMode() {
return GameMode.getByValue(getHandle().itemInWorldManager.a());
}
+
+ public int getExperience() {
+ return getHandle().exp;
+ }
+
+ public void setExperience(int exp) {
+ getHandle().d(exp);
+ }
+
+ public int getLevel() {
+ return getHandle().expLevel;
+ }
+
+ public void setLevel(int level) {
+ getHandle().expLevel = level;
+ }
+
+ public int getTotalExperience() {
+ return getHandle().expTotal;
+ }
+
+ public void setTotalExperience(int exp) {
+ getHandle().expTotal = exp;
+
+ if (getTotalExperience() > getExperience()) {
+ getHandle().exp = getTotalExperience();
+ }
+ }
}