13
0
geforkt von Mirrors/Paper

SPIGOT-7462: Players no longer drop XP after dying near a Sculk Catalyst

By: DerFrZocker <derrieple@gmail.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2023-12-26 07:42:19 +11:00
Ursprung a9fb0c70f8
Commit fd3e1799d3
2 geänderte Dateien mit 10 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -1016,7 +1016,7 @@
if (blockposition != null) {
boolean flag2 = blockposition.equals(this.respawnPosition) && resourcekey.equals(this.respawnDimension);
@@ -1913,4 +2344,146 @@
@@ -1913,4 +2344,147 @@
public CommonPlayerSpawnInfo createCommonSpawnInfo(WorldServer worldserver) {
return new CommonPlayerSpawnInfo(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), this.getLastDeathLocation(), this.getPortalCooldown());
}
@ -1155,6 +1155,7 @@
+ }
+ this.keepLevel = false;
+ this.setDeltaMovement(0, 0, 0); // CraftBukkit - SPIGOT-6948: Reset velocity on death
+ this.skipDropExperience = false; // CraftBukkit - SPIGOT-7462: Reset experience drop skip, so that further deaths drop xp
+ }
+
+ @Override

Datei anzeigen

@ -31,10 +31,12 @@
public abstract class EntityLiving extends Entity implements Attackable {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -226,6 +250,20 @@
@@ -225,7 +249,21 @@
private float swimAmount;
private float swimAmountO;
protected BehaviorController<?> brain;
private boolean skipDropExperience;
- private boolean skipDropExperience;
+ protected boolean skipDropExperience;
+ // CraftBukkit start
+ public int expToDrop;
+ public boolean forceDrops;
@ -536,7 +538,7 @@
+ return i;
+ } else {
+ return 0;
}
+ }
+ }
+ // CraftBukkit end
+
@ -545,7 +547,7 @@
+ if (true && !(this instanceof net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon)) { // CraftBukkit - SPIGOT-2420: Special case ender dragon will drop the xp over time
+ EntityExperienceOrb.award((WorldServer) this.level(), this.position(), this.expToDrop);
+ this.expToDrop = 0;
+ }
}
+ // CraftBukkit end
}
@ -652,7 +654,7 @@
+ };
+ float blockingModifier = blocking.apply((double) f).floatValue();
+ f += blockingModifier;
+
+ Function<Double, Double> armor = new Function<Double, Double>() {
+ @Override
+ public Double apply(Double f) {
@ -741,7 +743,7 @@
+ absorptionModifier = (float) -event.getDamage(DamageModifier.ABSORPTION);
+ this.setAbsorptionAmount(Math.max(this.getAbsorptionAmount() - absorptionModifier, 0.0F));
+ float f2 = absorptionModifier;
+
+ if (f2 > 0.0F && f2 < 3.4028235E37F && this instanceof EntityHuman) {
+ ((EntityHuman) this).awardStat(StatisticList.DAMAGE_ABSORBED, Math.round(f2 * 10.0F));
+ }