Files
Purpur/patches/server/0108-DragonEggPlaceEvent.patch
jmp 7174d63c4e PaperPR - Projectile load/save limit per chunk
- Dropped "Add option to disable saving projectiles to disk" in favor of the above patch
 - Config migration is automatic. If "gameplay-mechanics.save-projectiles-to-disk" was set to false in purpur.yml, "projectile-load-save-per-chunk-limit" will be set to 0 in paper.yml (resulting in unchanged behaviour)
2020-11-30 19:38:23 -08: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 f853f6c424..5199cba870 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;