Class ConeEffect
java.lang.Object
me.emafire003.dev.particleanimationlib.Effect
me.emafire003.dev.particleanimationlib.effects.base.YPREffect
me.emafire003.dev.particleanimationlib.effects.ConeEffect
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConeEffectbuilder static inner class. -
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleRadials per iteration to spawn the next particle (PI / 16)booleanDo you want to draw the center axis as well?booleanDraws a point (one particle) where the effect endsbooleanFlips the cone from the origin to the center of the predicted ending positionbooleanInverts the cone making it start from the last position and go all the way to the origin.floatGrowing per iteration in the length (0.05)intCone-particles per interation (10)intConesize in particles per conefloatGrowth in blocks per iteration on the radius (0.006)booleanRandomize every cone on creation (false)doubleStart-angle or rotation of the conenet.minecraft.particle.ParticleEffectThe particles to use for displaying the center axis/finish point Falls back to the particle of this effectbooleanSolid coneprotected intCurrent step.intAmount of strandsFields inherited from class me.emafire003.dev.particleanimationlib.effects.base.YPREffect
pitch, pitchOffset, roll, rollOffset, shouldUpdateYPR, yaw, yawOffsetFields inherited from class me.emafire003.dev.particleanimationlib.Effect
delay, done, entityOrigin, executeOnStop, forced, iterations, limitParticlesEveryNIterations, originOffset, originPos, particle, particleLimit, shouldLimitParticlesEveryNIterations, shouldLimitParticlesSpawnedPerIteration, shouldSpawnParticlesEveryNIteration, spawnParticlesEveryNIteration, ticks, type, updatePositions, useEyePosAsOrigin, world -
Constructor Summary
ConstructorsConstructorDescriptionConeEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin) Creates a new cone effectConeEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch) Creates a new cone effectConeEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particleConeSize, int particlesPerIteration, int strands_number, float lengthGrow, float radiusGrow, double angularVel, double startRotation, boolean solid, boolean random) Creates a new cone effect -
Method Summary
Modifier and TypeMethodDescriptionstatic ConeEffect.Builderbuilder(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos) Returns a builder for the effect.static voidcopy(ConeEffect original, ConeEffect copy) doublefloatintintnet.minecraft.util.math.Vec3dReturns the position of the center of the cone at it maximum pointfloatdoublenet.minecraft.particle.ParticleEffectintbooleanbooleanbooleanbooleanbooleanbooleanisSolid()protected voidonRun()Main method to extend, here the animation code is run EACH tickvoidsetAngularVelocity(double angularVelocity) voidsetDrawCenterAxis(boolean drawCenterAxis) voidsetDrawFinishPoint(boolean drawFinishPoint) voidsetFlipped(boolean flipped) voidsetInverted(boolean inverted) voidsetLengthGrow(float lengthGrow) voidsetParticles(int particles) voidsetParticlesCone(int particlesCone) voidsetRadiusGrow(float radiusGrow) voidsetRandomize(boolean randomize) voidsetRotation(double rotation) voidsetSecondaryParticle(net.minecraft.particle.ParticleEffect secondaryParticle) voidsetSolid(boolean solid) voidsetStrands(int strands) Methods inherited from class me.emafire003.dev.particleanimationlib.effects.base.YPREffect
copy, getDirection, getPitch, getPitchOffset, getRoll, getRollOffset, getShouldUpdateYPR, getYaw, getYawOffset, setPitch, setPitchOffset, setRoll, setRollOffset, setShouldUpdateYPR, setYaw, setYawOffset, updatePosMethods inherited from class me.emafire003.dev.particleanimationlib.Effect
copy, displayParticle, displayParticle, displayParticle, getDelay, getEntityOrigin, getExecuteOnStop, getIterations, getLimitParticlesEveryNIterations, getOriginOffset, getOriginPos, getParticle, getParticleLimit, getSpawnParticlesEveryNIteration, getType, getWorld, getWorldRegistryKey, isForced, isUpdatePositions, isUseEyePosAsOrigin, onStop, run, run, runFor, runFor, setDelay, setEntityOrigin, setExecuteOnStop, setForced, setIterations, setLimitParticlesEveryNIterations, setOriginOffset, setOriginPos, setParticle, setParticleLimit, setShouldLimitParticlesEveryNIterations, setShouldLimitParticlesSpawnedPerIteration, setShouldSpawnParticlesEveryNIteration, setSpawnParticlesEveryNIteration, setUpdatePositions, setUseEyePosAsOrigin, setWorld, shouldLimitParticlesEveryNIterations, shouldLimitParticlesSpawnedPerIteration, shouldSpawnParticlesEveryNIteration
-
Field Details
-
lengthGrow
public float lengthGrowGrowing per iteration in the length (0.05) -
angularVelocity
public double angularVelocityRadials per iteration to spawn the next particle (PI / 16) -
particles
public int particlesCone-particles per interation (10) -
radiusGrow
public float radiusGrowGrowth in blocks per iteration on the radius (0.006) -
particlesCone
public int particlesConeConesize in particles per cone -
rotation
public double rotationStart-angle or rotation of the cone -
randomize
public boolean randomizeRandomize every cone on creation (false) -
solid
public boolean solidSolid cone -
strands
public int strandsAmount of strands -
flipped
public boolean flippedFlips the cone from the origin to the center of the predicted ending positionExperimental! May not work as intended
-
inverted
public boolean invertedInverts the cone making it start from the last position and go all the way to the origin. Not to be cofused with flipped -
drawCenterAxis
public boolean drawCenterAxisDo you want to draw the center axis as well? -
drawFinishPoint
public boolean drawFinishPointDraws a point (one particle) where the effect ends -
secondaryParticle
public net.minecraft.particle.ParticleEffect secondaryParticleThe particles to use for displaying the center axis/finish point Falls back to the particle of this effect -
step
protected int stepCurrent step. Works as counter
-
-
Constructor Details
-
ConeEffect
public ConeEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particleConeSize, int particlesPerIteration, int strands_number, float lengthGrow, float radiusGrow, double angularVel, double startRotation, boolean solid, boolean random) Creates a new cone effect- Parameters:
world- The world the particles are going to spawn inparticle- The particle effect that is going to be spawned. You can useParticleTypesorigin- The origin position of the effect, aka the starting point of the coneyaw- The yaw of the effect. For example, you can get it from an Entity using getYaw()pitch- The pitch of the effect. For example, you can get it from an Entity using getPitch()particleConeSize- By how many particles should the cone be made ofparticlesPerIteration- How many particles to display per iterationstrands_number- The number of the strandslengthGrow- Length growth amount per each iterationradiusGrow- Radius growth amount per each iterationangularVel- The angular velocity of the effect expressed in radials per iteration, to spawn the next particlestartRotation- The starting rotation angle of the conesolid- Should the cone be solid?random- Makes the initial rotation of the cone random
-
ConeEffect
public ConeEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch) Creates a new cone effect- Parameters:
world- The world the particles are going to spawn inparticle- The particle effect that is going to be spawned. You can useParticleTypesorigin- The origin position of the effect, aka the starting point of the coneyaw- The yaw of the effect. For example, you can get it from an Entity using getYaw()pitch- The pitch of the effect. For example, you can get it from an Entity using getPitch()
-
ConeEffect
public ConeEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin) Creates a new cone effect- Parameters:
world- The world the particles are going to spawn inparticle- The particle effect that is going to be spawned. You can useParticleTypesorigin- The origin position of the effect, aka the starting point of the cone
-
-
Method Details
-
copy
-
builder
public static ConeEffect.Builder builder(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos) Returns a builder for the effect.- Parameters:
world- The world the particles are going to spawn inparticle- The particle effect that is going to be spawned. You can useParticleTypesoriginPos- The origin position of the effectSetting a world, a particle effect and an origin position is ALWAYS mandatory, hence their presence in this method! If this is an effect that uses Yaw and Pitch, remember to set those as well!
-
getPredictedMaxCenterPosition
public net.minecraft.util.math.Vec3d getPredictedMaxCenterPosition()Returns the position of the center of the cone at it maximum pointExperimental! May not work as intended if run for more or less than 10 seconds!
-
onRun
protected void onRun()Description copied from class:EffectMain method to extend, here the animation code is run EACH tick -
getLengthGrow
public float getLengthGrow() -
setLengthGrow
public void setLengthGrow(float lengthGrow) -
getAngularVelocity
public double getAngularVelocity() -
setAngularVelocity
public void setAngularVelocity(double angularVelocity) -
getParticles
public int getParticles() -
setParticles
public void setParticles(int particles) -
getRadiusGrow
public float getRadiusGrow() -
setRadiusGrow
public void setRadiusGrow(float radiusGrow) -
getParticlesCone
public int getParticlesCone() -
setParticlesCone
public void setParticlesCone(int particlesCone) -
getRotation
public double getRotation() -
setRotation
public void setRotation(double rotation) -
isRandomize
public boolean isRandomize() -
setRandomize
public void setRandomize(boolean randomize) -
isSolid
public boolean isSolid() -
setSolid
public void setSolid(boolean solid) -
getStrands
public int getStrands() -
setStrands
public void setStrands(int strands) -
isFlipped
public boolean isFlipped() -
setFlipped
public void setFlipped(boolean flipped) -
isInverted
public boolean isInverted() -
setInverted
public void setInverted(boolean inverted) -
isDrawCenterAxis
public boolean isDrawCenterAxis() -
setDrawCenterAxis
public void setDrawCenterAxis(boolean drawCenterAxis) -
getSecondaryParticle
public net.minecraft.particle.ParticleEffect getSecondaryParticle() -
setSecondaryParticle
public void setSecondaryParticle(net.minecraft.particle.ParticleEffect secondaryParticle) -
isDrawFinishPoint
public boolean isDrawFinishPoint() -
setDrawFinishPoint
public void setDrawFinishPoint(boolean drawFinishPoint)
-