Direct Known Subclasses:
BlackAndWhiteImageEffect, ColoredImageEffect

public abstract class BaseImageEffect extends YPREffect
  • Field Details

    • fileName

      public String fileName
      For configuration-driven files
    • transparency

      public boolean transparency
      Whether or not to check for transparent pixels
    • frameDelay

      public int frameDelay
      How many ticks to show each frame
    • stepX

      public int stepX
      Each stepX pixel will be shown. Saves packets for high resolutions.
    • stepY

      public int stepY
      Each stepY pixel will be shown. Saves packets for high resolutions.
    • scale

      public float scale
      Scale the image down
    • particleSize

      public float particleSize
      How big should the dust particles be?
    • enableRotation

      public boolean enableRotation
      Should it rotate?
    • rotation

      public net.minecraft.util.math.Vec3d rotation
      Apply a fixed rotation
    • orient

      public boolean orient
      Orients the image to the specified Yaw Pitch, for example facing a player
    • plane

      public BaseImageEffect.Plane plane
      What plane should it rotate?
    • angularVelocityX

      public double angularVelocityX
      Turns the image by this angle each iteration around the x-axis
    • angularVelocityY

      public double angularVelocityY
      Turns the image by this angle each iteration around the y-axis
    • angularVelocityZ

      public double angularVelocityZ
      Turns the image by this angle each iteration around the z-axis
    • images

      protected BufferedImage[] images
      Image as BufferedImage
    • step

      protected int step
      Step counter
    • rotationStepCounter

      protected int rotationStepCounter
      Rotation step counter
    • stepDelay

      protected int stepDelay
      Delay between steps
    • imageLoadCallback

      protected ImageLoadCallback 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. Use ColoredImageEffect or BlackAndWhiteImageEffect
      Parameters:
      world - The world the particles are going to spawn in
      origin - The origin position of the effect, aka the starting point of the cone
      yaw - 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, gif
      transparency - If true transparent pixels will be transparent, otherwise they will be black.
      frameDelay - How many ticks to show each frame for
      stepX - How many pixel should be skipped on the X? Aka show only one pixel every *n* on the X plane
      stepY - How many pixel should be skipped on the Y? Aka show only one pixel every *n* on the Y plane
      scale - Scale factor for the image
      particleSize - How big should each individual Dust particle be? See also DustParticleEffect
      rotation - Apply a fixed rotation (independent of enableRotation)
      orient - Should the image orient towards yaw and pitch? For example orient to the player's facing direction
      enableRotation - 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

      public static void copy(BaseImageEffect original, BaseImageEffect copy)
    • load

      public void load(String 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
    • 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

      public void loadFile(File file)
    • onRun

      public void onRun()
      Description copied from class: Effect
      Main method to extend, here the animation code is run EACH tick
      Overrides:
      onRun in class Effect
    • getFileName

      public String getFileName()
    • setFileName

      public void setFileName(String fileName)
    • 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

      public BaseImageEffect.Plane getPlane()
    • setPlane

      public void setPlane(BaseImageEffect.Plane plane)
    • 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 as ColoredImageEffect