mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
SPIGOT-4190: Move ChunkLoadEvent call
By: md_5 <git@md-5.net>
This commit is contained in:
parent
94950beea7
commit
e3f89384f6
2 changed files with 26 additions and 16 deletions
|
@ -118,7 +118,25 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -735,9 +788,21 @@
|
@@ -719,6 +772,17 @@
|
||||||
|
this.world.a((Collection) entityslice);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // CraftBukkit start
|
||||||
|
+ org.bukkit.Server server = this.world.getServer();
|
||||||
|
+ if (server != null) {
|
||||||
|
+ /*
|
||||||
|
+ * If it's a new world, the first few chunks are generated inside
|
||||||
|
+ * the World constructor. We can't reliably alter that, so we have
|
||||||
|
+ * no way of creating a CraftWorld/CraftServer at that point.
|
||||||
|
+ */
|
||||||
|
+ server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(this.bukkitChunk, this.newChunk));
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeEntities() {
|
||||||
|
@@ -735,9 +799,21 @@
|
||||||
int i = aentityslice.length;
|
int i = aentityslice.length;
|
||||||
|
|
||||||
for (int j = 0; j < i; ++j) {
|
for (int j = 0; j < i; ++j) {
|
||||||
|
@ -142,7 +160,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -799,8 +864,8 @@
|
@@ -799,8 +875,8 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Entity entity = (Entity) iterator.next();
|
Entity entity = (Entity) iterator.next();
|
||||||
|
|
||||||
|
@ -153,7 +171,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1006,13 +1071,13 @@
|
@@ -1006,13 +1082,13 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public LongSet b(String s) {
|
public LongSet b(String s) {
|
||||||
|
@ -169,7 +187,7 @@
|
||||||
return new LongOpenHashSet();
|
return new LongOpenHashSet();
|
||||||
})).add(i);
|
})).add(i);
|
||||||
}
|
}
|
||||||
@@ -1061,14 +1126,14 @@
|
@@ -1061,14 +1137,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.t instanceof ProtoChunkTickList) {
|
if (this.t instanceof ProtoChunkTickList) {
|
||||||
|
|
|
@ -1,19 +1,10 @@
|
||||||
--- a/net/minecraft/server/ChunkMap.java
|
--- a/net/minecraft/server/ChunkMap.java
|
||||||
+++ b/net/minecraft/server/ChunkMap.java
|
+++ b/net/minecraft/server/ChunkMap.java
|
||||||
@@ -31,6 +31,54 @@
|
@@ -31,6 +31,46 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ org.bukkit.Server server = chunk.world.getServer();
|
+ // CraftBukkit start
|
||||||
+ if (server != null) {
|
|
||||||
+ /*
|
|
||||||
+ * If it's a new world, the first few chunks are generated inside
|
|
||||||
+ * the World constructor. We can't reliably alter that, so we have
|
|
||||||
+ * no way of creating a CraftWorld/CraftServer at that point.
|
|
||||||
+ */
|
|
||||||
+ server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(chunk.bukkitChunk, chunk.newChunk));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Update neighbor counts
|
+ // Update neighbor counts
|
||||||
+ for (int x = -2; x < 3; x++) {
|
+ for (int x = -2; x < 3; x++) {
|
||||||
+ for (int z = -2; z < 3; z++) {
|
+ for (int z = -2; z < 3; z++) {
|
||||||
|
@ -51,11 +42,12 @@
|
||||||
+ BlockSand.instaFall = false;
|
+ BlockSand.instaFall = false;
|
||||||
+ chunk.world.getServer().getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(chunk.bukkitChunk));
|
+ chunk.world.getServer().getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(chunk.bukkitChunk));
|
||||||
+ }
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
return chunk1;
|
return chunk1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,23 +117,25 @@
|
@@ -69,23 +109,25 @@
|
||||||
throw new RuntimeException("Not yet implemented");
|
throw new RuntimeException("Not yet implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue