Search in sources :

Example 1 with ExplosionEvent

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

the class SpongeForgeEventFactory method createExplosionEvent.

// Explosion events
public static net.minecraftforge.event.world.ExplosionEvent createExplosionEvent(Event event) {
    ExplosionEvent spongeEvent = (ExplosionEvent) event;
    Optional<World> world = spongeEvent.getCause().first(World.class);
    if (!world.isPresent()) {
        return null;
    }
    net.minecraft.world.World forgeWorld = (net.minecraft.world.World) world.get();
    Explosion explosion = (Explosion) spongeEvent.getExplosion();
    net.minecraftforge.event.world.ExplosionEvent forgeEvent = new net.minecraftforge.event.world.ExplosionEvent(forgeWorld, explosion);
    return forgeEvent;
}
Also used : Explosion(net.minecraft.world.Explosion) ExplosionEvent(org.spongepowered.api.event.world.ExplosionEvent) World(org.spongepowered.api.world.World) IMixinWorld(org.spongepowered.common.interfaces.world.IMixinWorld)

Aggregations

Explosion (net.minecraft.world.Explosion)1 ExplosionEvent (org.spongepowered.api.event.world.ExplosionEvent)1 World (org.spongepowered.api.world.World)1 IMixinWorld (org.spongepowered.common.interfaces.world.IMixinWorld)1