Files
Purpur/patches/server/0150-Add-StructureGenerateEvent.patch
William Blake Galbreath c8befee46e Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
b33b63908e Support complex components in written book builder (#6337)
bfb3d42b44 Optimize entity tracker passenger checks (#6361)
399710ff79 Add reobf mappings patch for MinecraftServer#getLootTables (#6368)
25cd8aba9f Config option for Piglins guarding chests (#4829)
80650e8936 Added EntityItemDamageEvent (#4928)

Tuinity Changes:
8e7cc4dc96 Do not submit profile lookups to worldgen threads
2021-08-10 10:53:57 -05:00

41 lines
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nahuel <nahueldolores@hotmail.com>
Date: Sat, 9 Jan 2021 15:36:59 +0100
Subject: [PATCH] Add StructureGenerateEvent
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
index a5d7fdd9ec0342e000e467a002846873a10d75fc..f71cc1f5e5d594e82a4e6132d438bae74b9370a7 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -311,7 +311,14 @@ public abstract class ChunkGenerator {
if (structuresettingsfeature != null) {
StructureStart<?> structurestart1 = feature.generate(registryManager, this, this.biomeSource, structureManager, worldSeed, chunkcoordintpair, biome, j, structuresettingsfeature, chunk);
-
+ // Purpur start
+ if (new net.pl3x.purpur.event.world.StructureGenerateEvent(
+ accessor.getWorld().getWorld(),
+ org.bukkit.StructureType.getStructureTypes().get(feature.feature.getFeatureName().toLowerCase()),
+ chunkcoordintpair.x,
+ chunkcoordintpair.z
+ ).callEvent())
+ // Purpur end
accessor.setStartForFeature(sectionposition, feature.feature, structurestart1, chunk);
}