Files
Purpur/patches/server/0099-DragonEggPlaceEvent.patch
BillyGalbreath 4c7ab7083d Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
1c8b6065e Skip distance map update when spawning is disabled
091e6700f Added PlayerStonecutterRecipeSelectEvent
fc885f966 Add toggle for always placing the dragon egg
b3a6da3a7 Updated Upstream (Bukkit/CraftBukkit)
18ccc062d [Auto] Updated Upstream (Spigot)
e9a87b72b fix BaseTag constructor (#5095)
2021-01-24 05:36:26 -06:00

26 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Thu, 30 Jul 2020 18:15:13 -0500
Subject: [PATCH] DragonEggPlaceEvent
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
index 7f11adbc5d8527b50f7657d46459516a471017b3..9cf7151d8623624c636c948a8716db31f275bfe3 100644
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
@@ -359,7 +359,13 @@ public class EnderDragonBattle {
this.generateExitPortal(true);
this.n();
if (this.world.paperConfig.enderDragonsDeathAlwaysPlacesDragonEgg || !this.previouslyKilled) { // Paper - always place dragon egg
- this.world.setTypeUpdate(this.world.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, WorldGenEndTrophy.a), Blocks.DRAGON_EGG.getBlockData());
+ // Purpur start
+ BlockPosition pos = this.world.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, WorldGenEndTrophy.a);
+ net.pl3x.purpur.event.block.DragonEggPlaceEvent event = new net.pl3x.purpur.event.block.DragonEggPlaceEvent(MCUtil.toLocation(world, pos));
+ if (event.callEvent()) {
+ this.world.setTypeUpdate(MCUtil.toBlockPosition(event.getLocation()), Blocks.DRAGON_EGG.getBlockData());
+ }
+ // Purpur end
}
this.previouslyKilled = true;