mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-27 20:58:40 +01:00
fabric-1.18: remove ChunkDataEvents.SAVE
This commit is contained in:
parent
32d618e99b
commit
261e3ddc00
@ -46,7 +46,6 @@ import org.dynmap.fabric_1_18.command.DmarkerCommand;
|
||||
import org.dynmap.fabric_1_18.command.DynmapCommand;
|
||||
import org.dynmap.fabric_1_18.command.DynmapExpCommand;
|
||||
import org.dynmap.fabric_1_18.event.BlockEvents;
|
||||
import org.dynmap.fabric_1_18.event.ChunkDataEvents;
|
||||
import org.dynmap.fabric_1_18.event.CustomServerLifecycleEvents;
|
||||
import org.dynmap.fabric_1_18.event.PlayerEvents;
|
||||
import org.dynmap.fabric_1_18.mixin.BiomeEffectsAccessor;
|
||||
|
@ -1,24 +0,0 @@
|
||||
package org.dynmap.fabric_1_18.event;
|
||||
|
||||
import net.fabricmc.fabric.api.event.Event;
|
||||
import net.fabricmc.fabric.api.event.EventFactory;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
public class ChunkDataEvents {
|
||||
private ChunkDataEvents() {
|
||||
}
|
||||
|
||||
public static Event<Save> SAVE = EventFactory.createArrayBacked(Save.class,
|
||||
(listeners) -> (world, chunk) -> {
|
||||
for (Save callback : listeners) {
|
||||
callback.onSave(world, chunk);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@FunctionalInterface
|
||||
public interface Save {
|
||||
void onSave(ServerWorld world, Chunk chunk);
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package org.dynmap.fabric_1_18.mixin;
|
||||
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.server.world.ThreadedAnvilChunkStorage;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import org.dynmap.fabric_1_18.event.ChunkDataEvents;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(ThreadedAnvilChunkStorage.class)
|
||||
public abstract class ThreadedAnvilChunkStorageMixin {
|
||||
@Shadow
|
||||
@Final
|
||||
private ServerWorld world;
|
||||
|
||||
@Inject(method = "save(Lnet/minecraft/world/chunk/Chunk;)Z", at = @At("RETURN"))
|
||||
private void save(Chunk chunk, CallbackInfoReturnable<Boolean> info) {
|
||||
if (info.getReturnValueZ()) {
|
||||
ChunkDataEvents.SAVE.invoker().onSave(this.world, chunk);
|
||||
}
|
||||
}
|
||||
}
|
@ -11,7 +11,6 @@
|
||||
"ServerPlayerEntityMixin",
|
||||
"ServerPlayNetworkHandlerMixin",
|
||||
"ThreadedAnvilChunkStorageAccessor",
|
||||
"ThreadedAnvilChunkStorageMixin",
|
||||
"WorldChunkMixin"
|
||||
],
|
||||
"injectors": {
|
||||
|
Loading…
Reference in New Issue
Block a user