The great particle refactoring part 2: Splitting and Streamlining!
- Splits all particle textures into individual files intead of sprite sheets - Replaces arc and lightning pulse entities with particles - Pulls particle code up to the general ParticleWizardry so behaviours such as spin can be applied to all particle types - Renames a few ParticleBuilder methods for conciseness. - Adds a few new particle effects to various spells and entities, with a slight tweak to EntityMagicArrow#onBlockHit to facilitate impact effects
This commit is contained in:
@@ -1,40 +1,36 @@
|
||||
package electroblob.wizardry.client.particle;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ParticleIce extends ParticleCustomTexture {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID, "textures/particle/ice_particles.png");
|
||||
@Mod.EventBusSubscriber(Side.CLIENT)
|
||||
public class ParticleIce extends ParticleWizardry {
|
||||
|
||||
private static final ResourceLocation[] TEXTURES = generateTextures("ice", 8);
|
||||
|
||||
public ParticleIce(World world, double x, double y, double z){
|
||||
super(world, x, y, z);
|
||||
|
||||
this.setParticleTextureIndex(rand.nextInt(8));
|
||||
super(world, x, y, z, TEXTURES[world.rand.nextInt(TEXTURES.length)]);
|
||||
|
||||
this.canCollide = true;
|
||||
|
||||
// Defaults
|
||||
this.setRBGColorF(1, 1, 1);
|
||||
this.particleScale *= 0.75f;
|
||||
this.setGravity(true);
|
||||
this.shaded = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTexture(){
|
||||
return TEXTURE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getXFrames(){
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getYFrames(){
|
||||
return 4;
|
||||
@SubscribeEvent
|
||||
public static void onTextureStitchEvent(TextureStitchEvent.Pre event){
|
||||
for(ResourceLocation texture : TEXTURES){
|
||||
event.getMap().registerSprite(texture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user