Fix spawn egg equality check and copy constructor

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2024-06-11 06:59:14 +10:00
parent cd2a1a6d7e
commit 92a9fb31be

View File

@ -111,6 +111,12 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta {
CraftMetaSpawnEgg(CraftMetaItem meta) {
super(meta);
if (!(meta instanceof CraftMetaSpawnEgg egg)) {
return;
}
this.entityTag = egg.entityTag;
}
CraftMetaSpawnEgg(DataComponentPatch tag) {
@ -167,7 +173,7 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta {
}
boolean isSpawnEggEmpty() {
return entityTag != null;
return !(entityTag != null);
}
@Override