Search in sources :

Example 1 with IMixinExplosion

use of org.spongepowered.common.interfaces.world.IMixinExplosion in project SpongeCommon by SpongePowered.

the class SpongeExplosionBuilder method build.

@Override
public Explosion build() throws IllegalStateException {
    // TODO Check coordinates and if world is loaded here.
    checkState(this.location != null, "Location is null!");
    World world = this.location.getExtent();
    Vector3d origin = this.location.getPosition();
    final net.minecraft.world.Explosion explosion = new net.minecraft.world.Explosion((net.minecraft.world.World) world, (Entity) this.sourceExplosive, origin.getX(), origin.getY(), origin.getZ(), this.radius, this.canCauseFire, this.shouldSmoke);
    ((IMixinExplosion) explosion).setShouldBreakBlocks(this.shouldBreakBlocks);
    ((IMixinExplosion) explosion).setShouldDamageEntities(this.shouldDamageEntities);
    return (Explosion) explosion;
}
Also used : IMixinExplosion(org.spongepowered.common.interfaces.world.IMixinExplosion) Explosion(org.spongepowered.api.world.explosion.Explosion) IMixinExplosion(org.spongepowered.common.interfaces.world.IMixinExplosion) Vector3d(com.flowpowered.math.vector.Vector3d) World(org.spongepowered.api.world.World)

Aggregations

Vector3d (com.flowpowered.math.vector.Vector3d)1 World (org.spongepowered.api.world.World)1 Explosion (org.spongepowered.api.world.explosion.Explosion)1 IMixinExplosion (org.spongepowered.common.interfaces.world.IMixinExplosion)1