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;
}
Aggregations