From 02338e50693b8387d054441d1342b1eedf5f28ad Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Sun, 13 Aug 2023 01:57:13 +0200 Subject: [PATCH] Fix DEFAULT getEntitySpawnReason for /summon (#9480) --- .../server/0300-Entity-getEntitySpawnReason.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/server/0300-Entity-getEntitySpawnReason.patch b/patches/server/0300-Entity-getEntitySpawnReason.patch index daef34b1fb..2f9efd909c 100644 --- a/patches/server/0300-Entity-getEntitySpawnReason.patch +++ b/patches/server/0300-Entity-getEntitySpawnReason.patch @@ -9,6 +9,18 @@ Pre existing entities will return NATURAL if it was a non persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. +diff --git a/src/main/java/net/minecraft/server/commands/SummonCommand.java b/src/main/java/net/minecraft/server/commands/SummonCommand.java +index 2eddeb8d5239bbfeefbf4d3bd363f1ad083299b6..a7c89cdf20cb63792c76de81c1ff9f2cbbfcea84 100644 +--- a/src/main/java/net/minecraft/server/commands/SummonCommand.java ++++ b/src/main/java/net/minecraft/server/commands/SummonCommand.java +@@ -57,6 +57,7 @@ public class SummonCommand { + ServerLevel worldserver = source.getLevel(); + Entity entity = EntityType.loadEntityRecursive(nbttagcompound1, worldserver, (entity1) -> { + entity1.moveTo(pos.x, pos.y, pos.z, entity1.getYRot(), entity1.getXRot()); ++ entity1.spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.COMMAND; // Paper + return entity1; + }); + diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java index 6b157b362cffedae26133fc0f0af1094655ee11f..986a509998d217228eb1dc2b5815787599e02d6b 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java