Class LineEffect
java.lang.Object
me.emafire003.dev.particleanimationlib.Effect
me.emafire003.dev.particleanimationlib.effects.base.TargetedEffect
me.emafire003.dev.particleanimationlib.effects.base.TargetedYPREffect
me.emafire003.dev.particleanimationlib.effects.LineEffect
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classLineEffectbuilder static inner class. -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanShould it do a zig zag?doubleLength of arc A non-zero value here will use a length instead of the target endpointdoubleMax length of arc A non-zero value here will use this as the upper bound for the computed lengthintParticles per arcprotected intInternal counterprotected booleanInternal booleannet.minecraft.util.math.Vec3dDirection of zig-zagsnet.minecraft.util.math.Vec3dRelative direction of zig-zagsintNumber of zig zags in the lineFields inherited from class me.emafire003.dev.particleanimationlib.effects.base.TargetedYPREffect
pitch, pitchOffset, roll, rollOffset, shouldUpdateYPR, yaw, yawOffsetFields inherited from class me.emafire003.dev.particleanimationlib.effects.base.TargetedEffect
entityTarget, targetOffset, targetPos, updateTargetPositions, useEyePosAsTargetFields 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
ConstructorsConstructorDescriptionLineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles, double length) Creates a new line effect.LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles, double length, boolean isZigZag, int numberOfZigZags, net.minecraft.util.math.Vec3d zigZagOffset, net.minecraft.util.math.Vec3d zigZagRelativeOffset) Creates a new line effect.LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles, double length, boolean isZigZag, int numberOfZigZags, net.minecraft.util.math.Vec3d zigZagOffset, net.minecraft.util.math.Vec3d zigZagRelativeOffset, Effect effectAtEnd) Creates a new line effect.LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, net.minecraft.util.math.Vec3d target, int particles) Creates a new line effect.LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, net.minecraft.util.math.Vec3d target, int particles, int maxLength, boolean isZigZag, int numberOfZigZags, net.minecraft.util.math.Vec3d zigZagOffset, net.minecraft.util.math.Vec3d zigZagRelativeOffset) Creates a new line effect. -
Method Summary
Modifier and TypeMethodDescriptionstatic LineEffect.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(LineEffect original, LineEffect copy) doubledoubleintnet.minecraft.util.math.Vec3dnet.minecraft.util.math.Vec3dintbooleanisZigZag()voidonRun()Main method to extend, here the animation code is run EACH tickvoidsetLength(double length) voidsetMaxLength(double maxLength) voidsetParticles(int particles) voidsetSubEffectAtEnd(Effect subEffectAtEnd) voidsetZigZag(boolean zigZag) voidsetZigZagOffset(net.minecraft.util.math.Vec3d zigZagOffset) voidsetZigZagRelativeOffset(net.minecraft.util.math.Vec3d zigZagRelativeOffset) voidsetZigZags(int zigZags) Methods inherited from class me.emafire003.dev.particleanimationlib.effects.base.TargetedYPREffect
copy, getDirection, getPitch, getPitchOffset, getRoll, getRollOffset, getShouldUpdateYPR, getYaw, getYawOffset, setPitch, setPitchOffset, setRoll, setRollOffset, setShouldUpdateYPR, setYaw, setYawOffset, updatePosMethods inherited from class me.emafire003.dev.particleanimationlib.effects.base.TargetedEffect
copy, getEntityTarget, getTargetOffset, getTargetPos, isUpdateTargetPositions, isUseEyePosAsTarget, setEntityTarget, setTargetOffset, setTargetPos, setUpdateTargetPositions, setUseEyePosAsTarget, shouldUpdateTargetPositionsMethods 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
-
isZigZag
public boolean isZigZagShould it do a zig zag? -
zigZags
public int zigZagsNumber of zig zags in the line -
zigZagOffset
public net.minecraft.util.math.Vec3d zigZagOffsetDirection of zig-zags -
zigZagRelativeOffset
public net.minecraft.util.math.Vec3d zigZagRelativeOffsetRelative direction of zig-zags -
particles
public int particlesParticles per arc -
length
public double lengthLength of arc A non-zero value here will use a length instead of the target endpoint -
maxLength
public double maxLengthMax length of arc A non-zero value here will use this as the upper bound for the computed length -
zag
protected boolean zagInternal boolean -
step
protected int stepInternal counter
-
-
Constructor Details
-
LineEffect
public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles, double length, boolean isZigZag, int numberOfZigZags, net.minecraft.util.math.Vec3d zigZagOffset, net.minecraft.util.math.Vec3d zigZagRelativeOffset, Effect effectAtEnd) Creates a new line 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 lineyaw- 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()particles- The number of particles that make up the linelength- The length of the lineisZigZag- Should the line ZigZagnumberOfZigZags- The number of zig zags that the line will dozigZagOffset- An offset for the zigZagzigZagRelativeOffset- A relative offsets for the zigzagseffectAtEnd- Another Effect that will be spawned at the ending position of the line (its originPos will be set to the end of the line)
-
LineEffect
public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles, double length, boolean isZigZag, int numberOfZigZags, net.minecraft.util.math.Vec3d zigZagOffset, net.minecraft.util.math.Vec3d zigZagRelativeOffset) Creates a new line 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 lineyaw- 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()particles- The number of particles that make up the linelength- The length of the lineisZigZag- Should the line ZigZagnumberOfZigZags- The number of zig zags that the line will dozigZagOffset- An offset for the zigZagzigZagRelativeOffset- A relative offsets for the zigzags
-
LineEffect
public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles, double length) Creates a new line 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 lineyaw- 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()particles- The number of particles that make up the linelength- The length of the line
-
LineEffect
public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, net.minecraft.util.math.Vec3d target, int particles, int maxLength, boolean isZigZag, int numberOfZigZags, net.minecraft.util.math.Vec3d zigZagOffset, net.minecraft.util.math.Vec3d zigZagRelativeOffset) Creates a new line 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 linetarget- The ending position of the lineparticles- The number of particles that make up the linemaxLength- The Max length of the line arcs. Setting to 0 will remove the limitisZigZag- Should the line ZigZagnumberOfZigZags- The number of zig zags that the line will dozigZagOffset- An offset for the zigZagzigZagRelativeOffset- A relative offsets for the zigzags
-
LineEffect
public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, net.minecraft.util.math.Vec3d target, int particles) Creates a new line 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 linetarget- The ending position of the lineparticles- The number of particles that make up the line
-
-
Method Details
-
copy
-
builder
public static LineEffect.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!
-
onRun
public void onRun()Description copied from class:EffectMain method to extend, here the animation code is run EACH tick -
isZigZag
public boolean isZigZag() -
setZigZag
public void setZigZag(boolean zigZag) -
getZigZags
public int getZigZags() -
setZigZags
public void setZigZags(int zigZags) -
getZigZagOffset
public net.minecraft.util.math.Vec3d getZigZagOffset() -
setZigZagOffset
public void setZigZagOffset(net.minecraft.util.math.Vec3d zigZagOffset) -
getZigZagRelativeOffset
public net.minecraft.util.math.Vec3d getZigZagRelativeOffset() -
setZigZagRelativeOffset
public void setZigZagRelativeOffset(net.minecraft.util.math.Vec3d zigZagRelativeOffset) -
getParticles
public int getParticles() -
setParticles
public void setParticles(int particles) -
getLength
public double getLength() -
setLength
public void setLength(double length) -
getMaxLength
public double getMaxLength() -
setMaxLength
public void setMaxLength(double maxLength) -
getSubEffectAtEnd
-
setSubEffectAtEnd
-