diff --git a/src/main/java/thecodex6824/thaumicaugmentation/client/event/RenderEventHandler.java b/src/main/java/thecodex6824/thaumicaugmentation/client/event/RenderEventHandler.java index 10cc6e94..782a58f1 100644 --- a/src/main/java/thecodex6824/thaumicaugmentation/client/event/RenderEventHandler.java +++ b/src/main/java/thecodex6824/thaumicaugmentation/client/event/RenderEventHandler.java @@ -328,7 +328,7 @@ private static void renderNormalBeam(Entity rv, float partial, Vec3d from, Vec3d GlStateManager.enableBlend(); GlStateManager.disableCull(); GlStateManager.pushMatrix(); - Minecraft.getMinecraft().renderEngine.bindTexture(TATextures.BEAM); + Minecraft.getMinecraft().renderEngine.bindTexture(TATextures.IMPETUS_BEAM_INACTIVE); Tessellator t = Tessellator.getInstance(); BufferBuilder buffer = t.getBuffer(); double angle = 0; @@ -364,7 +364,7 @@ private static void renderStrongLaser(Entity rv, float partial, Vec3d eyePos, Ve GlStateManager.enableBlend(); GlStateManager.disableCull(); GlStateManager.pushMatrix(); - Minecraft.getMinecraft().renderEngine.bindTexture(TATextures.LASER); + Minecraft.getMinecraft().renderEngine.bindTexture(TATextures.IMPETUS_BEAM_ACTIVE); Tessellator t = Tessellator.getInstance(); BufferBuilder buffer = t.getBuffer(); double angle = 0;//offset * Math.PI * 2; diff --git a/src/main/java/thecodex6824/thaumicaugmentation/client/fx/FXImpulseBeam.java b/src/main/java/thecodex6824/thaumicaugmentation/client/fx/FXImpulseBeam.java index 1277892d..86565995 100644 --- a/src/main/java/thecodex6824/thaumicaugmentation/client/fx/FXImpulseBeam.java +++ b/src/main/java/thecodex6824/thaumicaugmentation/client/fx/FXImpulseBeam.java @@ -35,18 +35,15 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -import thaumcraft.client.fx.ParticleEngine; import thecodex6824.thaumicaugmentation.ThaumicAugmentation; import thecodex6824.thaumicaugmentation.api.TAConfig; +import thecodex6824.thaumicaugmentation.client.renderer.texture.TATextures; public class FXImpulseBeam extends Particle { - protected static final ResourceLocation BEAM = new ResourceLocation("thaumcraft", "textures/misc/beam1.png"); - protected EntityLivingBase source; protected double offset; protected float length; @@ -71,261 +68,248 @@ public class FXImpulseBeam extends Particle { protected boolean posSet; protected Function alphaFunc; protected boolean endsLoop; - + public FXImpulseBeam(World world, EntityLivingBase entity, double tx, double ty, double tz, float r, float g, float b, int maxAge) { - super(world, entity.posX, entity.posY, entity.posZ, 0.0, 0.0, 0.0); - endMod = 1.0F; - pulse = true; - offset = (entity.height / 2.0F) + 0.25; - particleRed = r; - particleGreen = g; - particleBlue = b; - source = entity; - size = 1.0F; - setSize(0.02F, 0.02F); - tX = tx; - tY = ty; - tZ = tz; - tXPrev = tX; - tYPrev = tY; - tZPrev = tZ; - alphaFunc = obj -> 0.4F; - Vec3d pos = ThaumicAugmentation.proxy.getRenderHelper().estimateImpulseCannonFiringPoint(source, 1.0F); - posX = pos.x; - posY = pos.y; - posZ = pos.z; - double dx = posX - tX; - double dy = posY - tY; - double dz = posZ - tZ; - length = MathHelper.sqrt(dx * dx + dy * dy + dz * dz); - double y = MathHelper.sqrt(dx * dx + dz * dz); - rotYaw = (float) (Math.toDegrees(Math.atan2(dx, dz))); - rotPitch = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(dy, y))); - prevYaw = rotYaw; - prevPitch = rotPitch; - particleMaxAge = maxAge; + super(world, entity.posX, entity.posY, entity.posZ, 0.0, 0.0, 0.0); + endMod = 1.0F; + pulse = true; + offset = (entity.height / 2.0F) + 0.25; + particleRed = r; + particleGreen = g; + particleBlue = b; + source = entity; + size = 1.0F; + setSize(0.02F, 0.02F); + tX = tx; + tY = ty; + tZ = tz; + tXPrev = tX; + tYPrev = tY; + tZPrev = tZ; + alphaFunc = obj -> 0.4F; + Vec3d pos = ThaumicAugmentation.proxy.getRenderHelper().estimateImpulseCannonFiringPoint(source, 1.0F); + posX = pos.x; + posY = pos.y; + posZ = pos.z; + double dx = posX - tX; + double dy = posY - tY; + double dz = posZ - tZ; + length = MathHelper.sqrt(dx * dx + dy * dy + dz * dz); + double y = MathHelper.sqrt(dx * dx + dz * dz); + rotYaw = (float) (Math.toDegrees(Math.atan2(dx, dz))); + rotPitch = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(dy, y))); + prevYaw = rotYaw; + prevPitch = rotPitch; + particleMaxAge = maxAge; } - + public void setAlphaFunc(Function func) { - alphaFunc = func; + alphaFunc = func; } - + public Function getAlphaFunc() { - return alphaFunc; + return alphaFunc; } - + public void updateBeamTarget(double tx, double ty, double tz) { - tX = tx; - tY = ty; - tZ = tz; + tX = tx; + tY = ty; + tZ = tz; } - + @Override public void onUpdate() { - prevPosX = posX; - prevPosY = posY; - prevPosZ = posZ; - tXPrev = tX; - tYPrev = tY; - tZPrev = tZ; - prevYaw = rotYaw; - prevPitch = rotPitch; - - if (impact > 0) - --impact; - - if (particleAge++ >= particleMaxAge) - setExpired(); + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; + tXPrev = tX; + tYPrev = tY; + tZPrev = tZ; + prevYaw = rotYaw; + prevPitch = rotPitch; + + if (impact > 0) + --impact; + + if (particleAge++ >= particleMaxAge) + setExpired(); } - + public void setEndMod(float mod) { - endMod = mod; + endMod = mod; } - + public void setReverse(boolean rev) { - reverse = rev; + reverse = rev; } - + public void setPulse(boolean p) { - pulse = p; + pulse = p; } - + public void setRotationspeed(int speed) { - rotationSpeed = speed; + rotationSpeed = speed; } - + public void setFollowOwner(boolean f) { - follow = f; + follow = f; } - + public void setImpactTicks(int ticks) { - impact = ticks; + impact = ticks; } - + public void setSize(float newSize) { - size = newSize; + size = newSize; } - + public int getAge() { - return particleAge; + return particleAge; } - + public int getMaxAge() { - return particleMaxAge; + return particleMaxAge; } - + public void setEndsLoop(boolean loop) { - endsLoop = loop; + endsLoop = loop; } - + public void renderStartAndEnd(BufferBuilder buffer, float partialTicks, float f1, float f2, float f3, float f4, float f5) { - GlStateManager.pushMatrix(); - GlStateManager.depthMask(false); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE); - Minecraft.getMinecraft().renderEngine.bindTexture(ParticleEngine.particleTexture); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - - int maxParticles = TAConfig.reducedEffects.getValue() ? 2 : 3; - for (int i = 0; i < maxParticles; ++i) { - int part = endsLoop ? (particleAge + i * 2) % 16 : Math.min(particleAge + i * 2, 16); - float var8 = part / 16.0F; - float var9 = var8 + 0.0624375F; - float var10 = 0.8126875F; - float var11 = var10 + 0.0624375F; - float var12 = endMod / 2.0F; - float var13 = (float) (prevPosX + (posX - prevPosX) * partialTicks - interpPosX); - float var14 = (float) (prevPosY + (posY - prevPosY) * partialTicks - interpPosY); - float var15 = (float) (prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); - int j = 200 >> 16 & 0xFFFF; - int k = 200 & 0xFFFF; - float op = alphaFunc.apply(this); - buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); - buffer.pos((var13 - f1 * var12 - f4 * var12), (var14 - f2 * var12), (var15 - f3 * var12 - f5 * var12)).tex(var9, var11).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - buffer.pos((var13 - f1 * var12 + f4 * var12), (var14 + f2 * var12), (var15 - f3 * var12 + f5 * var12)).tex(var9, var10).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - buffer.pos((var13 + f1 * var12 + f4 * var12), (var14 + f2 * var12), (var15 + f3 * var12 + f5 * var12)).tex(var8, var10).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - buffer.pos((var13 + f1 * var12 - f4 * var12), (var14 - f2 * var12), (var15 + f3 * var12 - f5 * var12)).tex(var8, var11).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - Tessellator.getInstance().draw(); - } - - if (impact > 0) { - for (int i = 0; i < maxParticles; ++i) { - int part = endsLoop ? (particleAge + i * 2) % 16 : Math.min(particleAge + i * 2, 16); - float var8 = part / 16.0F; - float var9 = var8 + 0.0624375F; - float var10 = 0.8126875F; - float var11 = var10 + 0.0624375F; - float var12 = endMod / 2.0F; - float var13 = (float) (tXPrev + (tX - tXPrev) * partialTicks - interpPosX); - float var14 = (float) (tYPrev + (tY - tYPrev) * partialTicks - interpPosY); - float var15 = (float) (tZPrev + (tZ - tZPrev) * partialTicks - interpPosZ); - int j = 200 >> 16 & 0xFFFF; - int k = 200 & 0xFFFF; - float op = alphaFunc.apply(this); - buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); - buffer.pos((var13 - f1 * var12 - f4 * var12), (var14 - f2 * var12), (var15 - f3 * var12 - f5 * var12)).tex(var9, var11).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - buffer.pos((var13 - f1 * var12 + f4 * var12), (var14 + f2 * var12), (var15 - f3 * var12 + f5 * var12)).tex(var9, var10).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - buffer.pos((var13 + f1 * var12 + f4 * var12), (var14 + f2 * var12), (var15 + f3 * var12 + f5 * var12)).tex(var8, var10).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - buffer.pos((var13 + f1 * var12 - f4 * var12), (var14 - f2 * var12), (var15 + f3 * var12 - f5 * var12)).tex(var8, var11).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - Tessellator.getInstance().draw(); - } - } - - GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); - GlStateManager.disableBlend(); - GlStateManager.depthMask(true); - GlStateManager.popMatrix(); + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); + Minecraft.getMinecraft().renderEngine.bindTexture(TATextures.IMPULSE_CANNON_IMPACT); + int maxParticles = TAConfig.reducedEffects.getValue() ? 2 : 3; + for (int i = 0; i < maxParticles; ++i) { + int part = endsLoop ? (particleAge + i * 2) % 16 : Math.min(particleAge + i * 2, 16); + float var8 = part / 16.0F; + float var9 = var8 + 0.0625F; + float var10 = 0.0F; + float var11 = 1.0F; + float var12 = endMod / 4.0F; + float var13 = (float) (prevPosX + (posX - prevPosX) * partialTicks - interpPosX); + float var14 = (float) (prevPosY + (posY - prevPosY) * partialTicks - interpPosY); + float var15 = (float) (prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); + float op = alphaFunc.apply(this); + buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); + buffer.pos((var13 - f1 * var12 - f4 * var12), (var14 - f2 * var12), (var15 - f3 * var12 - f5 * var12)).tex(var9, var11).color(particleRed, particleGreen, particleBlue, op).endVertex(); + buffer.pos((var13 - f1 * var12 + f4 * var12), (var14 + f2 * var12), (var15 - f3 * var12 + f5 * var12)).tex(var9, var10).color(particleRed, particleGreen, particleBlue, op).endVertex(); + buffer.pos((var13 + f1 * var12 + f4 * var12), (var14 + f2 * var12), (var15 + f3 * var12 + f5 * var12)).tex(var8, var10).color(particleRed, particleGreen, particleBlue, op).endVertex(); + buffer.pos((var13 + f1 * var12 - f4 * var12), (var14 - f2 * var12), (var15 + f3 * var12 - f5 * var12)).tex(var8, var11).color(particleRed, particleGreen, particleBlue, op).endVertex(); + Tessellator.getInstance().draw(); + } + + if (impact > 0) { + for (int i = 0; i < maxParticles; ++i) { + int part = endsLoop ? (particleAge + i * 2) % 16 : Math.min(particleAge + i * 2, 16); + float var8 = part / 16.0F; + float var9 = var8 + 0.0625F; + float var10 = 0.0F; + float var11 = 1.0F; + float var12 = endMod / 2.0F; + float var13 = (float) (tXPrev + (tX - tXPrev) * partialTicks - interpPosX); + float var14 = (float) (tYPrev + (tY - tYPrev) * partialTicks - interpPosY); + float var15 = (float) (tZPrev + (tZ - tZPrev) * partialTicks - interpPosZ); + float op = alphaFunc.apply(this); + buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); + buffer.pos((var13 - f1 * var12 - f4 * var12), (var14 - f2 * var12), (var15 - f3 * var12 - f5 * var12)).tex(var9, var11).color(particleRed, particleGreen, particleBlue, op).endVertex(); + buffer.pos((var13 - f1 * var12 + f4 * var12), (var14 + f2 * var12), (var15 - f3 * var12 + f5 * var12)).tex(var9, var10).color(particleRed, particleGreen, particleBlue, op).endVertex(); + buffer.pos((var13 + f1 * var12 + f4 * var12), (var14 + f2 * var12), (var15 + f3 * var12 + f5 * var12)).tex(var8, var10).color(particleRed, particleGreen, particleBlue, op).endVertex(); + buffer.pos((var13 + f1 * var12 - f4 * var12), (var14 - f2 * var12), (var15 + f3 * var12 - f5 * var12)).tex(var8, var11).color(particleRed, particleGreen, particleBlue, op).endVertex(); + Tessellator.getInstance().draw(); + } + } + + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); } - + @Override public void renderParticle(BufferBuilder buffer, Entity entity, float partialTicks, float rotationX, - float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { - - Tessellator.getInstance().draw(); - GlStateManager.pushMatrix(); - float slide = Minecraft.getMinecraft().player.ticksExisted; - float rot = 0.0F; - if (rotationSpeed > 0.0F) - rot = (float) (world.provider.getWorldTime() % (360 / rotationSpeed) * rotationSpeed) + rotationSpeed * partialTicks; - - float cSize = size; - if (pulse) { - cSize = Math.min(particleAge / 4.0F, 1.0F); - cSize = (float) (prevSize + (cSize - prevSize) * partialTicks); - } - - float op = alphaFunc.apply(this); - Minecraft.getMinecraft().renderEngine.bindTexture(BEAM); - GlStateManager.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GlStateManager.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GlStateManager.disableCull(); - float var11 = slide + partialTicks; - if (reverse) - var11 *= -1.0F; - - float var12 = -var11 * 0.2F - MathHelper.floor(-var11 * 0.1F); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE); - GlStateManager.depthMask(false); - - if (follow || !posSet) { - Vec3d pos = ThaumicAugmentation.proxy.getRenderHelper().estimateImpulseCannonFiringPoint(source, 1.0F); - posX = pos.x; - posY = pos.y; - posZ = pos.z; - posSet = true; - } - - double dx = posX - tX; - double dy = posY - tY; - double dz = posZ - tZ; - length = MathHelper.sqrt(dx * dx + dy * dy + dz * dz); - double y = MathHelper.sqrt(dx * dx + dz * dz); - rotYaw = (float) (Math.toDegrees(Math.atan2(dx, dz))); - rotPitch = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(dy, y))); - - GlStateManager.translate(prevPosX + (posX - prevPosX) * partialTicks - interpPosX, - prevPosY + (posY - prevPosY) * partialTicks - interpPosY, - prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); - float ry = (float) (prevYaw + (rotYaw - prevYaw) * partialTicks); - float rp = (float) (prevPitch + (rotPitch - prevPitch) * partialTicks); - GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(180.0F + ry, 0.0F, 0.0F, -1.0F); - GlStateManager.rotate(rp, 1.0F, 0.0F, 0.0F); - double var44 = -0.15 * cSize; - double var17 = 0.15 * cSize; - double var44b = -0.15 * cSize * endMod; - double var17b = 0.15 * cSize * endMod; - int i = 200; - int j = i >> 16 & 0xFFFF; - int k = i & 0xFFFF; - GlStateManager.rotate(rot, 0.0F, 1.0F, 0.0F); - for (int t = 0; t < 3; t++) { - double var29 = length * cSize; - double var31 = 0.0; - double var33 = 1.0; - double var35 = -1.0F + var12 + t / 3.0F; - double var37 = length * cSize + var35; - GlStateManager.rotate(60.0F, 0.0F, 1.0F, 0.0F); - buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); - buffer.pos(var44b, var29, 0.0).tex(var33, var37).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - buffer.pos(var44, 0.0, 0.0).tex(var33, var35).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - buffer.pos(var17, 0.0, 0.0).tex(var31, var35).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - buffer.pos(var17b, var29, 0.0).tex(var31, var37).color(particleRed, particleGreen, particleBlue, op).lightmap(j, k).endVertex(); - Tessellator.getInstance().draw(); - } - - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.depthMask(true); - GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); - GlStateManager.disableBlend(); - GlStateManager.enableCull(); - GlStateManager.popMatrix(); - renderStartAndEnd(buffer, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); - - Minecraft.getMinecraft().renderEngine.bindTexture(ParticleManager.PARTICLE_TEXTURES); - buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); - prevSize = cSize; + float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { + + Tessellator.getInstance().draw(); + GlStateManager.pushMatrix(); + float slide = Minecraft.getMinecraft().player.ticksExisted; + float rot = 0.0F; + if (rotationSpeed > 0.0F) + rot = world.provider.getWorldTime() % (360 / rotationSpeed) * rotationSpeed + rotationSpeed * partialTicks; + + float cSize = size; + if (pulse) { + cSize = Math.min(particleAge / 4.0F, 1.0F); + cSize = prevSize + (cSize - prevSize) * partialTicks; + } + + float op = alphaFunc.apply(this); + Minecraft.getMinecraft().renderEngine.bindTexture(TATextures.IMPULSE_CANNON_BEAM); + GlStateManager.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GlStateManager.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GlStateManager.disableCull(); + float var11 = slide + partialTicks; + if (reverse) + var11 *= -1.0F; + + float var12 = -var11 * 0.2F - MathHelper.floor(-var11 * 0.1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); + GlStateManager.depthMask(false); + + if (follow || !posSet) { + Vec3d pos = ThaumicAugmentation.proxy.getRenderHelper().estimateImpulseCannonFiringPoint(source, 1.0F); + posX = pos.x; + posY = pos.y; + posZ = pos.z; + posSet = true; + } + + double dx = posX - tX; + double dy = posY - tY; + double dz = posZ - tZ; + length = MathHelper.sqrt(dx * dx + dy * dy + dz * dz); + double y = MathHelper.sqrt(dx * dx + dz * dz); + rotYaw = (float) (Math.toDegrees(Math.atan2(dx, dz))); + rotPitch = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(dy, y))); + + GlStateManager.translate(prevPosX + (posX - prevPosX) * partialTicks - interpPosX, + prevPosY + (posY - prevPosY) * partialTicks - interpPosY, + prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); + float ry = prevYaw + (rotYaw - prevYaw) * partialTicks; + float rp = prevPitch + (rotPitch - prevPitch) * partialTicks; + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(180.0F + ry, 0.0F, 0.0F, -1.0F); + GlStateManager.rotate(rp, 1.0F, 0.0F, 0.0F); + double var44 = -0.15 * cSize; + double var17 = 0.15 * cSize; + double var44b = -0.15 * cSize * endMod; + double var17b = 0.15 * cSize * endMod; + GlStateManager.rotate(rot, 0.0F, 1.0F, 0.0F); + for (int t = 0; t < 3; t++) { + double var29 = length * cSize; + double var31 = 0.0; + double var33 = 1.0; + double var35 = -1.0F + var12 + t / 3.0F; + double var37 = length * cSize + var35; + GlStateManager.rotate(60.0F, 0.0F, 1.0F, 0.0F); + buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); + buffer.pos(var44b, var29, 0.0).tex(var33, var37).color(particleRed, particleGreen, particleBlue, op).endVertex(); + buffer.pos(var44, 0.0, 0.0).tex(var33, var35).color(particleRed, particleGreen, particleBlue, op).endVertex(); + buffer.pos(var17, 0.0, 0.0).tex(var31, var35).color(particleRed, particleGreen, particleBlue, op).endVertex(); + buffer.pos(var17b, var29, 0.0).tex(var31, var37).color(particleRed, particleGreen, particleBlue, op).endVertex(); + Tessellator.getInstance().draw(); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.depthMask(true); + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + GlStateManager.popMatrix(); + renderStartAndEnd(buffer, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + + Minecraft.getMinecraft().renderEngine.bindTexture(ParticleManager.PARTICLE_TEXTURES); + buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + prevSize = cSize; } - + } diff --git a/src/main/java/thecodex6824/thaumicaugmentation/client/renderer/texture/TATextures.java b/src/main/java/thecodex6824/thaumicaugmentation/client/renderer/texture/TATextures.java index a14c95af..f45a2b86 100644 --- a/src/main/java/thecodex6824/thaumicaugmentation/client/renderer/texture/TATextures.java +++ b/src/main/java/thecodex6824/thaumicaugmentation/client/renderer/texture/TATextures.java @@ -38,12 +38,12 @@ public class TATextures { public static final ResourceLocation SIDE = new ResourceLocation("thaumcraft", "textures/models/dioptra_side.png"); public static final ResourceLocation MONITOR_BASE_TEXTURE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/blocks/rift_monitor_meter.png"); public static final ResourceLocation MONITOR_GLASS_TEXTURE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/blocks/rift_monitor_glass.png"); - + public static final ResourceLocation TUNNEL = new ResourceLocation("thaumcraft", "textures/misc/tunnel.png"); public static final ResourceLocation MIRROR_PARTICLES = new ResourceLocation("thaumcraft", "textures/misc/particlefield.png"); - + public static final ResourceLocation HARNESS_BASE_TEXTURE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/harness/harness_base.png"); - public static final ResourceLocation THAUMOSTATIC_TEXTURE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/harness/thaumostatic_module.png"); + public static final ResourceLocation THAUMOSTATIC_TEXTURE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/harness/thaumostatic_module.png"); public static final ResourceLocation THAUMOSTATIC_MODEL = new ResourceLocation(ThaumicAugmentationAPI.MODID, "models/entity/thaumostatic_module.obj"); public static final ResourceLocation LIGHTNING_TEXTURE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/harness/lightning_ring.png"); public static final ResourceLocation ELYTRA_TEXTURE = new ResourceLocation("minecraft", "textures/entity/elytra.png"); @@ -51,55 +51,59 @@ public class TATextures { public static final ResourceLocation AUTOCASTER_NORMAL = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/entities/autocaster.png"); public static final ResourceLocation AUTOCASTER_ELDRITCH = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/entities/autocaster_eldritch.png"); public static final ResourceLocation CELESTIAL_OBSERVER = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/entities/celestial_observer.png"); - + public static final ResourceLocation EMPTINESS_SKY = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/environment/emptiness_sky.png"); - + public static final ResourceLocation[] BASE_LAYERS = new ResourceLocation[] { - new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_base_layer1.png"), - new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_base_layer2.png"), - new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_base_layer3.png") + new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_base_layer1.png"), + new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_base_layer2.png"), + new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_base_layer3.png") }; - + public static final ResourceLocation[] RUNE_LAYERS = new ResourceLocation[] { - new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_runes_layer1.png"), - new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_runes_layer2.png"), - new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_runes_layer3.png") + new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_runes_layer1.png"), + new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_runes_layer2.png"), + new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/void_shield_runes_layer3.png") }; - - public static final ResourceLocation ELYTRA_BOOSTER_TEXTURE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/harness/elytra_booster.png"); + + public static final ResourceLocation ELYTRA_BOOSTER_TEXTURE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/models/harness/elytra_booster.png"); public static final ResourceLocation VANILLA_BANNER_BASE = new ResourceLocation("minecraft", "textures/entity/banner_base.png"); public static final ResourceLocation TC_BANNER = new ResourceLocation("thaumcraft", "textures/models/banner_blank.png"); public static final ResourceLocation CRIMSON_BANNER = new ResourceLocation("thaumcraft", "textures/models/banner_cultist.png"); - - public static final ResourceLocation BEAM = new ResourceLocation("thaumcraft", "textures/misc/wispy.png"); - public static final ResourceLocation LASER = new ResourceLocation("thaumcraft", "textures/misc/beamh.png"); + + public static final ResourceLocation IMPULSE_CANNON_BEAM = new ResourceLocation(ThaumicAugmentationAPI.MODID, + "textures/misc/cannon_beam.png"); + public static final ResourceLocation IMPULSE_CANNON_IMPACT = new ResourceLocation(ThaumicAugmentationAPI.MODID, + "textures/misc/cannon_impact.png"); + public static final ResourceLocation IMPETUS_BEAM_INACTIVE = new ResourceLocation("thaumcraft", "textures/misc/wispy.png"); + public static final ResourceLocation IMPETUS_BEAM_ACTIVE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/misc/impetus_beam.png"); public static final ResourceLocation FRAME = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/misc/frame_1x1_simple.png"); public static final ResourceLocation RIFT = new ResourceLocation("minecraft", "textures/entity/end_portal.png"); public static final ResourceLocation MIRROR = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/environment/mirror_field.png"); - + public static final ResourceLocation ELDRITCH_CUBE = new ResourceLocation(ThaumicAugmentationAPI.MODID, "textures/blocks/eldritch_cube.png"); public static final ResourceLocation ELDRITCH_PORTAL = new ResourceLocation("thaumcraft", "textures/misc/eldritch_portal.png"); - + public static final ResourceLocation TC_HUD = new ResourceLocation("thaumcraft", "textures/gui/hud.png"); public static final ResourceLocation TC_PARTICLES = new ResourceLocation("thaumcraft", "textures/misc/particles.png"); public static final ResourceLocation NODE = new ResourceLocation("thaumcraft", "textures/misc/auranodes.png"); public static final ResourceLocation THAUMOMETER = new ResourceLocation("thaumcraft", "textures/items/scanner.png"); public static final ResourceLocation THAUMOMETER_GLASS = new ResourceLocation("thaumcraft", "textures/items/scanscreen.png"); - + public static final ResourceLocation ESSENTIA = new ResourceLocation("thaumcraft", "blocks/animatedglow"); - + @SubscribeEvent public static void onTextureStitch(TextureStitchEvent.Post event) { - ITextureObject tex = Minecraft.getMinecraft().getTextureManager().getTexture(MIRROR); - if (tex == null) { - Minecraft.getMinecraft().getTextureManager().loadTexture(MIRROR, new SimpleTexture(MIRROR)); - tex = Minecraft.getMinecraft().getTextureManager().getTexture(MIRROR); - } - - if (tex != null) { - GlStateManager.bindTexture(tex.getGlTextureId()); - tex.setBlurMipmap(true, false); - } + ITextureObject tex = Minecraft.getMinecraft().getTextureManager().getTexture(MIRROR); + if (tex == null) { + Minecraft.getMinecraft().getTextureManager().loadTexture(MIRROR, new SimpleTexture(MIRROR)); + tex = Minecraft.getMinecraft().getTextureManager().getTexture(MIRROR); + } + + if (tex != null) { + GlStateManager.bindTexture(tex.getGlTextureId()); + tex.setBlurMipmap(true, false); + } } - + } diff --git a/src/main/resources/assets/thaumicaugmentation/textures/misc/cannon_beam.png b/src/main/resources/assets/thaumicaugmentation/textures/misc/cannon_beam.png new file mode 100644 index 00000000..9691106d Binary files /dev/null and b/src/main/resources/assets/thaumicaugmentation/textures/misc/cannon_beam.png differ diff --git a/src/main/resources/assets/thaumicaugmentation/textures/misc/cannon_impact.png b/src/main/resources/assets/thaumicaugmentation/textures/misc/cannon_impact.png new file mode 100644 index 00000000..26cb475c Binary files /dev/null and b/src/main/resources/assets/thaumicaugmentation/textures/misc/cannon_impact.png differ diff --git a/src/main/resources/assets/thaumicaugmentation/textures/misc/impetus_beam.png b/src/main/resources/assets/thaumicaugmentation/textures/misc/impetus_beam.png new file mode 100644 index 00000000..cfb9ac76 Binary files /dev/null and b/src/main/resources/assets/thaumicaugmentation/textures/misc/impetus_beam.png differ