From 2b9da4a0f048300e14bf359b705a4c04c05064ba Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Sun, 24 Dec 2017 21:45:03 +1000 Subject: + Added the Tesla Tower for base defence. --- .../renderer/RenderMiningExplosivesPrimed.java | 11 +- .../core/client/renderer/RenderPlasmaBolt.java | 165 +++++++++++++++++++++ 2 files changed, 172 insertions(+), 4 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/client/renderer/RenderPlasmaBolt.java (limited to 'src/Java/gtPlusPlus/core/client/renderer') diff --git a/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java b/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java index 42071428a7..359229adaa 100644 --- a/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java +++ b/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java @@ -6,6 +6,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.entity.EntityPrimedMiningExplosive; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.texture.TextureMap; @@ -28,7 +29,7 @@ public class RenderMiningExplosivesPrimed extends Render { * (Render= 0; --i) { + adouble[i] = d3; + adouble1[i] = d4; + d3 += (double) (random.nextInt(11) - 5); + d4 += (double) (random.nextInt(11) - 5); + } + + for (int k1 = 0; k1 < 4; ++k1) { + Random random1 = CSPRNG.generate(new Random(p_76986_1_.boltVertex)); + + for (int j = 0; j < 3; ++j) { + int k = 7; + int l = 0; + + if (j > 0) { + k = 7 - j; + } + + if (j > 0) { + l = k - 2; + } + + double d5 = adouble[k] - d3; + double d6 = adouble1[k] - d4; + + for (int i1 = k; i1 >= l; --i1) { + double d7 = d5; + double d8 = d6; + + if (j == 0) { + d5 += (double) (random1.nextInt(11) - 5); + d6 += (double) (random1.nextInt(11) - 5); + } + else { + d5 += (double) (random1.nextInt(31) - 15); + d6 += (double) (random1.nextInt(31) - 15); + } + + tessellator.startDrawing(5); + float f2 = 0.5F; + tessellator.setColorRGBA_F(0.9F * f2, 0.9F * f2, 1.0F * f2, 0.3F); + double d9 = 0.1D + (double) k1 * 0.2D; + + if (j == 0) { + d9 *= (double) i1 * 0.1D + 1.0D; + } + + double d10 = 0.1D + (double) k1 * 0.2D; + + if (j == 0) { + d10 *= (double) (i1 - 1) * 0.1D + 1.0D; + } + + for (int j1 = 0; j1 < 5; ++j1) { + double d11 = p_76986_2_ + 0.5D - d9; + double d12 = p_76986_6_ + 0.5D - d9; + + if (j1 == 1 || j1 == 2) { + d11 += d9 * 2.0D; + } + + if (j1 == 2 || j1 == 3) { + d12 += d9 * 2.0D; + } + + double d13 = p_76986_2_ + 0.5D - d10; + double d14 = p_76986_6_ + 0.5D - d10; + + if (j1 == 1 || j1 == 2) { + d13 += d10 * 2.0D; + } + + if (j1 == 2 || j1 == 3) { + d14 += d10 * 2.0D; + } + + tessellator.addVertex(d13 + d5, p_76986_4_ + (double) (i1 * 16), d14 + d6); + tessellator.addVertex(d11 + d7, p_76986_4_ + (double) ((i1 + 1) * 16), d12 + d8); + } + + tessellator.draw(); + } + } + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called + * unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityTeslaTowerLightning p_110775_1_) { + return null; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called + * unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return this.getEntityTexture((EntityTeslaTowerLightning) p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, + * always casting down its argument and then handing it off to a worker + * function which does the actual work. In all probabilty, the class Render + * is generic (Render