Cleanup some patches (#9093)

This commit is contained in:
Lulu13022002 2023-04-04 11:47:16 +02:00
parent 076afec362
commit e217afc5b4
3 changed files with 22 additions and 36 deletions

View file

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aurora <aurora@relanet.eu>
Date: Sat, 3 Oct 2020 16:28:41 +0200
Subject: [PATCH] Clarify the Javadocs for Entity.getEntitySpawnReason()
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
}
/**
- * @return The {@link org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason} that spawned this entity.
+ * @return The {@link org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason} that initially spawned this entity. <!-- Paper - added "initially" to clarify that the SpawnReason doesn't change after the Entity was initially spawned" -->
*/
@NotNull
org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason();

View file

@ -9,6 +9,8 @@ Pre existing entities will return NATURAL if it was a non
persistenting Living Entity, SPAWNER for spawners,
or DEFAULT since data was not stored.
Co-authored-by: Aurora <aurora@relanet.eu>
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
@ -19,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+
+ /**
+ * @return The {@link org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason} that spawned this entity.
+ * @return The {@link org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason} that initially spawned this entity. <!-- Paper - added "initially" to clarify that the SpawnReason doesn't change after the Entity was initially spawned" -->
+ */
+ @NotNull
+ org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason();

View file

@ -29,26 +29,13 @@ https://bugs.mojang.com/browse/MC-191591
https://bugs.mojang.com/browse/MC-258360
Fix items equipped on AbstractHorse losing NBT
https://bugs.mojang.com/browse/MC-121048
by: MelnCat <melncatuwu@gmail.com>
This moves the setHealth call to below the recordDamage call to prevent
recordDamage from clearing the CombatTracker, since recordDamage will
clear the CombatTracker if the entity is dead. This fixes death messages
such as the "doomed to fall" messages.
https://bugs.mojang.com/browse/MC-257875
by: Jake Potrebic <jake.m.potrebic@gmail.com>
Fixes server not consuming fire charges when igniting a creeper
https://bugs.mojang.com/browse/MC-258535
by: Jake Potrebic <jake.m.potrebic@gmail.com>
Fixes certain explosion damage not scaling with difficulty
https://bugs.mojang.com/browse/MC-259571
Fix changeGameModeForPlayer to use gameModeForPlayer
https://bugs.mojang.com/browse/MC-260219
Play sniffer eat sound for the last item
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: MelnCat <melncatuwu@gmail.com>
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -180,6 +167,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!player.getAbilities().instabuild) {
stack.shrink(1);
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -0,0 +0,0 @@ public class Sniffer extends Animal {
@Override
public InteractionResult mobInteract(Player player, InteractionHand hand) {
ItemStack itemstack = player.getItemInHand(hand);
+ boolean wasFood = this.isFood(itemstack); // Paper - Fix MC-260219
InteractionResult enuminteractionresult = super.mobInteract(player, hand);
- if (enuminteractionresult.consumesAction() && this.isFood(itemstack)) {
+ if (enuminteractionresult.consumesAction() && wasFood) { // Paper - Fix MC-260219
this.level.playSound((Player) null, (Entity) this, this.getEatingSound(itemstack), SoundSource.NEUTRAL, 1.0F, Mth.randomBetween(this.level.random, 0.8F, 1.2F));
}
diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java