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

Hello,

Im currently working on a mod for minecraft 1.10.2 and I want to add my own particle effects. I have already created the particles and I got them into the game as well, but I cant seem to get my custom texture to work. When I place down the block ingame, that displays the particles, they only show up in the purple and black square texture you always get when your missing a texture. I need some help to get the texture displayed correctly.

 

Here is my class for the Particles:

package com.xpmodder.xpadditions.particle;

import com.xpmodder.xpadditions.utility.LogHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;

import java.util.Random;

public class LargeStarParticle extends Particle {

    public final ResourceLocation largeStarRL = new ResourceLocation("xpadditions:entity/largeStarParticle");

    public LargeStarParticle(World worldIn, double x, double y, double z, double velocityX, double velocityY, double velocityZ){

        super(worldIn, x, y, z, velocityX, velocityY, velocityZ);

        this.particleAlpha = 0.99F;

        TextureAtlasSprite sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(largeStarRL.toString());
        setParticleTexture(sprite);
        LogHelper.info(largeStarRL.toString());
        LogHelper.info(sprite);

    }

    @Override
    public int getFXLayer() {

        return 1;

    }

    @Override
    public int getBrightnessForRender(float partialTick) {

        return 0xf000f0;

    }

    @Override
    public boolean isTransparent() {

        return false;

    }

    @Override
    public void onUpdate(){

        Random ran = new Random();
        int num = ran.nextInt(20);

        if (particleScale > 2){
            particleScale = 1;
        }

        switch(num){

            case 1:
                particleScale = particleScale * (float)1.1;
                break;

            case 4:
                particleScale = particleScale * (float)1.2;
                break;

            case 8:
                particleScale = particleScale * (float)0.9;
                break;

            case 12:
                particleScale = particleScale * (float)0.8;
                break;

            case 16:
                particleScale = 1;
                break;

        }

        if (this.particleMaxAge-- <= 0) {
            this.setExpired();
        }

    }

}

 

Inside the assets/xpadditions/textures/entity folder of my project I have the texture file largeStarParticle.png. The size of the texture is 32x32 pixel and I tried using a 16x16 pixel texture file with the same name. Neither of those textures works for me.

Folder Structure.png

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.