Search in sources :

Example 1 with UnloadChunkEvent

use of org.spongepowered.api.event.world.chunk.UnloadChunkEvent in project SpongeForge by SpongePowered.

the class SpongeForgeEventFactory method callChunkUnloadEvent.

private static UnloadChunkEvent callChunkUnloadEvent(Event event) {
    UnloadChunkEvent spongeEvent = (UnloadChunkEvent) event;
    final net.minecraft.world.chunk.Chunk chunk = (net.minecraft.world.chunk.Chunk) spongeEvent.getTargetChunk();
    ((IMixinEventBus) MinecraftForge.EVENT_BUS).post(new ChunkEvent.Unload(chunk), true);
    return spongeEvent;
}
Also used : IMixinEventBus(org.spongepowered.mod.interfaces.IMixinEventBus) ChunkEvent(net.minecraftforge.event.world.ChunkEvent) TargetChunkEvent(org.spongepowered.api.event.world.chunk.TargetChunkEvent) LoadChunkEvent(org.spongepowered.api.event.world.chunk.LoadChunkEvent) UnloadChunkEvent(org.spongepowered.api.event.world.chunk.UnloadChunkEvent) PopulateChunkEvent(net.minecraftforge.event.terraingen.PopulateChunkEvent) Chunk(org.spongepowered.api.world.Chunk) UnloadChunkEvent(org.spongepowered.api.event.world.chunk.UnloadChunkEvent)

Example 2 with UnloadChunkEvent

use of org.spongepowered.api.event.world.chunk.UnloadChunkEvent in project SpongeForge by SpongePowered.

the class SpongeForgeEventFactory method createChunkUnloadEvent.

public static ChunkEvent.Unload createChunkUnloadEvent(Event event) {
    UnloadChunkEvent spongeEvent = (UnloadChunkEvent) event;
    ChunkEvent.Unload forgeEvent = new ChunkEvent.Unload(((net.minecraft.world.chunk.Chunk) spongeEvent.getTargetChunk()));
    return forgeEvent;
}
Also used : ChunkEvent(net.minecraftforge.event.world.ChunkEvent) TargetChunkEvent(org.spongepowered.api.event.world.chunk.TargetChunkEvent) LoadChunkEvent(org.spongepowered.api.event.world.chunk.LoadChunkEvent) UnloadChunkEvent(org.spongepowered.api.event.world.chunk.UnloadChunkEvent) PopulateChunkEvent(net.minecraftforge.event.terraingen.PopulateChunkEvent) Chunk(org.spongepowered.api.world.Chunk) UnloadChunkEvent(org.spongepowered.api.event.world.chunk.UnloadChunkEvent)

Aggregations

PopulateChunkEvent (net.minecraftforge.event.terraingen.PopulateChunkEvent)2 ChunkEvent (net.minecraftforge.event.world.ChunkEvent)2 LoadChunkEvent (org.spongepowered.api.event.world.chunk.LoadChunkEvent)2 TargetChunkEvent (org.spongepowered.api.event.world.chunk.TargetChunkEvent)2 UnloadChunkEvent (org.spongepowered.api.event.world.chunk.UnloadChunkEvent)2 Chunk (org.spongepowered.api.world.Chunk)2 IMixinEventBus (org.spongepowered.mod.interfaces.IMixinEventBus)1