Class BlackAndWhiteImageEffect
java.lang.Object
me.emafire003.dev.particleanimationlib.Effect
me.emafire003.dev.particleanimationlib.effects.base.YPREffect
me.emafire003.dev.particleanimationlib.effects.image.BaseImageEffect
me.emafire003.dev.particleanimationlib.effects.image.BlackAndWhiteImageEffect
Render a monochrome image from an image file or animated gif.
Black pixels will be skipped, all other pixels display as the selected particle type.
Meaning the source image must be black and white. (I don't get it, can't you use a normal ColoredImage?)
...
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBlackAndWhiteImageEffectbuilder static inner class.Nested classes/interfaces inherited from class me.emafire003.dev.particleanimationlib.effects.image.BaseImageEffect
BaseImageEffect.Plane -
Field Summary
FieldsFields inherited from class me.emafire003.dev.particleanimationlib.effects.image.BaseImageEffect
angularVelocityX, angularVelocityY, angularVelocityZ, enableRotation, ERROR_IMAGE, fileName, frameDelay, imageLoadCallback, images, orient, particleSize, plane, rotation, rotationStepCounter, scale, step, stepDelay, stepX, stepY, transparencyFields 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
ConstructorsConstructorDescriptionBlackAndWhiteImageEffect(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, boolean invert) Creates a new Colored Image effectBlackAndWhiteImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, String image_fileName) BlackAndWhiteImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image) -
Method Summary
Modifier and TypeMethodDescriptionbuilder(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, String fileName) Returns a builder for the effect.builder(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(BlackAndWhiteImageEffect original, BlackAndWhiteImageEffect copy) protected voiddisplay(BufferedImage image, net.minecraft.util.math.Vec3d v, net.minecraft.util.math.Vec3d pos, int pixel_color) This method is to be overridden by extending classes such asColoredImageEffectbooleanisInvert()voidsetInvert(boolean invert) Methods inherited from class me.emafire003.dev.particleanimationlib.effects.image.BaseImageEffect
copy, getAngularVelocityX, getAngularVelocityY, getAngularVelocityZ, getFileName, getFrameDelay, getParticleSize, getPlane, getRotation, getScale, getStepX, getStepY, isEnableRotation, isOrient, isTransparency, load, load, loadFile, onRun, setAngularVelocityX, setAngularVelocityY, setAngularVelocityZ, setEnableRotation, setFileName, setFrameDelay, setOrient, setParticleSize, setPlane, setRotation, setScale, setStepX, setStepY, setTransparencyMethods 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
-
invert
public boolean invertInvert the image
-
-
Constructor Details
-
BlackAndWhiteImageEffect
public BlackAndWhiteImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, String image_fileName) -
BlackAndWhiteImageEffect
public BlackAndWhiteImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image) -
BlackAndWhiteImageEffect
public BlackAndWhiteImageEffect(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, boolean invert) Creates a new Colored Image effect- 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. You can also usenew Identifier(modid, resource).getPath(). 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)invert- Inverts the image color
-
-
Method Details
-
copy
-
builder
public static BlackAndWhiteImageEffect.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 BlackAndWhiteImageEffect.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!
-
display
protected void display(BufferedImage image, net.minecraft.util.math.Vec3d v, net.minecraft.util.math.Vec3d pos, int pixel_color) Description copied from class:BaseImageEffectThis method is to be overridden by extending classes such asColoredImageEffect- Specified by:
displayin classBaseImageEffect
-
isInvert
public boolean isInvert() -
setInvert
public void setInvert(boolean invert)
-