Class BaseImageEffect
java.lang.Object
me.emafire003.dev.particleanimationlib.Effect
me.emafire003.dev.particleanimationlib.effects.base.YPREffect
me.emafire003.dev.particleanimationlib.effects.image.BaseImageEffect
- Direct Known Subclasses:
BlackAndWhiteImageEffect,ColoredImageEffect
-
Nested Class Summary
Nested Classes -
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-axisbooleanShould it rotate?static final net.minecraft.util.IdentifierFor configuration-driven filesintHow many ticks to show each frameprotected ImageLoadCallbackprotected BufferedImage[]Image as BufferedImagebooleanOrients 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, iterations, originOffset, originPos, particle, ticks, type, updatePositions, useEyePosAsOrigin, world -
Constructor Summary
ConstructorsConstructorDescriptionBaseImageEffect(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, BaseImageEffect.Plane plane, double angularVelocityX, double angularVelocityY, double angularVelocityZ) Creates a new base image effect.BaseImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, String image_fileName) BaseImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image) BaseImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image, String image_fileName) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopy(BaseImageEffect original, BaseImageEffect copy) protected abstract voiddisplay(BufferedImage image, net.minecraft.util.math.Vec3d v, net.minecraft.util.math.Vec3d location, int pixel) This method is to be overridden by extending classes such asColoredImageEffectdoubledoubledoubleintfloatgetPlane()net.minecraft.util.math.Vec3dfloatgetScale()intgetStepX()intgetStepY()booleanbooleanisOrient()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 a string path Can be used to update the image that is displayed.voidvoidonRun()Main method to extend, here the animation code is run EACH tickvoidsetAngularVelocityX(double angularVelocityX) voidsetAngularVelocityY(double angularVelocityY) voidsetAngularVelocityZ(double angularVelocityZ) voidsetEnableRotation(boolean enableRotation) voidsetFileName(String fileName) voidsetFrameDelay(int frameDelay) voidsetOrient(boolean orient) voidsetParticleSize(float particleSize) voidsetPlane(BaseImageEffect.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, getOriginOffset, getOriginPos, getParticle, getType, getWorld, getWorldRegistryKey, isUpdatePositions, isUseEyePosAsOrigin, onStop, run, run, runFor, runFor, setDelay, setEntityOrigin, setExecuteOnStop, setIterations, setOriginOffset, setOriginPos, setParticle, setUpdatePositions, setUseEyePosAsOrigin, setWorld
-
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 -
images
Image as BufferedImage -
step
protected int stepStep counter -
rotationStepCounter
protected int rotationStepCounterRotation step counter -
stepDelay
protected int stepDelayDelay between steps -
imageLoadCallback
-
ERROR_IMAGE
public static final net.minecraft.util.Identifier ERROR_IMAGE
-
-
Constructor Details
-
BaseImageEffect
public BaseImageEffect(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, BaseImageEffect.Plane plane, double angularVelocityX, double angularVelocityY, double angularVelocityZ) Creates a new base image effect. It won't do much on its own. UseColoredImageEffectorBlackAndWhiteImageEffect- 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)
-
BaseImageEffect
public BaseImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, String image_fileName) -
BaseImageEffect
public BaseImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image) -
BaseImageEffect
public BaseImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image, String image_fileName)
-
-
Method Details
-
copy
-
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 a string path Can be used to update the image that is displayed. WARNING! Maye cause issues -
loadFile
-
onRun
public void onRun()Description copied from class:EffectMain method to extend, here the animation code is run EACH tick -
getFileName
-
setFileName
-
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) -
display
protected abstract void display(BufferedImage image, net.minecraft.util.math.Vec3d v, net.minecraft.util.math.Vec3d location, int pixel) This method is to be overridden by extending classes such asColoredImageEffect
-