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

Paper Changes:
05cb10c56f Add repo for Velocity natives to dev bundle (#6536)
7bd7b18811 Configurable feature seeds (#6531)
ca708a0944 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#6539)
f02d3d8989 flattener should try to render custom translations (#6540)
1276bd5039 Fixed layers from V2550 not being added to list (#6541)
a763f258da docs: remove Paper tool method for patch mods
20903fcf5e docs: drop table of contents; it's built into GH
2021-09-02 12:13:11 -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 fde436065aeeb47cd177656a7c9fe8dc34178e87..6a1cb38de5733e384546984a0eadd4bab53c0122 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -346,7 +346,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);
}