Separated assets in 3 parts-Condensed rendering code
This commit is contained in:
parent
cd01a41ae1
commit
7cf77cdad0
257 changed files with 536 additions and 1648 deletions
|
|
@ -4,10 +4,7 @@ import mysticworld.blocks.BlockHandler;
|
|||
import mysticworld.blocks.BlockPillarInsert;
|
||||
import mysticworld.client.fx.LightCubeFX;
|
||||
import mysticworld.client.fx.PowerAirFX;
|
||||
import mysticworld.client.fx.PowerEarthFX;
|
||||
import mysticworld.client.fx.PowerEnergyFX;
|
||||
import mysticworld.client.fx.PowerFireFX;
|
||||
import mysticworld.client.fx.PowerWaterFX;
|
||||
import mysticworld.client.fx.PowerFX;
|
||||
import mysticworld.entity.EntityChargeAir;
|
||||
import mysticworld.entity.EntityChargeEarth;
|
||||
import mysticworld.entity.EntityChargeEnergy;
|
||||
|
|
@ -36,25 +33,25 @@ public class ClientProxy extends CommonProxy {
|
|||
//particles
|
||||
@Override
|
||||
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) {
|
||||
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
|
||||
PowerFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
|
||||
mc.effectRenderer.addEffect(airFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void earthFX(World worldObj, double x, double y, double z, float scale) {
|
||||
PowerEarthFX earthFX = new PowerEarthFX(worldObj, x, y, z, scale);
|
||||
PowerFX earthFX = new PowerFX(worldObj, x, y, z, scale).setTexture("earth");
|
||||
mc.effectRenderer.addEffect(earthFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void energyFX(World worldObj, double x, double y, double z, float scale) {
|
||||
PowerEnergyFX energyFX = new PowerEnergyFX(worldObj, x, y, z, scale);
|
||||
PowerFX energyFX = new PowerFX(worldObj, x, y, z, scale).setTexture("energy");
|
||||
mc.effectRenderer.addEffect(energyFX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireFX(World worldObj, double x, double y, double z, float scale) {
|
||||
PowerFireFX fireFX = new PowerFireFX(worldObj, x, y, z, scale);
|
||||
PowerFX fireFX = new PowerFX(worldObj, x, y, z, scale).setTexture("fire");
|
||||
mc.effectRenderer.addEffect(fireFX);
|
||||
}
|
||||
|
||||
|
|
@ -68,16 +65,16 @@ public class ClientProxy extends CommonProxy {
|
|||
public void registerRenders() {
|
||||
BlockPillarInsert.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
|
||||
MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff.itemID, new ItemStaffFireRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff.itemID, new ItemStaffEarthRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff.itemID, new ItemStaffAirRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff.itemID, new ItemStaffEnergyRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff.itemID, new ItemStaffWaterRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb.itemID, new ItemOrbFireRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb.itemID, new ItemOrbEarthRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb.itemID, new ItemOrbAirRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb.itemID, new ItemOrbEnergyRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb.itemID, new ItemOrbWaterRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff.itemID, new StaffItemRenderer("Fire"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff.itemID, new StaffItemRenderer("Earth"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff.itemID, new StaffItemRenderer("Air"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff.itemID, new StaffItemRenderer("Energy"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff.itemID, new StaffItemRenderer("Water"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb.itemID, new OrbItemRenderer("Fire"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb.itemID, new OrbItemRenderer("Earth"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb.itemID, new OrbItemRenderer("Air"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb.itemID, new OrbItemRenderer("Energy"));
|
||||
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb.itemID, new OrbItemRenderer("Water"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2));
|
||||
|
|
@ -88,7 +85,7 @@ public class ClientProxy extends CommonProxy {
|
|||
|
||||
@Override
|
||||
public void waterFX(World worldObj, double x, double y, double z, float scale) {
|
||||
PowerWaterFX waterFX = new PowerWaterFX(worldObj, x, y, z, scale);
|
||||
PowerFX waterFX = new PowerFX(worldObj, x, y, z, scale).setTexture("water");
|
||||
mc.effectRenderer.addEffect(waterFX);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,15 @@
|
|||
package mysticworld.client.fx;
|
||||
|
||||
import mysticworld.client.ClientProxy;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class LightCubeFX extends EntityFX {
|
||||
public static final ResourceLocation lightFX = new ResourceLocation("mysticmods", "textures/misc/lightCubeFX.png");
|
||||
|
||||
public class LightCubeFX extends PowerFX {
|
||||
public LightCubeFX(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
this.setTexture("lightCube");
|
||||
}
|
||||
|
||||
public LightCubeFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
|
||||
super(world, x, y, z);
|
||||
this(world, x, y, z);
|
||||
this.motionX *= 0.10000000149011612D;
|
||||
this.motionY *= 0.10000000149011612D;
|
||||
this.motionZ *= 0.10000000149011612D;
|
||||
|
|
@ -32,55 +23,4 @@ public class LightCubeFX extends EntityFX {
|
|||
this.noClip = true;
|
||||
this.particleMaxAge = rand.nextInt(25);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
this.setDead();
|
||||
}
|
||||
this.motionY += 0.004D;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
if (this.posY == this.prevPosY) {
|
||||
this.motionX *= 1.1D;
|
||||
this.motionZ *= 1.1D;
|
||||
}
|
||||
this.motionX *= 0.9599999785423279D;
|
||||
this.motionY *= 0.9599999785423279D;
|
||||
this.motionZ *= 0.9599999785423279D;
|
||||
if (this.onGround) {
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
tessellator.draw();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 1);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(lightFX);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
float scale = 0.1F * this.particleScale;
|
||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(240);
|
||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(3042);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,16 @@
|
|||
package mysticworld.client.fx;
|
||||
|
||||
import mysticworld.client.ClientProxy;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class PowerAirFX extends EntityFX {
|
||||
public static final ResourceLocation airFX = new ResourceLocation("mysticmods", "textures/misc/airFX.png");
|
||||
|
||||
public class PowerAirFX extends PowerFX {
|
||||
public PowerAirFX(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
this.setTexture("air");
|
||||
}
|
||||
|
||||
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw) {
|
||||
super(world, x, y, z);
|
||||
this(world, x, y, z);
|
||||
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
|
||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
|
|
@ -34,7 +25,7 @@ public class PowerAirFX extends EntityFX {
|
|||
}
|
||||
|
||||
public PowerAirFX(World world, double x, double y, double z, float scale, int age) {
|
||||
super(world, x, y, z);
|
||||
this(world, x, y, z);
|
||||
this.motionX += motionX;
|
||||
this.motionY += motionY;
|
||||
this.motionZ += motionZ;
|
||||
|
|
@ -51,56 +42,10 @@ public class PowerAirFX extends EntityFX {
|
|||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
this.setDead();
|
||||
}
|
||||
this.motionY += 0.004D;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
if (this.posY == this.prevPosY) {
|
||||
this.motionX *= 1.1D;
|
||||
this.motionZ *= 1.1D;
|
||||
}
|
||||
this.motionX *= 0.9599999785423279D;
|
||||
this.motionY *= 0.9599999785423279D;
|
||||
this.motionZ *= 0.9599999785423279D;
|
||||
if (this.onGround) {
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
super.onUpdate();
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
tessellator.draw();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 1);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(airFX);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
float scale = 0.1F * this.particleScale;
|
||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(240);
|
||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(3042);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package mysticworld.client.fx;
|
||||
|
||||
import mysticworld.client.ClientProxy;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class PowerEarthFX extends EntityFX {
|
||||
public static final ResourceLocation earthFX = new ResourceLocation("mysticmods", "textures/misc/earthFX.png");
|
||||
|
||||
public PowerEarthFX(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public PowerEarthFX(World world, double x, double y, double z, float scale) {
|
||||
super(world, x, y, z);
|
||||
this.motionX *= 0.019999999552965164D;
|
||||
this.motionY *= 0.019999999552965164D;
|
||||
this.motionZ *= 0.019999999552965164D;
|
||||
this.motionX += motionX;
|
||||
this.motionY += motionY;
|
||||
this.motionZ += motionZ;
|
||||
this.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
this.particleBlue = 1.0F;
|
||||
this.particleScale = scale;
|
||||
this.noClip = true;
|
||||
this.particleMaxAge = 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
this.setDead();
|
||||
}
|
||||
this.motionY += 0.004D;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
if (this.posY == this.prevPosY) {
|
||||
this.motionX *= 1.1D;
|
||||
this.motionZ *= 1.1D;
|
||||
}
|
||||
this.motionX *= 0.9599999785423279D;
|
||||
this.motionY *= 0.9599999785423279D;
|
||||
this.motionZ *= 0.9599999785423279D;
|
||||
if (this.onGround) {
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
tessellator.draw();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 1);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(earthFX);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
float scale = 0.1F * this.particleScale;
|
||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(240);
|
||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(3042);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package mysticworld.client.fx;
|
||||
|
||||
import mysticworld.client.ClientProxy;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class PowerEnergyFX extends EntityFX {
|
||||
public static final ResourceLocation energyFX = new ResourceLocation("mysticmods", "textures/misc/energyFX.png");
|
||||
|
||||
public PowerEnergyFX(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public PowerEnergyFX(World world, double x, double y, double z, float scale) {
|
||||
super(world, x, y, z);
|
||||
this.motionX *= 0.019999999552965164D;
|
||||
this.motionY *= 0.019999999552965164D;
|
||||
this.motionZ *= 0.019999999552965164D;
|
||||
this.motionX += motionX;
|
||||
this.motionY += motionY;
|
||||
this.motionZ += motionZ;
|
||||
this.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
this.particleBlue = 1.0F;
|
||||
this.particleScale = scale;
|
||||
this.noClip = true;
|
||||
this.particleMaxAge = 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
this.setDead();
|
||||
}
|
||||
this.motionY += 0.004D;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
if (this.posY == this.prevPosY) {
|
||||
this.motionX *= 1.1D;
|
||||
this.motionZ *= 1.1D;
|
||||
}
|
||||
this.motionX *= 0.9599999785423279D;
|
||||
this.motionY *= 0.9599999785423279D;
|
||||
this.motionZ *= 0.9599999785423279D;
|
||||
if (this.onGround) {
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
tessellator.draw();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 1);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(energyFX);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
float scale = 0.1F * this.particleScale;
|
||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(240);
|
||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(3042);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package mysticworld.client.fx;
|
||||
|
||||
import mysticworld.client.ClientProxy;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class PowerFireFX extends EntityFX {
|
||||
public static final ResourceLocation fireFX = new ResourceLocation("mysticmods", "textures/misc/fireFX.png");
|
||||
|
||||
public PowerFireFX(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public PowerFireFX(World world, double x, double y, double z, float scale) {
|
||||
super(world, x, y, z);
|
||||
this.motionX *= 0.019999999552965164D;
|
||||
this.motionY *= 0.019999999552965164D;
|
||||
this.motionZ *= 0.019999999552965164D;
|
||||
this.motionX += motionX;
|
||||
this.motionY += motionY;
|
||||
this.motionZ += motionZ;
|
||||
this.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
this.particleBlue = 1.0F;
|
||||
this.particleScale = scale;
|
||||
this.noClip = true;
|
||||
this.particleMaxAge = 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
this.setDead();
|
||||
}
|
||||
this.motionY += 0.004D;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
if (this.posY == this.prevPosY) {
|
||||
this.motionX *= 1.1D;
|
||||
this.motionZ *= 1.1D;
|
||||
}
|
||||
this.motionX *= 0.9599999785423279D;
|
||||
this.motionY *= 0.9599999785423279D;
|
||||
this.motionZ *= 0.9599999785423279D;
|
||||
if (this.onGround) {
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
tessellator.draw();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 1);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(fireFX);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
float scale = 0.1F * this.particleScale;
|
||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(240);
|
||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(3042);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package mysticworld.client.fx;
|
||||
|
||||
import mysticworld.client.ClientProxy;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class PowerWaterFX extends EntityFX {
|
||||
public static final ResourceLocation waterFX = new ResourceLocation("mysticmods", "textures/misc/waterFX.png");
|
||||
|
||||
public PowerWaterFX(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public PowerWaterFX(World world, double x, double y, double z, float scale) {
|
||||
super(world, x, y, z);
|
||||
this.motionX *= 0.019999999552965164D;
|
||||
this.motionY *= 0.019999999552965164D;
|
||||
this.motionZ *= 0.019999999552965164D;
|
||||
this.motionX += motionX;
|
||||
this.motionY += motionY;
|
||||
this.motionZ += motionZ;
|
||||
this.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
this.particleBlue = 1.0F;
|
||||
this.particleScale = scale;
|
||||
this.noClip = true;
|
||||
this.particleMaxAge = 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
this.setDead();
|
||||
}
|
||||
this.motionY += 0.004D;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
if (this.posY == this.prevPosY) {
|
||||
this.motionX *= 1.1D;
|
||||
this.motionZ *= 1.1D;
|
||||
}
|
||||
this.motionX *= 0.9599999785423279D;
|
||||
this.motionY *= 0.9599999785423279D;
|
||||
this.motionZ *= 0.9599999785423279D;
|
||||
if (this.onGround) {
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
tessellator.draw();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 1);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(waterFX);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
float scale = 0.1F * this.particleScale;
|
||||
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(240);
|
||||
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
|
||||
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
|
||||
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(3042);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue