2022-01-16 20:15:16 +01:00
|
|
|
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
|
2023-10-04 03:06:23 +02:00
|
|
|
index 87d909c2a34543ebdfc5d76aff7611d2d51144fb..3d44f8e9f8056d7d899e90e61240b2d1d109354b 100644
|
2022-01-16 20:15:16 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
2023-09-22 17:08:04 +02:00
|
|
|
@@ -175,11 +175,16 @@ public class Zombie extends Monster {
|
2022-01-16 20:15:16 +01:00
|
|
|
|
|
|
|
@Override
|
2022-06-08 15:12:28 +02:00
|
|
|
public int getExperienceReward() {
|
2022-01-16 20:15:16 +01:00
|
|
|
+ final int previousReward = this.xpReward; // Paper - store previous value to reset after calculating XP reward
|
|
|
|
if (this.isBaby()) {
|
2022-03-01 06:43:03 +01:00
|
|
|
this.xpReward = (int) ((double) this.xpReward * 2.5D);
|
2022-01-16 20:15:16 +01:00
|
|
|
}
|
|
|
|
|
2022-06-08 15:12:28 +02:00
|
|
|
- return super.getExperienceReward();
|
2022-01-16 20:15:16 +01:00
|
|
|
+ // Paper start - only change the XP reward for the calculations in the super method
|
2022-06-08 15:12:28 +02:00
|
|
|
+ int reward = super.getExperienceReward();
|
2022-01-16 20:15:16 +01:00
|
|
|
+ this.xpReward = previousReward;
|
|
|
|
+ return reward;
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|