Class ExpandExplosion
java.lang.Object
com.blamejared.crafttweaker.natives.world.ExpandExplosion
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearToBlow(net.minecraft.world.level.Explosion internal) Clears the affected block positions of this Explosion.static voidexplode(net.minecraft.world.level.Explosion internal) Performs the first part of the explosion which is destroying the blocks.static voidfinalizeExplosion(net.minecraft.world.level.Explosion internal, boolean spawnParticles) Performs the second part of the explosion which is the sound, drops and if enabled the particles.static net.minecraft.world.damagesource.DamageSourcegetDamageSource(net.minecraft.world.level.Explosion internal) Gets the damage source of this Explosion.static Map<net.minecraft.world.entity.player.Player, net.minecraft.world.phys.Vec3> getHitPlayers(net.minecraft.world.level.Explosion internal) Gets the player knockback map for this Explosion.static net.minecraft.world.entity.LivingEntitygetIndirectSourceEntity(net.minecraft.world.level.Explosion internal) Gets the LivingEntity that caused this Explosion.static List<net.minecraft.core.BlockPos> getToBlow(net.minecraft.world.level.Explosion internal)
-
Constructor Details
-
ExpandExplosion
public ExpandExplosion()
-
-
Method Details
-
explode
public static void explode(net.minecraft.world.level.Explosion internal) Performs the first part of the explosion which is destroying the blocks. -
finalizeExplosion
public static void finalizeExplosion(net.minecraft.world.level.Explosion internal, boolean spawnParticles) Performs the second part of the explosion which is the sound, drops and if enabled the particles.- Parameters:
spawnParticles- Should particles be spawned.- DocParam:
- spawnParticles true
-
getDamageSource
public static net.minecraft.world.damagesource.DamageSource getDamageSource(net.minecraft.world.level.Explosion internal) Gets the damage source of this Explosion.- Returns:
- The damage source of this Explosion.
-
getHitPlayers
public static Map<net.minecraft.world.entity.player.Player,net.minecraft.world.phys.Vec3> getHitPlayers(net.minecraft.world.level.Explosion internal) Gets the player knockback map for this Explosion. This map is only populated inExplosion.explode()so calling it before will return nothing. This map is used to calculate the vectors that players around the explosion will be pushed back by.- Returns:
- A Map of PlayerEntity to Vector3d depicting knockback vectors.
-
getIndirectSourceEntity
public static net.minecraft.world.entity.LivingEntity getIndirectSourceEntity(net.minecraft.world.level.Explosion internal) Gets the LivingEntity that caused this Explosion. For example: If the Explosion was caused by TNT, it will return the PlayerEntity that placed it. If the Explosion was caused by a Creeper or another Entity directly, it will return that Entity. If the Explosion was caused by a Ghast fireball, it will return the Ghast. If no Entity caused this Explosion (for example, if the Explosion was caused by TNT in a Desert Temple that generated in the world), then `null` is returned. You may need to cast the returned LivingEntity to not be nullable.- Returns:
- The LivingEntity that caused this Explosion. `null` if no LivingEntity caused it.
-
clearToBlow
public static void clearToBlow(net.minecraft.world.level.Explosion internal) Clears the affected block positions of this Explosion. -
getToBlow
public static List<net.minecraft.core.BlockPos> getToBlow(net.minecraft.world.level.Explosion internal)
-