Class ImageEffect
java.lang.Object
me.emafire003.dev.particleanimationlib.Effect
me.emafire003.dev.particleanimationlib.effects.base.YPREffect
me.emafire003.dev.particleanimationlib.effects.ImageEffect
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classImageEffectbuilder static inner class.static enum -
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleTurns the image by this angle each iteration around the x-axisdoubleTurns the image by this angle each iteration around the y-axisdoubleTurns the image by this angle each iteration around the z-axisbooleanWeather or not this should display as black and whitebooleanShould it rotate?static final StringFor configuration-driven filesintHow many ticks to show each frameprotected ImageLoadCallbackprotected BufferedImage[]Image as BufferedImagebooleanWeather or not the color of the image should be invertedbooleanOrients the image to the specified Yaw Pitch, for example facing a playerfloatHow big should the dust particles be?What plane should it rotate?net.minecraft.util.math.Vec3dApply a fixed rotationprotected intRotation step counterfloatScale the image downprotected intStep counterprotected intDelay between stepsintEach stepX pixel will be shown.intEach stepY pixel will be shown.booleanWhether or not to check for transparent pixelsFields 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
ConstructorsConstructorDescriptionImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, String fileName, boolean transparency, int frameDelay, int stepX, int stepY, float scale, float particleSize, net.minecraft.util.math.Vec3d rotation, boolean orient, boolean enableRotation, ImageEffect.Plane plane, double angularVelocityX, double angularVelocityY, double angularVelocityZ, boolean blackAndWhite, boolean invertColors) Creates a new ImageEffect. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageEffect.Builderbuilder(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, String fileName) Returns a builder for the effect.static ImageEffect.Builderbuilder(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image) Returns a builder for the effect.static voidcopy(ImageEffect original, ImageEffect copy) protected voiddisplay(BufferedImage image, net.minecraft.util.math.Vec3d v, net.minecraft.util.math.Vec3d pos, int pixel_color) This methods handles the display of the image into particle formdoubledoubledoubleintfloatgetPlane()net.minecraft.util.math.Vec3dfloatgetScale()intgetStepX()intgetStepY()booleanbooleanbooleanbooleanisOrient()booleanvoidAutomatically called when creating a new ImageEffect using a string path Can be used to update the image that is displayed.voidload(net.minecraft.util.Identifier fileName) Automatically called when creating a new ImageEffect using an Identifier path Can be used to update the image that is displayed.voidonRun()Main method to extend, here the animation code is run EACH tickvoidsetAngularVelocityX(double angularVelocityX) voidsetAngularVelocityY(double angularVelocityY) voidsetAngularVelocityZ(double angularVelocityZ) voidsetBlackAndWhite(boolean blackAndWhite) voidsetEnableRotation(boolean enableRotation) voidsetFileId(net.minecraft.util.Identifier fileId) It will also update the loaded image!voidsetFileName(String fileName) It will also update the loaded image!voidsetFrameDelay(int frameDelay) voidsetInvertColors(boolean invert_colors) voidsetOrient(boolean orient) voidsetParticleSize(float particleSize) voidsetPlane(ImageEffect.Plane plane) voidsetRotation(net.minecraft.util.math.Vec3d rotation) voidsetScale(float scale) voidsetStepX(int stepX) voidsetStepY(int stepY) voidsetTransparency(boolean transparency) 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
-
fileName
For configuration-driven files -
transparency
public boolean transparencyWhether or not to check for transparent pixels -
frameDelay
public int frameDelayHow many ticks to show each frame -
stepX
public int stepXEach stepX pixel will be shown. Saves packets for high resolutions. -
stepY
public int stepYEach stepY pixel will be shown. Saves packets for high resolutions. -
scale
public float scaleScale the image down -
particleSize
public float particleSizeHow big should the dust particles be? -
enableRotation
public boolean enableRotationShould it rotate? -
rotation
public net.minecraft.util.math.Vec3d rotationApply a fixed rotation -
orient
public boolean orientOrients the image to the specified Yaw Pitch, for example facing a player -
plane
What plane should it rotate? -
angularVelocityX
public double angularVelocityXTurns the image by this angle each iteration around the x-axis -
angularVelocityY
public double angularVelocityYTurns the image by this angle each iteration around the y-axis -
angularVelocityZ
public double angularVelocityZTurns the image by this angle each iteration around the z-axis -
blackAndWhite
public boolean blackAndWhiteWeather or not this should display as black and white -
invertColors
public boolean invertColorsWeather or not the color of the image should be inverted -
images
Image as BufferedImage -
step
protected int stepStep counter -
rotationStepCounter
protected int rotationStepCounterRotation step counter -
stepDelay
protected int stepDelayDelay between steps -
imageLoadCallback
-
ERROR_IMAGE
- See Also:
-
-
Constructor Details
-
ImageEffect
public ImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, String fileName, boolean transparency, int frameDelay, int stepX, int stepY, float scale, float particleSize, net.minecraft.util.math.Vec3d rotation, boolean orient, boolean enableRotation, ImageEffect.Plane plane, double angularVelocityX, double angularVelocityY, double angularVelocityZ, boolean blackAndWhite, boolean invertColors) Creates a new ImageEffect. By default, it is coloured, but you can set it to be black and white (which were the best gen pokèmon games btw)- Parameters:
world- The world the particles are going to spawn inorigin- 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()fileName- The path and the name of the file that you want to display. It can also be an URL. Supported formats include jpg, png, giftransparency- If true transparent pixels will be transparent, otherwise they will be black.frameDelay- How many ticks to show each frame forstepX- How many pixel should be skipped on the X? Aka show only one pixel every *n* on the X planestepY- How many pixel should be skipped on the Y? Aka show only one pixel every *n* on the Y planescale- Scale factor for the imageparticleSize- How big should each individual Dust particle be? See alsoDustParticleEffectrotation- Apply a fixed rotation (independent of enableRotation)orient- Should the image orient towards yaw and pitch? For example orient to the player's facing directionenableRotation- Should it rotate?plane- What plane should it rotate?angularVelocityX- Turns the image by this angle each iteration around the x-axis (radians)angularVelocityY- Turns the image by this angle each iteration around the y-axis (radians)angularVelocityZ- Turns the image by this angle each iteration around the z-axis (radians)blackAndWhite- Makes the image display in binary colors, black and whiteinvertColors- Inverts the color of the image, displaying its negative
-
-
Method Details
-
copy
-
builder
public static ImageEffect.Builder builder(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, String fileName) Returns a builder for the effect.- Parameters:
world- The world the particles are going to spawn inoriginPos- The origin position of the effectSetting a world, an image path 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!
fileName- The path and the name of the file that you want to display. It can also be an URL. * You can also usenew Identifier(modid, resource).getPath(). Supported formats include jpg, png, gif
-
builder
public static ImageEffect.Builder builder(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image) Returns a builder for the effect.- Parameters:
world- The world the particles are going to spawn inoriginPos- The origin position of the effectSetting a world, an image path 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!
image- An identifier representing the image that will be displayed. The image must be placed in the /data/ folder and not the /assets/ folder!
-
load
Automatically called when creating a new ImageEffect using a string path Can be used to update the image that is displayed. WARNING! Maye cause issues -
load
public void load(net.minecraft.util.Identifier fileName) Automatically called when creating a new ImageEffect using an Identifier path Can be used to update the image that is displayed. WARNING! Maye cause issues -
onRun
public void onRun()Description copied from class:EffectMain method to extend, here the animation code is run EACH tick -
getFileName
-
setFileName
It will also update the loaded image! -
setFileId
public void setFileId(net.minecraft.util.Identifier fileId) It will also update the loaded image! -
isTransparency
public boolean isTransparency() -
setTransparency
public void setTransparency(boolean transparency) -
getFrameDelay
public int getFrameDelay() -
setFrameDelay
public void setFrameDelay(int frameDelay) -
getStepX
public int getStepX() -
setStepX
public void setStepX(int stepX) -
getStepY
public int getStepY() -
setStepY
public void setStepY(int stepY) -
getScale
public float getScale() -
setScale
public void setScale(float scale) -
getParticleSize
public float getParticleSize() -
setParticleSize
public void setParticleSize(float particleSize) -
isEnableRotation
public boolean isEnableRotation() -
setEnableRotation
public void setEnableRotation(boolean enableRotation) -
getRotation
public net.minecraft.util.math.Vec3d getRotation() -
setRotation
public void setRotation(net.minecraft.util.math.Vec3d rotation) -
isOrient
public boolean isOrient() -
setOrient
public void setOrient(boolean orient) -
getPlane
-
setPlane
-
getAngularVelocityX
public double getAngularVelocityX() -
setAngularVelocityX
public void setAngularVelocityX(double angularVelocityX) -
getAngularVelocityY
public double getAngularVelocityY() -
setAngularVelocityY
public void setAngularVelocityY(double angularVelocityY) -
getAngularVelocityZ
public double getAngularVelocityZ() -
setAngularVelocityZ
public void setAngularVelocityZ(double angularVelocityZ) -
isBlackAndWhite
public boolean isBlackAndWhite() -
setBlackAndWhite
public void setBlackAndWhite(boolean blackAndWhite) -
isInvertColors
public boolean isInvertColors() -
setInvertColors
public void setInvertColors(boolean invert_colors) -
display
protected void display(BufferedImage image, net.minecraft.util.math.Vec3d v, net.minecraft.util.math.Vec3d pos, int pixel_color) This methods handles the display of the image into particle form
-