ExplosionUtils

public class ExplosionUtils

Class ExplosionUtils. Provides explosionutils functionality for the Hytale server.

java.lang.Object > ExplosionUtils

Field Summary

targetRefs

final Set> targetRefs

Field targetRefs.

blockPosition

final Vector3d blockPosition

Field blockPosition.

random

final ThreadLocalRandom random

Field random.

world

final World world

Field world.

potentialTargets

final List> potentialTargets

Field potentialTargets.

range

final double range

Field range.

obj

final List> obj

Field obj.

itemTool

final ItemTool itemTool

Field itemTool.

targetBlocks

final Set targetBlocks

Field targetBlocks.

posX

final int posX

Field posX.

posY

final int posY

Field posY.

posZ

final int posZ

Field posZ.

avoidBlocks

final Set avoidBlocks

Field avoidBlocks.

targetBlockPosition

final Vector3d targetBlockPosition

Field targetBlockPosition.

distance

final double distance

Field distance.

direction

final Vector3d direction

Field direction.

targetBlockPos

final Vector3i targetBlockPos

Field targetBlockPos.

entityHitPos

final Vector3d entityHitPos

Field entityHitPos.

targetBlockPosD

final Vector3d targetBlockPosD

Field targetBlockPosD.

damageDistance

final float damageDistance

Field damageDistance.

damageScale

final float damageScale

Field damageScale.

chunkIndex

final long chunkIndex

Field chunkIndex.

chunkReference

final Ref chunkReference

Field chunkReference.

canDamageBlock

final boolean canDamageBlock

Field canDamageBlock.

blockType

final BlockType blockType

Field blockType.

gathering

final BlockGathering gathering

Field gathering.

boundingBoxComponent

final BoundingBox boundingBoxComponent

Field boundingBoxComponent.

transformComponent

final TransformComponent transformComponent

Field transformComponent.

entityPosition

final Vector3d entityPosition

Field entityPosition.

boundingBox

final Box boundingBox

Field boundingBox.

normalizedDistance

final float normalizedDistance

Field normalizedDistance.

entityDamageRadius

final float entityDamageRadius

Field entityDamageRadius.

explosionDamage

final float explosionDamage

Field explosionDamage.

explosionFalloff

final float explosionFalloff

Field explosionFalloff.

targetTransformComponent

final TransformComponent targetTransformComponent

Field targetTransformComponent.

targetVelocityComponent

final Velocity targetVelocityComponent

Field targetVelocityComponent.

targetPosition

final Vector3d targetPosition

Field targetPosition.

diff

final Vector3d diff

Field diff.

damage

final float damage

Field damage.

knockbackConfig

final Knockback knockbackConfig

Field knockbackConfig.

Method Detail

performExplosion

static void performExplosion (@Nonnull final Damage.Source damageSource, @Nonnull final Vector3d position, @Nonnull final ExplosionConfig config, @Nullable final Ref ignoreRef, @Nonnull final CommandBuffer commandBuffer, @Nonnull final ComponentAccessor chunkStore)

Method performExplosion.

Parameters:
@Nonnull final Damage.Source damageSource
@Nonnull final Vector3d position
@Nonnull final ExplosionConfig config
@Nullable final Ref ignoreRef
@Nonnull final CommandBuffer commandBuffer
@Nonnull final ComponentAccessor chunkStore

Vector3d

public new Vector3d (Math.floor(position.x)

Method Vector3d.

Parameters:
Math.floor(position.x Math.floor(position.x

processTargetBlocks

static void processTargetBlocks (@Nonnull final Vector3d position, @Nonnull final ExplosionConfig config, @Nullable final Ref ignoreRef, @Nonnull final Set> targetRefs, @Nonnull final CommandBuffer commandBuffer, @Nonnull final ComponentAccessor chunkStore)

Method processTargetBlocks.

Parameters:
@Nonnull final Vector3d position
@Nonnull final ExplosionConfig config
@Nullable final Ref ignoreRef
@Nonnull final Set> targetRefs
@Nonnull final CommandBuffer commandBuffer
@Nonnull final ComponentAccessor chunkStore

Vector3i

public new Vector3i (x, y, z)

Method Vector3i.

Parameters:
x x
y y
z z

isValidTargetBlock

public > isValidTargetBlock (id, config.damageBlocks)

Method isValidTargetBlock.

Parameters:
id id
config.damageBlocks config.damageBlocks

collectPotentialTargets

static void collectPotentialTargets (@Nonnull final Set> targetRefs, @Nonnull final List> potentialTargetRefs, @Nonnull final Vector3d startPosition, @Nonnull final Vector3d endPosition, @Nonnull final CommandBuffer commandBuffer)

Method collectPotentialTargets.

Parameters:
@Nonnull final Set> targetRefs
@Nonnull final List> potentialTargetRefs
@Nonnull final Vector3d startPosition
@Nonnull final Vector3d endPosition
@Nonnull final CommandBuffer commandBuffer

processPotentialEntity

static boolean processPotentialEntity (@Nonnull final Ref ref, @Nonnull final Vector3d startPosition, @Nonnull final Vector3d endPosition, @Nonnull final CommandBuffer commandBuffer)

Method processPotentialEntity.

Parameters:
@Nonnull final Ref ref
@Nonnull final Vector3d startPosition
@Nonnull final Vector3d endPosition
@Nonnull final CommandBuffer commandBuffer

calculateBlockDamageScale

static float calculateBlockDamageScale (final float distance, final float radius, final float fallOff)

Method calculateBlockDamageScale.

Parameters:
final float distance
final float radius
final float fallOff

processTargetEntities

static void processTargetEntities (@Nonnull final ExplosionConfig config, @Nonnull final Vector3d position, @Nonnull final Damage.Source damageSource, @Nullable final Ref ignoreRef, @Nonnull final Set> targetRefs, @Nonnull final CommandBuffer commandBuffer)

Method processTargetEntities.

Parameters:
@Nonnull final ExplosionConfig config
@Nonnull final Vector3d position
@Nonnull final Damage.Source damageSource
@Nullable final Ref ignoreRef
@Nonnull final Set> targetRefs
@Nonnull final CommandBuffer commandBuffer

processTargetEntity

static void processTargetEntity (@Nonnull final ExplosionConfig config, @Nonnull final Ref targetRef, @Nonnull final Vector3d position, @Nonnull final Damage.Source damageSource, @Nonnull final CommandBuffer commandBuffer)

Method processTargetEntity.

Parameters:
@Nonnull final ExplosionConfig config
@Nonnull final Ref targetRef
@Nonnull final Vector3d position
@Nonnull final Damage.Source damageSource
@Nonnull final CommandBuffer commandBuffer

Damage

public new Damage (damageSource, DamageCause.ENVIRONMENT, damage)

Method Damage.

Parameters:
damageSource damageSource
DamageCause.ENVIRONMENT DamageCause.ENVIRONMENT
damage damage