potion cleanup

This commit is contained in:
Sen 2025-03-26 21:07:23 +01:00
parent 460a58e062
commit e108650cd4
30 changed files with 644 additions and 968 deletions

View file

@ -1751,7 +1751,7 @@ public class Player extends NetHandler implements ICrafting, Executor
this.admin = admin;
if(!this.isAdmin() && this.entity != null && this.entity.noclip) {
this.entity.noclip = false;
this.entity.flying &= this.entity.hasEffect(Potion.flying);
this.entity.flying &= this.entity.hasEffect(Potion.FLYING);
this.entity.fallDistance = 0.0F;
this.sendPlayerAbilities();
this.addFeed(TextColor.RED + "NoClip wurde deaktiviert");
@ -2520,7 +2520,7 @@ public class Player extends NetHandler implements ICrafting, Executor
break;
case START_FLYING:
this.entity.flying = this.entity.hasEffect(Potion.flying) || this.entity.noclip;
this.entity.flying = this.entity.hasEffect(Potion.FLYING) || this.entity.noclip;
break;
case STOP_FLYING:
@ -2640,12 +2640,12 @@ public class Player extends NetHandler implements ICrafting, Executor
if(this.isAdmin()) {
// this.playerEntity.setCheat(!this.playerEntity.godmode);
this.entity.fallDistance = 0.0F;
if(this.entity.hasEffect(Potion.digSpeed) && this.entity.getEffect(Potion.digSpeed).getAmplifier() == 255) {
this.entity.removeEffect(Potion.digSpeed.id);
this.entity.removeEffect(Potion.resistance.id);
this.entity.removeEffect(Potion.fireResistance.id);
this.entity.removeEffect(Potion.flying.id);
this.entity.removeEffect(Potion.manaBoost.id);
if(this.entity.hasEffect(Potion.HASTE) && this.entity.getEffect(Potion.HASTE).getAmplifier() == 255) {
this.entity.removeEffect(Potion.HASTE);
this.entity.removeEffect(Potion.RESISTANCE);
this.entity.removeEffect(Potion.FIRE_RESISTANCE);
this.entity.removeEffect(Potion.FLYING);
this.entity.removeEffect(Potion.MANA);
this.addFeed(TextColor.RED + "Statuseffekte wurden entfernt");
}
else {
@ -2653,11 +2653,11 @@ public class Player extends NetHandler implements ICrafting, Executor
this.entity.setHealth(this.entity.getMaxHealth());
this.entity.setManaPoints(this.entity.getMaxMana());
this.entity.clearEffects(false);
this.entity.addEffect(new PotionEffect(Potion.digSpeed.id, Integer.MAX_VALUE, 255, false, false));
this.entity.addEffect(new PotionEffect(Potion.resistance.id, Integer.MAX_VALUE, 255, false, false));
this.entity.addEffect(new PotionEffect(Potion.fireResistance.id, Integer.MAX_VALUE, 0, false, false));
this.entity.addEffect(new PotionEffect(Potion.flying.id, Integer.MAX_VALUE, 0, false, false));
this.entity.addEffect(new PotionEffect(Potion.manaBoost.id, Integer.MAX_VALUE, 255, false, false));
this.entity.addEffect(new PotionEffect(Potion.HASTE, Integer.MAX_VALUE, 255, false, false));
this.entity.addEffect(new PotionEffect(Potion.RESISTANCE, Integer.MAX_VALUE, 255, false, false));
this.entity.addEffect(new PotionEffect(Potion.FIRE_RESISTANCE, Integer.MAX_VALUE, 0, false, false));
this.entity.addEffect(new PotionEffect(Potion.FLYING, Integer.MAX_VALUE, 0, false, false));
this.entity.addEffect(new PotionEffect(Potion.MANA, Integer.MAX_VALUE, 255, false, false));
this.addFeed(TextColor.GREEN + "Statuseffekte wurden hinzugefügt");
}
}
@ -2668,7 +2668,7 @@ public class Player extends NetHandler implements ICrafting, Executor
if(!this.entity.noclip)
this.entity.mountEntity(null);
this.entity.noclip ^= true;
this.entity.flying &= this.entity.hasEffect(Potion.flying) || this.entity.noclip;
this.entity.flying &= this.entity.hasEffect(Potion.FLYING) || this.entity.noclip;
this.entity.fallDistance = 0.0F;
this.sendPlayerAbilities();
this.addFeed((this.entity.noclip ? TextColor.GREEN : TextColor.RED) + "NoClip ist jetzt " + (this.entity.noclip ? "eingeschaltet" : "ausgeschaltet"));
@ -2677,10 +2677,10 @@ public class Player extends NetHandler implements ICrafting, Executor
case SPEED:
if(this.isAdmin()) {
if(this.entity.hasEffect(Potion.moveSpeed))
this.entity.removeEffect(Potion.moveSpeed.id);
if(this.entity.hasEffect(Potion.SPEED))
this.entity.removeEffect(Potion.SPEED);
else
this.entity.addEffect(new PotionEffect(Potion.moveSpeed.id, Integer.MAX_VALUE, 19, false, false));
this.entity.addEffect(new PotionEffect(Potion.SPEED, Integer.MAX_VALUE, 19, false, false));
this.addFeed(TextColor.GREEN + "Deine Geschwindigkeit wurde auf %dx geändert", (int)(this.entity.getAIMoveSpeed() * 10.0f));
// int speed = this.playerEntity.speed != 1.0f ? 1 : 5;
// this.playerEntity.speed = (float)speed;