Jump to content

[1.11] Set UV values for a custom particle


MSpace-Dev

Recommended Posts

I have created a custom particle using textures from a 128x128 PNG file. Basically, exactly like Vanilla MC does. The reason I want to do this is because I don't want to register new particle textures for each particle I want to add.

 

So, all I want to do is set the UV that the particle uses for its texture.

 

public class ModParticle extends Particle {
    public ModParticle(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) {
        super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
        this.particleRed = 1;
        this.particleGreen = 1;
        this.particleBlue = 1;
        this.particleMaxAge = 100;
        this.setParticleTexture(RegistryEventHandler.textureAtlasSprite);
    }

    @Override
    public int getFXLayer() {
        return 1;
    }
}

 

Thanks!

Link to comment
Share on other sites

I have found buffer.tex(double u, double v), except when I call that method in renderParticle, nothing changes. I have looked through the Minecraft Particle classes to see if they've set UVs anywhere, couldn't find anything similar, heck, some of them don't even have a renderParticle method in them. So I'm guessing their UV is set somewhere else all together.

 

Can't find anything close to buffer.tex(u, v).

 

@Override
    public void renderParticle(VertexBuffer buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
	buffer.tex(8, 8);
        super.renderParticle(buffer, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
    }

 

Edited by MSpace-Dev
Changed font
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.