Posted December 23, 20177 yr 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!
December 23, 20177 yr 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 December 23, 20177 yr by MSpace-Dev Changed font
December 23, 20177 yr Author @diesieben07 Anyway I can get the size of the entire Minecraft atlas that is created at runtime? I need this value to work out the UV coords of my texture.
December 23, 20177 yr 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.
December 23, 20177 yr Author Yeah, I know that already. Hang on... An idea just popped into my head. Let me see if it'll work out.
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.