mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
51 lines
2.6 KiB
Diff
51 lines
2.6 KiB
Diff
--- a/net/minecraft/server/level/ChunkMap.java
|
|
+++ b/net/minecraft/server/level/ChunkMap.java
|
|
@@ -440,6 +_,7 @@
|
|
if (this.f_140131_.remove(p_140182_, p_140183_) && p_198809_ != null) {
|
|
if (p_198809_ instanceof LevelChunk) {
|
|
((LevelChunk)p_198809_).m_62913_(false);
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Unload((LevelChunk)p_198809_));
|
|
}
|
|
|
|
this.m_140258_(p_198809_);
|
|
@@ -621,8 +_,14 @@
|
|
levelchunk.m_62952_();
|
|
if (this.f_140132_.add(chunkpos.m_45588_())) {
|
|
levelchunk.m_62913_(true);
|
|
+ try {
|
|
+ p_140384_.currentlyLoading = levelchunk; // Forge - bypass the future chain when getChunk is called, this prevents deadlocks.
|
|
levelchunk.m_156369_();
|
|
levelchunk.m_187958_(this.f_140133_);
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(levelchunk));
|
|
+ } finally {
|
|
+ p_140384_.currentlyLoading = null; // Forge - Stop bypassing the future chain.
|
|
+ }
|
|
}
|
|
|
|
return levelchunk;
|
|
@@ -712,6 +_,7 @@
|
|
|
|
this.f_140133_.m_46473_().m_6174_("chunkSave");
|
|
CompoundTag compoundtag = ChunkSerializer.m_63454_(this.f_140133_, p_140259_);
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Save(p_140259_, p_140259_.getWorldForge() != null ? p_140259_.getWorldForge() : this.f_140133_, compoundtag));
|
|
this.m_63502_(chunkpos, compoundtag);
|
|
this.m_140229_(chunkpos, chunkstatus.m_62494_());
|
|
return true;
|
|
@@ -768,6 +_,7 @@
|
|
|
|
protected void m_183754_(ServerPlayer p_183755_, ChunkPos p_183756_, MutableObject<ClientboundLevelChunkWithLightPacket> p_183757_, boolean p_183758_, boolean p_183759_) {
|
|
if (p_183755_.f_19853_ == this.f_140133_) {
|
|
+ net.minecraftforge.event.ForgeEventFactory.fireChunkWatch(p_183758_, p_183759_, p_183755_, p_183756_, this.f_140133_);
|
|
if (p_183759_ && !p_183758_) {
|
|
ChunkHolder chunkholder = this.m_140327_(p_183756_.m_45588_());
|
|
if (chunkholder != null) {
|
|
@@ -1020,7 +_,7 @@
|
|
}
|
|
|
|
protected void m_140199_(Entity p_140200_) {
|
|
- if (!(p_140200_ instanceof EnderDragonPart)) {
|
|
+ if (!(p_140200_ instanceof net.minecraftforge.entity.PartEntity)) {
|
|
EntityType<?> entitytype = p_140200_.m_6095_();
|
|
int i = entitytype.m_20681_() * 16;
|
|
if (i != 0) {
|