Class VortexEffect
java.lang.Object
me.emafire003.dev.particleanimationlib.Effect
me.emafire003.dev.particleanimationlib.effects.base.YPREffect
me.emafire003.dev.particleanimationlib.effects.VortexEffect
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classVortexEffectbuilder static inner class. -
Field Summary
FieldsModifier and TypeFieldDescriptionintHelix-circles per iteration (3) (Also impacts on the length of the effect)booleanFlips the staring and ending position of the vortexintAmount of helices (4) Yay for the typobooleanInverts the direction of the effect, making the particles appear from the max radius and end at the originfloatGrowing per iteration (0.05)doubleRadials per iteration (PI / 16)floatRadius of vortex (2)floatRadius grow per iteration (0.00)floatInitial range of the vortex (0.0)protected intCurrent step.Fields 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
ConstructorsConstructorDescriptionVortexEffect(@NotNull net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch) Creates a new Vortex effectVortexEffect(@NotNull net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch, float radius, float radiusGrow, float startRange, float lengthGrow, double radials_per_iteration, int circles, int helixes) Creates a new Vortex effectVortexEffect(@NotNull net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch, float radius, float lengthGrow, int circles, int helixes) Creates a new Vortex effect -
Method Summary
Modifier and TypeMethodDescriptionstatic VortexEffect.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(VortexEffect original, VortexEffect copy) intintfloatnet.minecraft.util.math.Vec3dReturns the predicted finish center position of the vortex, can be used to invert the vortexdoublefloatfloatfloatbooleanbooleanprotected voidonRun()Main method to extend, here the animation code is run EACH tickvoidsetCircles(int circles) voidsetFlipped(boolean flipped) voidsetHelixes(int helixes) voidsetInverted(boolean inverted) voidsetLengthGrow(float lengthGrow) voidsetRadials(double radials) voidsetRadius(float radius) voidsetRadiusGrow(float radiusGrow) voidsetStartRange(float startRange) 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
-
radius
public float radiusRadius of vortex (2) -
radiusGrow
public float radiusGrowRadius grow per iteration (0.00) -
startRange
public float startRangeInitial range of the vortex (0.0) -
lengthGrow
public float lengthGrowGrowing per iteration (0.05) -
radials
public double radialsRadials per iteration (PI / 16) -
circles
public int circlesHelix-circles per iteration (3) (Also impacts on the length of the effect) -
helixes
public int helixesAmount of helices (4) Yay for the typo -
flipped
public boolean flippedFlips the staring and ending position of the vortex -
inverted
public boolean invertedInverts the direction of the effect, making the particles appear from the max radius and end at the origin -
step
protected int stepCurrent step. Works as counter
-
-
Constructor Details
-
VortexEffect
public VortexEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch, float radius, float radiusGrow, float startRange, float lengthGrow, double radials_per_iteration, int circles, int helixes) Creates a new Vortex 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 effectyaw- 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()radius- The base radius of the vortexradiusGrow- How much should the radius grow each iteration, aka each tick? TIP: Set it to a fairly low numberstartRange- The initial range of the vortexlengthGrow- The distance the vortex grows each tickradials_per_iteration- Radials per iterationcircles- The number of circles per iterationhelixes- The number of helixes or helices whatever per iteration
-
VortexEffect
public VortexEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch, float radius, float lengthGrow, int circles, int helixes) Creates a new Vortex 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 effectyaw- 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()radius- The base radius of the vortexlengthGrow- The distance the vortex grows each tickcircles- The number of circles per iterationhelixes- The number of helixes or helices whatever per iteration
-
VortexEffect
public VortexEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch) Creates a new Vortex 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 effectyaw- 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()
-
-
Method Details
-
builder
public static VortexEffect.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 predicted finish center position of the vortex, can be used to invert the vortex -
onRun
protected void onRun()Description copied from class:EffectMain method to extend, here the animation code is run EACH tick -
getRadius
public float getRadius() -
setRadius
public void setRadius(float radius) -
getRadiusGrow
public float getRadiusGrow() -
copy
-
setRadiusGrow
public void setRadiusGrow(float radiusGrow) -
getStartRange
public float getStartRange() -
setStartRange
public void setStartRange(float startRange) -
getLengthGrow
public float getLengthGrow() -
setLengthGrow
public void setLengthGrow(float lengthGrow) -
getRadials
public double getRadials() -
setRadials
public void setRadials(double radials) -
getCircles
public int getCircles() -
setCircles
public void setCircles(int circles) -
getHelixes
public int getHelixes() -
setHelixes
public void setHelixes(int helixes) -
isFlipped
public boolean isFlipped() -
setFlipped
public void setFlipped(boolean flipped) -
isInverted
public boolean isInverted() -
setInverted
public void setInverted(boolean inverted)
-