add exp command, fix game over screen

This commit is contained in:
Sen 2025-06-14 13:08:46 +02:00
parent 8f1fda3f3d
commit cdf8db1b50
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
4 changed files with 57 additions and 8 deletions

View file

@ -2755,9 +2755,6 @@ public abstract class EntityNPC extends EntityLiving
return !this.worldObj.getState(pos).getBlock().isNormalCube() && (this.height <= 1.0f || !this.worldObj.getState(pos.up()).getBlock().isNormalCube());
}
/**
* Sets the current XP, total XP, and level number.
*/
public void setXPStats(float currentXP, int maxXP, int level)
{
this.experience = currentXP;
@ -2819,7 +2816,7 @@ public abstract class EntityNPC extends EntityLiving
// START MP
public void addExperienceLevel(int levels) {
private void addExperienceLevel(int levels) {
this.experienceLevel += levels;
if (this.experienceLevel < 0)
@ -4075,6 +4072,11 @@ public abstract class EntityNPC extends EntityLiving
{
return this.isPlayer() ? this.inventory.armorItemInSlot(slot) : this.equipment[slot + 1];
}
public void setExperience(int points) {
this.setXPStats(0.0f, 0, 0);
this.addExperience(points);
}
public void addExperience(int amount)
{