testserver/patches/unapplied/server/0806-Mark-fish-and-axolotls...

33 lines
2.0 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 13 Aug 2021 16:38:08 -0700
Subject: [PATCH] Mark fish and axolotls from buckets as persistent
diff --git a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java
index fc0cd86397b12e42756273a0317164d79ac51937..0701adf77a04a82df4fe1dceee196fee5d820961 100644
--- a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java
+++ b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java
@@ -90,7 +90,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
@Override
public void setFromBucket(boolean fromBucket) {
this.entityData.set(AbstractFish.FROM_BUCKET, fromBucket);
- this.setPersistenceRequired(this.isPersistenceRequired()); // CraftBukkit - SPIGOT-4106 update persistence
+ this.setPersistenceRequired(fromBucket || this.isPersistenceRequired()); // CraftBukkit - SPIGOT-4106 update persistence // Paper - actually set as persistent
}
@Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
index f75333190f8b824e0b52ad2d74739f420644f469..2b8725087fd3bfeca7162bda2783fdacd13a8390 100644
--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
@@ -236,7 +236,7 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
@Override
public void setFromBucket(boolean fromBucket) {
this.entityData.set(Axolotl.FROM_BUCKET, fromBucket);
- this.setPersistenceRequired(this.isPersistenceRequired()); // CraftBukkit - SPIGOT-4106 update persistence
+ this.setPersistenceRequired(fromBucket || this.isPersistenceRequired()); // CraftBukkit - SPIGOT-4106 update persistence // Paper - actually set as persistent
}
@Nullable