remove xp usage

This commit is contained in:
Sen 2025-06-12 13:50:50 +02:00
parent 47021f9e49
commit 83f66723c9
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
11 changed files with 159 additions and 296 deletions

View file

@ -33,6 +33,7 @@ import common.init.SoundEvent;
import common.init.UniverseRegistry;
import common.inventory.Container;
import common.inventory.ContainerChest;
import common.inventory.ContainerEnchantment;
import common.inventory.ContainerEntityInventory;
import common.inventory.ContainerMerchant;
import common.inventory.ICrafting;
@ -462,7 +463,7 @@ public class Player extends User implements ICrafting, Executor, IPlayer
this.entity.experienceLevel = oldPlayer.experienceLevel;
this.entity.experienceTotal = oldPlayer.experienceTotal;
this.entity.experience = oldPlayer.experience;
this.entity.setXPSeed(oldPlayer.getXPSeed());
this.entity.setEnchSeed(oldPlayer.getEnchSeed());
this.entity.setWarpChest(oldPlayer.getWarpChest());
// this.entity.getDataWatcher().updateObject(10, Integer.valueOf(oldPlayer.getDataWatcher().getWatchableObjectInt(10)));
this.lastExperience = -1;
@ -2167,7 +2168,7 @@ public class Player extends User implements ICrafting, Executor, IPlayer
}
this.entity.setPositionAndRotation(d8, d9, d10, f1, f2);
this.entity.addMovementStat(this.entity.posX - d0, this.entity.posY - d1, this.entity.posZ - d2);
this.entity.addMovement(this.entity.posX - d0, this.entity.posY - d1, this.entity.posZ - d2);
if (!this.entity.noClip)
{
@ -2631,10 +2632,9 @@ public class Player extends User implements ICrafting, Executor, IPlayer
break;
case ENCHANT_ITEM:
if(this.entity.openContainer.windowId == (packetIn.getAuxData() & 255) && this.entity.openContainer.getCanCraft(this.entity)) // && !this.playerEntity.isSpectator())
{
this.entity.openContainer.enchantItem(this.entity, (packetIn.getAuxData() >> 8) % 3);
this.entity.openContainer.detectAndSendChanges();
if(this.entity.openContainer instanceof ContainerEnchantment ench && ench.windowId == (packetIn.getAuxData() & 255) && ench.getCanCraft(this.entity)) {
ench.enchantItem(this.entity, (packetIn.getAuxData() >> 8) % 3);
ench.detectAndSendChanges();
}
break;