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

Paper Changes:
fb36f15d6 Let some more packets be send immediately, closes #4140 (#4896)
ede41fe16 Emancipate more features to PlayerHandshakeEvent
3fdeba1f5 [CI-SKIP] [Auto] Rebuild Patches
5fc07bd63 Maded Title-Objects directy sendable to targets
e7b9a478e Player Chunk Load/Unload Events
1d0cfc0cc MC-4 Fix item position desync
458db6206 Limit auto recipe packets
2020-12-16 18:05:35 -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 f853f6c424da77c40ee3d5b5dc2279ba8918977c..5199cba870a6ea004ee72ce225a0b6f483aed2ed 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.purpurConfig.enderDragonAlwaysDropsEggBlock || !this.previouslyKilled) { // Purpur - 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;