Class BlackAndWhiteImageEffect


public class BlackAndWhiteImageEffect extends BaseImageEffect
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?) ...
  • Field Details

    • invert

      public boolean invert
      Invert 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 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. You can also use new Identifier(modid, resource).getPath(). 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)
      invert - Inverts the image color
  • Method Details

    • copy

      public static void copy(BlackAndWhiteImageEffect original, BlackAndWhiteImageEffect 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 in
      originPos - The origin position of the effect

      Setting 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 use new 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 in
      originPos - The origin position of the effect

      Setting 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: BaseImageEffect
      This method is to be overridden by extending classes such as ColoredImageEffect
      Specified by:
      display in class BaseImageEffect
    • isInvert

      public boolean isInvert()
    • setInvert

      public void setInvert(boolean invert)