mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 22:13:42 +01:00
33 lines
1.4 KiB
Diff
33 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Sun, 16 Jan 2022 10:34:02 -0800
|
|
Subject: [PATCH] Fix xp reward for baby zombies
|
|
|
|
The field that tracks the xpReward was not
|
|
getting reset if the death was cancelled
|
|
so this resets it after each call to
|
|
Zombie#getExperienceReward
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
index e4fc7f96aac9cc2ed5b4158b6663de397ee1162f..d22464521f41c6a13d6c33f0a361497a3e04197f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
@@ -172,11 +172,16 @@ public class Zombie extends Monster {
|
|
|
|
@Override
|
|
public int getExperienceReward() {
|
|
+ final int previousReward = this.xpReward; // Paper - store previous value to reset after calculating XP reward
|
|
if (this.isBaby()) {
|
|
this.xpReward = (int) ((double) this.xpReward * 2.5D);
|
|
}
|
|
|
|
- return super.getExperienceReward();
|
|
+ // Paper start - store previous value to reset after calculating XP reward
|
|
+ int reward = super.getExperienceReward();
|
|
+ this.xpReward = previousReward;
|
|
+ return reward;
|
|
+ // Paper end - store previous value to reset after calculating XP reward
|
|
}
|
|
|
|
@Override
|