That's one heck of a commit you've got there...

I may have got a bit behind with version control. A lot behind, in fact. Maybe I'll go back and split this sometime - then again, I probably won't. But hey, at least it's here!
This commit is contained in:
Electroblob77
2019-08-18 00:04:18 +01:00
parent 2680d02304
commit f37812be3e
1564 changed files with 47652 additions and 12984 deletions
@@ -1,46 +1,36 @@
package electroblob.wizardry.client.particle;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.entity.Entity;
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)
//@SideOnly(Side.CLIENT)
@Mod.EventBusSubscriber(Side.CLIENT)
public class ParticleMagicFlame extends ParticleWizardry {
/** The scale of the flame particle */
private float flameScale;
// 4 different animation strips, 8 frames in each strip
private static final ResourceLocation[][] TEXTURES = generateTextures("flame", 4, 8);
public ParticleMagicFlame(World world, double x, double y, double z){
super(world, x, y, z);
this.flameScale = 1 + world.rand.nextFloat();
super(world, x, y, z, TEXTURES[world.rand.nextInt(TEXTURES.length)]);
this.setRBGColorF(1, 1, 1);
this.particleAlpha = 1;
this.particleMaxAge = (int)(2.0D / (Math.random() * 0.8D + 0.2D));
this.particleMaxAge = 12 + rand.nextInt(4);
this.shaded = false;
// IDEA: Make the particles for ray spells collide properly and not spawn on the other side of stuff.
this.canCollide = false;
this.setParticleTextureIndex(48);
this.canCollide = true;
}
@Override
public void renderParticle(BufferBuilder buffer, Entity entity, float partialTicks, float rotationX, float rotationZ,
float rotationYZ, float rotationXY, float rotationXZ){
float f6 = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge;
this.particleScale = this.flameScale * (1.0F - f6 * f6 * 0.5F);
super.renderParticle(buffer, entity, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
}
@Override
public int getBrightnessForRender(float par1){
return 256;
}
@Override
public Particle multipleParticleScaleBy(float scale){
this.flameScale *= scale;
return super.multipleParticleScaleBy(scale);
@SubscribeEvent
public static void onTextureStitchEvent(TextureStitchEvent.Pre event){
for(ResourceLocation[] array : TEXTURES){
for(ResourceLocation texture : array){
event.getMap().registerSprite(texture);
}
}
}
}