Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

  • Author

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

  • Author

Well, if I set the Max, min UV to 0 and 1, the particle turns into the entire MC atlas, right. So, using the minU, and minV values, and using the full size of Minecraft's texture atlas, I will be able to set the appropriate UV percentage values for my particle.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.