package com.yolp900.itsjustacharm.client.particles; import com.yolp900.itsjustacharm.reference.LibParticles; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class ParticleHandler { private static TextureMap map; @SubscribeEvent public void onTextureStitch(TextureStitchEvent event) { map = event.getMap(); for (ModParticles particle : ModParticles.values()) { particle.registerSprite(); } } public static void registerSprite(ResourceLocation texture) { map.registerSprite(texture); } public static ModParticle getParticle(LibParticles particle, World world, double x, double y, double z, double size, double red, double green, double blue) { for (ModParticles part : ModParticles.values()) { if (part.getParticle() == particle) { return part.getModParticle(world, x, y, z, size, red, green, blue); } } return null; } }