aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorgranny <[email protected]>2024-07-01 01:16:07 -0700
committerGitHub <[email protected]>2024-07-01 10:16:07 +0200
commitb45d9b6c97d2bb09a48296b34a7150de0ac2da93 (patch)
treeb4581537c6e4cce64f8abad0fa181606484c8966
parentaa8d38d3dbab3cb0021d0f24f726818caf77bf15 (diff)
downloadPaper-b45d9b6c97d2bb09a48296b34a7150de0ac2da93.tar.gz
Paper-b45d9b6c97d2bb09a48296b34a7150de0ac2da93.zip
Fix summon_entity effect attempting to add incorrect entity (#11004)
-rw-r--r--patches/server/0008-CB-fixes.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/patches/server/0008-CB-fixes.patch b/patches/server/0008-CB-fixes.patch
index 285cc0ff21..1062e3ebb7 100644
--- a/patches/server/0008-CB-fixes.patch
+++ b/patches/server/0008-CB-fixes.patch
@@ -6,6 +6,8 @@ Subject: [PATCH] CB fixes
* Missing Level -> LevelStem generic in StructureCheck
Need to use the right for injectDatafixingContext (Spottedleaf)
+* Fix summon_entity effect attempting to add incorrect entity (granny)
+
* Removed incorrect parent perm for `minecraft.debugstick.always` (Machine_Maker)
* Fixed method signature of Marker#addPassenger (Machine_Maker)
@@ -29,6 +31,19 @@ index a696a0d168987aaa4e59c471a23eeb48d683c1b2..9d11fcb3df12182ae00ce73f7e30091f
this.structureManager = new StructureManager(this, this.serverLevelData.worldGenOptions(), this.structureCheck); // CraftBukkit
if ((this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END)) || env == org.bukkit.World.Environment.THE_END) { // CraftBukkit - Allow to create EnderDragonBattle in default and custom END
this.dragonFight = new EndDragonFight(this, this.serverLevelData.worldGenOptions().seed(), this.serverLevelData.endDragonFightData()); // CraftBukkit
+diff --git a/src/main/java/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java b/src/main/java/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java
+index d927357d541cf206bb3019b2fda3473a77b44ec4..4601c7069ba82ccfe87e9dc304b6f3262f7bbfbf 100644
+--- a/src/main/java/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java
++++ b/src/main/java/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java
+@@ -54,7 +54,7 @@ public record SummonEntityEffect(HolderSet<EntityType<?>> entityTypes, boolean j
+ // CraftBukkit start
+ world.strikeLightning(entity1, (context.itemStack().getItem() == Items.TRIDENT) ? LightningStrikeEvent.Cause.TRIDENT : LightningStrikeEvent.Cause.ENCHANTMENT);
+ } else {
+- world.addFreshEntityWithPassengers(user, CreatureSpawnEvent.SpawnReason.ENCHANTMENT);
++ world.addFreshEntityWithPassengers(entity1, CreatureSpawnEvent.SpawnReason.ENCHANTMENT); // Paper - Fix typo when adding summoned entity
+ // CraftBukkit end
+ }
+
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
index 0dc7f88877020bddd5a84db51d349f52b673048e..aae73586265593ee7830fb8dd5c2e3d7560057f0 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java