mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: d6f730655 Do not add passengers of entities that were above save limit (#5073) cb99288a5 Try to get a new 1.16.5 build on website now we hopefully fixed site bug 946cdd2d2 [CI-SKIP] [Auto] Rebuild Patches 8f805412b Remove class 13 from netty preload - Fixes #5066 f6d3c6811 Make ProjectileHitEvent Cancellable 97b020f13 make schedule command per world aac07a271 Return chat component with empty text instead of throwing exception. Fixes #3328 f27bc0659 Collision option for requiring a player participant 193f80148 Add StructureLocateEvent 59222b5ba Add sendOpLevel API f792973c2 [CI-SKIP] Update API to 1.16.5 (#5067) Tuinity Changes: db82b6c Update to starlight 0.0.3 b97e87f Merge branch 'master' into dev/lighting 1d169e7 Updated Upstream (Paper) 09997a6 Merge branch 'master' into dev/lighting 8954b61 Updated Upstream (Paper) 8753f47 Merge branch 'master' into dev/lighting 4743c34 Updated Upstream (Paper)
65 lines
3.6 KiB
Diff
65 lines
3.6 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/server/ChunkGenerator.java b/src/main/java/net/minecraft/server/ChunkGenerator.java
|
|
index 097cb9896c525a605c50e83548f828e0c71ab3d5..8a0d01d2bab4a28aa3c075534bc70b6e835810ef 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkGenerator.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkGenerator.java
|
|
@@ -251,6 +251,14 @@ public abstract class ChunkGenerator {
|
|
if (structuresettingsfeature != null) {
|
|
StructureStart<?> structurestart1 = structurefeature.a(iregistrycustom, this, this.b, definedstructuremanager, i, chunkcoordintpair, biomebase, j, structuresettingsfeature);
|
|
|
|
+ // Purpur start
|
|
+ if (new net.pl3x.purpur.event.world.StructureGenerateEvent(
|
|
+ structuremanager.getWorld().getWorld(),
|
|
+ org.bukkit.StructureType.getStructureTypes().get(structurefeature.getFeature().getRegistryKey().toLowerCase()),
|
|
+ chunkcoordintpair.x,
|
|
+ chunkcoordintpair.z
|
|
+ ).callEvent())
|
|
+ // Purpur end
|
|
structuremanager.a(SectionPosition.a(ichunkaccess.getPos(), 0), structurefeature.d, structurestart1, ichunkaccess);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/StructureFeature.java b/src/main/java/net/minecraft/server/StructureFeature.java
|
|
index 8e3c0c3783b767c2ba603b3b50200ac76a7fc33e..379665ae55e76afb03b20d1b81c57347af1137db 100644
|
|
--- a/src/main/java/net/minecraft/server/StructureFeature.java
|
|
+++ b/src/main/java/net/minecraft/server/StructureFeature.java
|
|
@@ -11,7 +11,7 @@ public class StructureFeature<FC extends WorldGenFeatureConfiguration, F extends
|
|
}, StructureGenerator::h);
|
|
public static final Codec<Supplier<StructureFeature<?, ?>>> b = RegistryFileCodec.a(IRegistry.av, StructureFeature.a);
|
|
public static final Codec<List<Supplier<StructureFeature<?, ?>>>> c = RegistryFileCodec.b(IRegistry.av, StructureFeature.a);
|
|
- public final F d;
|
|
+ public final F d; public final F getFeature() { return this.d; } // Purpur - OBFHELPER
|
|
public final FC e;
|
|
|
|
public StructureFeature(F f0, FC fc) {
|
|
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
|
|
index a62c87bceab2c9700a7b3925f208b0ffa2b9b393..8fc283f014783b76afda83097201bb7938a1f9fa 100644
|
|
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
|
|
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
|
|
@@ -235,6 +235,7 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration>
|
|
|
|
public abstract StructureGenerator.a<C> a();
|
|
|
|
+ public final String getRegistryKey() { return this.i(); } // Purpur - OBFHELPER
|
|
public String i() {
|
|
return (String) StructureGenerator.a.inverse().get(this);
|
|
}
|