Search in sources :

Example 1 with LoadChunkEvent

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

the class SpongeForgeEventFactory method createChunkLoadEvent.

public static ChunkEvent.Load createChunkLoadEvent(Event event) {
    LoadChunkEvent spongeEvent = (LoadChunkEvent) event;
    ChunkEvent.Load forgeEvent = new ChunkEvent.Load(((net.minecraft.world.chunk.Chunk) spongeEvent.getTargetChunk()));
    return forgeEvent;
}
Also used : LoadChunkEvent(org.spongepowered.api.event.world.chunk.LoadChunkEvent) 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)

Example 2 with LoadChunkEvent

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

the class SpongeForgeEventFactory method callChunkLoadEvent.

private static LoadChunkEvent callChunkLoadEvent(Event event) {
    LoadChunkEvent spongeEvent = (LoadChunkEvent) event;
    final net.minecraft.world.chunk.Chunk chunk = (net.minecraft.world.chunk.Chunk) spongeEvent.getTargetChunk();
    ((IMixinEventBus) MinecraftForge.EVENT_BUS).post(new ChunkEvent.Load(chunk), true);
    return spongeEvent;
}
Also used : LoadChunkEvent(org.spongepowered.api.event.world.chunk.LoadChunkEvent) 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)

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