Backport misapplied patches
This commit is contained in:
parent
621c949931
commit
aa3e2a53ee
@ -273,7 +273,6 @@ public abstract class ExplosionMixin implements ExplosionBridge {
|
||||
}
|
||||
|
||||
blockstate.onBlockExploded(this.level, blockpos, (Explosion) (Object) this);
|
||||
block.wasExploded(this.level, blockpos, (Explosion) (Object) this);
|
||||
this.level.getProfiler().pop();
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@ public abstract class ArclightEventDispatcherRegistry {
|
||||
MinecraftForge.EVENT_BUS.register(new EntityTeleportEventDispatcher());
|
||||
MinecraftForge.EVENT_BUS.register(new ItemEntityEventDispatcher());
|
||||
MinecraftForge.EVENT_BUS.register(new WorldEventDispatcher());
|
||||
MinecraftForge.EVENT_BUS.register(new ChunkEventHandler());
|
||||
ArclightMod.LOGGER.info("registry.forge-event");
|
||||
}
|
||||
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
package io.izzel.arclight.common.mod.server.event;
|
||||
|
||||
import io.izzel.arclight.common.bridge.core.world.chunk.ChunkBridge;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraftforge.event.world.ChunkDataEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import org.bukkit.craftbukkit.v.persistence.CraftPersistentDataContainer;
|
||||
|
||||
public class ChunkEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onChunkLoad(ChunkDataEvent.Load event) {
|
||||
if (event.getStatus() == ChunkStatus.ChunkType.LEVELCHUNK) {
|
||||
ChunkAccess chunk = event.getChunk();
|
||||
CompoundTag nbt = event.getData();
|
||||
Tag values = nbt.get("ChunkBukkitValues");
|
||||
if (values instanceof CompoundTag) {
|
||||
((ChunkBridge) chunk).bridge$getPersistentContainer().putAll((CompoundTag) values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onChunkSave(ChunkDataEvent.Save event) {
|
||||
ChunkAccess chunk = event.getChunk();
|
||||
if (chunk instanceof ChunkBridge) {
|
||||
CraftPersistentDataContainer container = ((ChunkBridge) chunk).bridge$getPersistentContainer();
|
||||
if (!container.isEmpty()) {
|
||||
event.getData().put("ChunkBukkitValues", container.toTagCompound());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user