mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) bc7ea673a Add internal channel initialization listeners (#5557) b28ad17ac Check for world change in MoveEvent API methods 3095c7592 [Auto] Updated Upstream (CraftBukkit) f56989c97 Add RespawnFlags to PlayerRespawnEvent (#5533) 7579c2667 Add more API to PlayerMoveEvent (#5553)
This commit is contained in:
64
patches/server/0162-Add-StructureGenerateEvent.patch
Normal file
64
patches/server/0162-Add-StructureGenerateEvent.patch
Normal file
@@ -0,0 +1,64 @@
|
||||
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 316287af6e405ff224636255c2964f46003215ce..ff98335155c86803b98d8c67f0b40b8d65214890 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
@@ -287,6 +287,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/world/level/levelgen/feature/StructureFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java
|
||||
index 839cc598e6dd87dd77940b5b6dcb8ddcd0b3271e..2d653ba2582c39ac1c7f396c50a7a974aa02a07e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java
|
||||
@@ -23,7 +23,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/world/level/levelgen/feature/StructureGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java
|
||||
index 6df42ff26ff6e65ec2885122fe53dde857a3d1d2..917d147b06b7045ea69917c81f35fcafdd5098dd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java
|
||||
@@ -268,6 +268,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);
|
||||
}
|
||||
Reference in New Issue
Block a user