From 6ea2f6904a73672e4315eaab90eb2ecb25b987e7 Mon Sep 17 00:00:00 2001 From: brandon3055 Date: Mon, 4 Aug 2014 05:01:29 +1000 Subject: [PATCH] changed stuff and added things!!! --- build.gradle | 2 +- .../client/render/EnergyPylonRenderer.java | 85 +++++ .../render/EnergyStorageCoreRenderer.java | 106 +++++++ .../client/render/ParticleGenRenderer.java | 291 ++++++++++++++++-- .../client/render/Particles.java | 273 ++++++++++++++++ .../client/render/TestBlockRenderer.java | 13 +- .../common/blocks/ModBlocks.java | 3 + .../common/blocks/ParticleGenerator.java | 46 ++- .../common/blocks/multiblock/EnergyPylon.java | 119 +++++++ .../blocks/multiblock/EnergyStorageCore.java | 61 +++- .../multiblock/InvisibleMultiblock.java | 109 +++++-- .../common/core/handler/ParticleHandler.java | 3 + .../common/core/proxy/ClientProxy.java | 8 + .../common/core/proxy/CommonProxy.java | 2 + .../common/core/utills/Utills.java | 12 + .../draconicevolution/common/lib/Strings.java | 1 + .../tileentities/TileParticleGenerator.java | 108 +++++-- .../multiblocktiles/TileEnergyPylon.java | 277 +++++++++++++++++ .../TileEnergyStorageCore.java | 280 ++++++++++++++--- .../TileInvisibleMultiblock.java | 27 +- ...er_sphere_layer_2.obj => pylon_sphere.obj} | 0 .../models/stabilizer_sphere.obj | 41 +++ .../blocks/energy_pylon_active_face.png | Bin 0 -> 6127 bytes .../textures/blocks/energy_pylon_input.png | Bin 0 -> 7354 bytes .../textures/blocks/energy_pylon_output.png | Bin 0 -> 7195 bytes .../models/ParticleGenTextureSheet.png | Bin 491 -> 554 bytes .../textures/models/pylon_sphere_texture.png | Bin 0 -> 534 bytes .../textures/models/stabilizer_beam.png | Bin 0 -> 295 bytes .../textures/models/stabilizer_sphere.png | Bin 0 -> 373 bytes 29 files changed, 1715 insertions(+), 152 deletions(-) create mode 100644 src/main/java/com/brandon3055/draconicevolution/client/render/EnergyPylonRenderer.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/client/render/EnergyStorageCoreRenderer.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/client/render/Particles.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyPylon.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyPylon.java rename src/main/resources/assets/draconicevolution/models/{power_sphere_layer_2.obj => pylon_sphere.obj} (100%) create mode 100644 src/main/resources/assets/draconicevolution/models/stabilizer_sphere.obj create mode 100644 src/main/resources/assets/draconicevolution/textures/blocks/energy_pylon_active_face.png create mode 100644 src/main/resources/assets/draconicevolution/textures/blocks/energy_pylon_input.png create mode 100644 src/main/resources/assets/draconicevolution/textures/blocks/energy_pylon_output.png create mode 100644 src/main/resources/assets/draconicevolution/textures/models/pylon_sphere_texture.png create mode 100644 src/main/resources/assets/draconicevolution/textures/models/stabilizer_beam.png create mode 100644 src/main/resources/assets/draconicevolution/textures/models/stabilizer_sphere.png diff --git a/build.gradle b/build.gradle index e498b01d..71be6dec 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-v0.9.3-Beta-Pre1" +version = "1.7.10-v0.9.3-Beta-Pre3" group= "com.brandon3055.draconicevolution" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Draconic-Evolution" diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyPylonRenderer.java b/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyPylonRenderer.java new file mode 100644 index 00000000..d9ccc71c --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyPylonRenderer.java @@ -0,0 +1,85 @@ +package com.brandon3055.draconicevolution.client.render; + +import com.brandon3055.draconicevolution.common.blocks.multiblock.EnergyPylon; +import com.brandon3055.draconicevolution.common.lib.References; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; +import org.lwjgl.opengl.GL11; + +/** + * Created by Brandon on 27/07/2014. + */ +public class EnergyPylonRenderer extends TileEntitySpecialRenderer { + + private static final ResourceLocation model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/pylon_sphere_texture.png"); + private IModelCustom model; + + public EnergyPylonRenderer() + { + model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/pylon_sphere.obj")); + } + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float timeSinceLastTick) { + if (tile == null || !(tile instanceof TileEnergyPylon)) return; + TileEnergyPylon pylon = (TileEnergyPylon) tile; + if (!pylon.active) return; + float scale = pylon.modelScale + (timeSinceLastTick *= pylon.input ? -0.01F : 0.01F); + float rotation = pylon.modelRotation + (timeSinceLastTick / 2F); + GL11.glPushMatrix(); + GL11.glTranslated(x+0.5, y+0.5, z+0.5); + if (pylon.getWorldObj().getBlockMetadata(pylon.xCoord, pylon.yCoord, pylon.zCoord) == 1) { + GL11.glTranslated(0, 1, 0); + }else { + GL11.glTranslated(0, -1, 0); + } + //GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glDepthMask(false); + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(model_texture); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_BLEND); + + GL11.glPushMatrix(); + float scale1 = scale % 1F; + GL11.glScalef(scale1, scale1, scale1); + GL11.glRotatef(rotation*0.5F, 0F, -1F, -0.5F); + GL11.glColor4f(1F, 1F, 1F, 1F-(scale1)); + model.renderAll(); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + float scale2 = (scale+0.25F) % 1F; + GL11.glScalef(scale2, scale2, scale2); + GL11.glRotatef(rotation*0.5F, 0F, -1F, -0.5F); + GL11.glColor4f(1F, 1F, 1F, 1F-(scale2)); + model.renderAll(); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + float scale3 = (scale+0.5F) % 1F; + GL11.glScalef(scale3, scale3, scale3); + GL11.glRotatef(rotation*0.5F, 0F, -1F, -0.5F); + GL11.glColor4f(1F, 1F, 1F, 1F-(scale3)); + model.renderAll(); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + float scale4 = (scale+0.75F) % 1F; + GL11.glScalef(scale4, scale4, scale4); + GL11.glRotatef(rotation*0.5F, 0F, -1F, -0.5F); + GL11.glColor4f(1F, 1F, 1F, 1F-(scale4)); + model.renderAll(); + GL11.glPopMatrix(); + + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyStorageCoreRenderer.java b/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyStorageCoreRenderer.java new file mode 100644 index 00000000..610916d5 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyStorageCoreRenderer.java @@ -0,0 +1,106 @@ +package com.brandon3055.draconicevolution.client.render; + +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.lib.References; +import com.brandon3055.draconicevolution.common.tileentities.TileTestBlock; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; +import org.lwjgl.opengl.GL11; + +/** + * Created by Brandon on 27/07/2014. + */ +public class EnergyStorageCoreRenderer extends TileEntitySpecialRenderer { + + private static final ResourceLocation iner_model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_1.png"); + private static final ResourceLocation outer_model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_2.png"); + private IModelCustom iner_model; + private IModelCustom outer_model; + + public EnergyStorageCoreRenderer() + { + iner_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj")); + //outer_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_2.obj")); + } + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float timeSinceLastTick) { + if (tile == null || !(tile instanceof TileEnergyStorageCore)) return; + TileEnergyStorageCore core = (TileEnergyStorageCore) tile; + if (!core.isOnline()) return; + float scale = 0; + float rotation = core.modelRotation + (timeSinceLastTick / 2F); + + switch (core.getTier()){ + case 0: + scale = 0.7F; + break; + case 1: + scale = 1.2F; + break; + case 2: + scale = 1.7F; + break; + case 3: + scale = 2.5F; + break; + case 4: + scale = 3.5F; + break; + case 5: + scale = 4.5F; + break; + case 6: + scale = 5.5F; + break; + } + + GL11.glPushMatrix(); + GL11.glColor4f(1F, 1F, 1F, 1F); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) 100, (float) 100); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glTranslated(x+0.5, y+0.5, z+0.5); + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(iner_model_texture); + + GL11.glScalef(scale, scale, scale); + GL11.glPushMatrix(); + GL11.glRotatef(rotation, 0F, 1F, 0.5F); + iner_model.renderAll(); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glScalef(0.8F, 0.8F, 0.8F); + GL11.glColor4f(0.5F, 1F, 1F, 1F); + GL11.glRotatef(rotation, 0F, 1F, 0.5F); + iner_model.renderAll(); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glScalef(0.9F, 0.9F, 0.9F); + GL11.glColor4f(0F, 1F, 1F, 1F); + GL11.glRotatef(rotation, 0F, 1F, 0.5F); + iner_model.renderAll(); + GL11.glPopMatrix(); + + GL11.glScalef(1.1F, 1.1F, 1.1F); + GL11.glDepthMask(false); + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(outer_model_texture); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_BLEND); + GL11.glRotatef(rotation*0.5F, 0F, -1F, -0.5F); + GL11.glColor4f(0.5F, 2F, 2F, 0.7F); + iner_model.renderAll(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + + + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/ParticleGenRenderer.java b/src/main/java/com/brandon3055/draconicevolution/client/render/ParticleGenRenderer.java index 29a52fd2..dbacb376 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/render/ParticleGenRenderer.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/ParticleGenRenderer.java @@ -1,45 +1,63 @@ package com.brandon3055.draconicevolution.client.render; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; import org.lwjgl.opengl.GL11; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator; + +@SideOnly(Side.CLIENT) public class ParticleGenRenderer extends TileEntitySpecialRenderer { private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/ParticleGenTextureSheet.png"); + private final ResourceLocation beamTexture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/stabilizer_beam.png"); + private static final ResourceLocation modelTexture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/stabilizer_sphere.png"); + private IModelCustom stabilizerSphereModel; private float pxl = 1F / 64; - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) + public ParticleGenRenderer() { + stabilizerSphereModel = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/stabilizer_sphere.obj")); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) x, (float) y, (float) z); TileParticleGenerator tileEntityGen = (TileParticleGenerator) tileEntity; - renderBlock(tileEntityGen, tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, tileEntity.getWorldObj().getBlock(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord)); + renderBlock(tileEntityGen, tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, tileEntity.getWorldObj().getBlock(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), f); GL11.glPopMatrix(); } - //And this method actually renders your tile entity - public void renderBlock(TileParticleGenerator tl, World world, int x, int y, int z, Block block) - { + public void renderBlock(TileParticleGenerator tl, World world, int x, int y, int z, Block block, float f3) { Tessellator tessellator = Tessellator.instance; - - bindTexture(texture); + boolean inverted = tl.inverted; - + boolean stabilizerMode = tl.stabalizerMode; + + GL11.glPushMatrix(); + + GL11.glDisable(GL11.GL_LIGHTING); + bindTexture(texture); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); @@ -53,19 +71,18 @@ public class ParticleGenRenderer extends TileEntitySpecialRenderer OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2); //tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1F); - - + {//Draw Corners float f = 0.4F; - drawCornerCube(tessellator, f, f, f, 1F - f, inverted); - drawCornerCube(tessellator, f, -f, f, 1F - f, inverted); - drawCornerCube(tessellator, -f, f, -f, 1F - f, inverted); - drawCornerCube(tessellator, -f, -f, -f, 1F - f, inverted); - drawCornerCube(tessellator, -f, f, f, 1F - f, inverted); - drawCornerCube(tessellator, f, f, -f, 1F - f, inverted); - drawCornerCube(tessellator, f, -f, -f, 1F - f, inverted); - drawCornerCube(tessellator, -f, -f, f, 1F - f, inverted); + drawCornerCube(tessellator, f, f, f, 1F - f, inverted, stabilizerMode); + drawCornerCube(tessellator, f, -f, f, 1F - f, inverted, stabilizerMode); + drawCornerCube(tessellator, -f, f, -f, 1F - f, inverted, stabilizerMode); + drawCornerCube(tessellator, -f, -f, -f, 1F - f, inverted, stabilizerMode); + drawCornerCube(tessellator, -f, f, f, 1F - f, inverted, stabilizerMode); + drawCornerCube(tessellator, f, f, -f, 1F - f, inverted, stabilizerMode); + drawCornerCube(tessellator, f, -f, -f, 1F - f, inverted, stabilizerMode); + drawCornerCube(tessellator, -f, -f, f, 1F - f, inverted, stabilizerMode); } {//Draw Beams float f = 0.45F; @@ -87,12 +104,230 @@ public class ParticleGenRenderer extends TileEntitySpecialRenderer } tessellator.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + if (stabilizerMode) + { + drawEnergyBeam(tessellator, tl, f3); + } } - private void drawCornerCube(Tessellator tess, float x, float y, float z, float FP, boolean inverted) - { + private void drawEnergyBeam(Tessellator tess, TileParticleGenerator gen, float f){ + TileEnergyStorageCore master = gen.getMaster(); + if (master == null) return; + float length = 0; + + GL11.glPushMatrix(); + + if (master.xCoord > gen.xCoord){ + GL11.glRotatef(-90F, 0F, 0F, 1F); + GL11.glTranslated(-1, 0.5, 0); + length = master.xCoord - gen.xCoord - 0.2F; + } + else if (master.xCoord < gen.xCoord){ + GL11.glRotatef(90F, 0F, 0F, 1F); + GL11.glTranslated(0, -0.5, 0); + length = gen.xCoord - master.xCoord - 0.2F; + } + else if (master.zCoord > gen.zCoord){ + GL11.glRotatef(90F, 1F, 0F, 0F); + GL11.glTranslated(0, 0.5, -1); + length = master.zCoord - gen.zCoord - 0.2F; + } + else if (master.zCoord < gen.zCoord){ + GL11.glRotatef(-90F, 1F, 0F, 0F); + GL11.glTranslated(0, -0.5, 0); + length = gen.zCoord - master.zCoord - 0.2F; + } + + renderStabilizerSphere(gen); + renderEnergyBeam(tess, gen, length, f); + + GL11.glPopMatrix(); + } + + public void renderStabilizerSphere(TileParticleGenerator tile){ + GL11.glPushMatrix(); + //GL11.glColor4f(0.5F, 0.0F, 0.0F, 1F); + GL11.glColor4f(0.0F, 2.0F, 0.0F, 1F); + GL11.glTranslated(0.5, 0, 0.5); + GL11.glScalef(0.4F, 0.4F, 0.4F); + + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200, 200); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(modelTexture); + + GL11.glRotatef(tile.rotation, 0F, 1F, 0F); + stabilizerSphereModel.renderAll(); + + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200, 200); + GL11.glRotatef(tile.rotation*2, 0F, -1F, 0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); + GL11.glColor4f(0.0F, 1.0F, 1.0F, 0.5F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glScalef(1.3F, 1.3F, 1.3F); + stabilizerSphereModel.renderAll(); + GL11.glDepthMask(true); + + GL11.glPopMatrix(); + } + + private void renderEnergyBeam(Tessellator tess, TileParticleGenerator tile, float length, float f){ + int x = 0; + int y = 0; + int z = 0; + + GL11.glPushMatrix(); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + + bindTexture(beamTexture); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + + float time = (float)tile.getWorldObj().getTotalWorldTime() + f; + float upMot = -time * 0.2F - (float) MathHelper.floor_float(-time * 0.1F); + byte scaleMult = 1; + double rotation = (double)time * 0.025D * (1.0D - (double)(scaleMult & 1) * 2.5D); + + + tess.startDrawingQuads(); + tess.setColorRGBA(255, 255, 255, 32); + + double scale = (double)scaleMult * 0.2D; + double d7 = 0.5D + Math.cos(rotation + 2.356194490192345D) * scale; //x point 1 + double d9 = 0.5D + Math.sin(rotation + 2.356194490192345D) * scale; //z point 1 + double d11 = 0.5D + Math.cos(rotation + (Math.PI / 4D)) * scale; //x point 2 + double d13 = 0.5D + Math.sin(rotation + (Math.PI / 4D)) * scale; //z point 2 + double d15 = 0.5D + Math.cos(rotation + 3.9269908169872414D) * scale;//Dist from x-3 + double d17 = 0.5D + Math.sin(rotation + 3.9269908169872414D) * scale; + double d19 = 0.5D + Math.cos(rotation + 5.497787143782138D) * scale; + double d21 = 0.5D + Math.sin(rotation + 5.497787143782138D) * scale; + double height = (double)(length); + double texXMin = 0.0D; + double texXMax = 1.0D; + double d28 = (double)(-1.0F + upMot); + double texHeight = (double)(length) * (0.5D / scale) + d28; + + tess.addVertexWithUV(x + d7, y + height, z + d9, texXMax, texHeight); + tess.addVertexWithUV(x + d7, y, z + d9, texXMax, d28); + tess.addVertexWithUV(x + d11, y, z + d13, texXMin, d28); + tess.addVertexWithUV(x + d11, y + height, z + d13, texXMin, texHeight); + + tess.addVertexWithUV(x + d19, y + height, z + d21, texXMax, texHeight); + tess.addVertexWithUV(x + d19, y, z + d21, texXMax, d28); + tess.addVertexWithUV(x + d15, y, z + d17, texXMin, d28); + tess.addVertexWithUV(x + d15, y + height, z + d17, texXMin, texHeight); + + tess.addVertexWithUV(x + d11, y + height, z + d13, texXMax, texHeight); + tess.addVertexWithUV(x + d11, y, z + d13, texXMax, d28); + tess.addVertexWithUV(x + d19, y, z + d21, texXMin, d28); + tess.addVertexWithUV(x + d19, y + height, z + d21, texXMin, texHeight); + + tess.addVertexWithUV(x + d15, y + height, z + d17, texXMax, texHeight); + tess.addVertexWithUV(x + d15, y, z + d17, texXMax, d28); + tess.addVertexWithUV(x + d7, y, z + d9, texXMin, d28); + tess.addVertexWithUV(x + d7, y + height, z + d9, texXMin, texHeight); + + rotation += 0.77f; + d7 = 0.5D + Math.cos(rotation + 2.356194490192345D) * scale; + d9 = 0.5D + Math.sin(rotation + 2.356194490192345D) * scale; + d11 = 0.5D + Math.cos(rotation + (Math.PI / 4D)) * scale; + d13 = 0.5D + Math.sin(rotation + (Math.PI / 4D)) * scale; + d15 = 0.5D + Math.cos(rotation + 3.9269908169872414D) * scale; + d17 = 0.5D + Math.sin(rotation + 3.9269908169872414D) * scale; + d19 = 0.5D + Math.cos(rotation + 5.497787143782138D) * scale; + d21 = 0.5D + Math.sin(rotation + 5.497787143782138D) * scale; + + d28 = (-1F + (upMot*1)); + texHeight = (double)(length) * (0.5D / scale) + d28; + + tess.setColorRGBA_F(1.0F, 1.0f, 1.0f, 1f); + + tess.addVertexWithUV(x + d7, y + height, z + d9, texXMax, texHeight); + tess.addVertexWithUV(x + d7, y, z + d9, texXMax, d28); + tess.addVertexWithUV(x + d11, y, z + d13, texXMin, d28); + tess.addVertexWithUV(x + d11, y + height, z + d13, texXMin, texHeight); + + tess.addVertexWithUV(x + d19, y + height, z + d21, texXMax, texHeight); + tess.addVertexWithUV(x + d19, y, z + d21, texXMax, d28); + tess.addVertexWithUV(x + d15, y, z + d17, texXMin, d28); + tess.addVertexWithUV(x + d15, y + height, z + d17, texXMin, texHeight); + + tess.addVertexWithUV(x + d11, y + height, z + d13, texXMax, texHeight); + tess.addVertexWithUV(x + d11, y, z + d13, texXMax, d28); + tess.addVertexWithUV(x + d19, y, z + d21, texXMin, d28); + tess.addVertexWithUV(x + d19, y + height, z + d21, texXMin, texHeight); + + tess.addVertexWithUV(x + d15, y + height, z + d17, texXMax, texHeight); + tess.addVertexWithUV(x + d15, y, z + d17, texXMax, d28); + tess.addVertexWithUV(x + d7, y, z + d9, texXMin, d28); + tess.addVertexWithUV(x + d7, y + height, z + d9, texXMin, texHeight); + + tess.draw(); + GL11.glPushMatrix(); + + GL11.glTranslated(0, 0.4, 0); + length -= 0.5F; + + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDepthMask(false); + tess.startDrawingQuads(); + tess.setColorRGBA(255, 255, 255, 32); + double d30 = 0.2D; + double d4 = 0.2D; + double d6 = 0.8D; + double d8 = 0.2D; + double d10 = 0.2D; + double d12 = 0.8D; + double d14 = 0.8D; + double d16 = 0.8D; + double d18 = (double)(length); + double d20 = 0.0D; + double d22 = 1.0D; + double d24 = (double)(-1.0F + upMot); + double d26 = (double)(length) + d24; + tess.addVertexWithUV(x + d30, y + d18, z + d4, d22, d26); + tess.addVertexWithUV(x + d30, y, z + d4, d22, d24); + tess.addVertexWithUV(x + d6, y, z + d8, d20, d24); + tess.addVertexWithUV(x + d6, y + d18, z + d8, d20, d26); + tess.addVertexWithUV(x + d14, y + d18, z + d16, d22, d26); + tess.addVertexWithUV(x + d14, y, z + d16, d22, d24); + tess.addVertexWithUV(x + d10, y, z + d12, d20, d24); + tess.addVertexWithUV(x + d10, y + d18, z + d12, d20, d26); + tess.addVertexWithUV(x + d6, y + d18, z + d8, d22, d26); + tess.addVertexWithUV(x + d6, y, z + d8, d22, d24); + tess.addVertexWithUV(x + d14, y, z + d16, d20, d24); + tess.addVertexWithUV(x + d14, y + d18, z + d16, d20, d26); + tess.addVertexWithUV(x + d10, y + d18, z + d12, d22, d26); + tess.addVertexWithUV(x + d10, y, z + d12, d22, d24); + tess.addVertexWithUV(x + d30, y, z + d4, d20, d24); + tess.addVertexWithUV(x + d30, y + d18, z + d4, d20, d26); + tess.draw(); + GL11.glPopMatrix(); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPopMatrix(); + + } + + private void drawCornerCube(Tessellator tess, float x, float y, float z, float FP, boolean inverted, boolean stabalizerMode) { float srcXMin = inverted ? 38F * pxl: 32F * pxl; float srcYMin = 0F; float srcXMax = inverted ? 44F * pxl : 38F * pxl; @@ -100,6 +335,11 @@ public class ParticleGenRenderer extends TileEntitySpecialRenderer //float FP = 0.6F; //Scale float FN = 1F - FP; + if (stabalizerMode){ + srcXMin = 44F * pxl; + srcXMax = 50F * pxl; + } + //X+ tess.addVertexWithUV(FP + x, FN + y, FN + z, srcXMin, srcYMin); tess.addVertexWithUV(FP + x, FP + y, FN + z, srcXMax, srcYMin); @@ -137,8 +377,7 @@ public class ParticleGenRenderer extends TileEntitySpecialRenderer tess.addVertexWithUV(FP + x, FN + y, FN + z, srcXMin, srcYMax); } - private void drawBeamX(Tessellator tess, float x, float y, float z, float FP) - { + private void drawBeamX(Tessellator tess, float x, float y, float z, float FP) { float srcXMin = 0; float srcYMin = 0F; float srcXMax = 32F * pxl; @@ -173,8 +412,7 @@ public class ParticleGenRenderer extends TileEntitySpecialRenderer tess.addVertexWithUV(XX, FN + y, FN + z, srcXMax, srcYMax); } - private void drawBeamY(Tessellator tess, float x, float y, float z, float FP) - { + private void drawBeamY(Tessellator tess, float x, float y, float z, float FP) { float srcXMin = 0; float srcYMin = 0F; float srcXMax = 32F * pxl; @@ -210,8 +448,7 @@ public class ParticleGenRenderer extends TileEntitySpecialRenderer } - private void drawBeamZ(Tessellator tess, float x, float y, float z, float FP) - { + private void drawBeamZ(Tessellator tess, float x, float y, float z, float FP) { float srcXMin = 0; float srcYMin = 0F; float srcXMax = 32F * pxl; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/Particles.java b/src/main/java/com/brandon3055/draconicevolution/client/render/Particles.java new file mode 100644 index 00000000..c7e465ae --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/Particles.java @@ -0,0 +1,273 @@ +package com.brandon3055.draconicevolution.client.render; + +import com.brandon3055.draconicevolution.common.core.handler.ParticleHandler; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.lib.References; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +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; + +/** + * Created by Brandon on 27/07/2014. + */ +@SideOnly(Side.CLIENT) +public final class Particles { + + public static class EnergyBeamParticle extends EntityFX { + + private int direction = 0; + private double masterX = 0; + private double masterZ = 0; + private float rotation = 0; + private boolean mirror = false; + private double[] trailX = new double[15]; + private double[] trailY = new double[15]; + private double[] trailZ = new double[15]; + + public EnergyBeamParticle(World world, double x, double y, double z, double x1, double z1, int direction, boolean mirror) { + super(world, x, y, z, 0.0D, 0.0D, 0.0D); + float speed = 0.04F; + this.motionX = 0; + this.motionY = 0; + this.motionZ = 0; + this.masterX = x1; + this.masterZ = z1; + this.direction = direction; + this.mirror = mirror; + + switch (direction){ + case 0: + this.motionX = speed; + break; + case 1: + this.motionX = -speed; + break; + case 2: + this.motionZ = speed; + break; + case 3: + this.motionZ = -speed; + break; + } + + this.particleTextureIndexX = 0; + this.particleTextureIndexY = 0; + this.particleScale = 1F; + this.noClip = true; + this.particleMaxAge = 300; + } + + @Override + public void onUpdate() { + if (particleAge > particleMaxAge || this.getDistanceSq(masterX, posY, masterZ) < 0.02) setDead(); + if (this.getDistanceSq(masterX, posY, masterZ) < 0.1) { + motionX = (masterX - posX) * 0.1F; + motionY = (Math.floor(posY) + 0.5 - posY) * 0.1F; + motionZ = (masterZ - posZ) * 0.1F; + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; + moveEntity(motionX, motionY, motionZ); + return; + }else { + trailX[0] = posX; + trailY[0] = posY; + trailZ[0] = posZ; + for (int i = 14; i >= 0; i--){ + if (i > 0) { + trailX[i] = trailX[i-1]; + trailY[i] = trailY[i-1]; + trailZ[i] = trailZ[i-1]; + } + } + + float multiplier = 0.27F; + double masterY = Math.floor(posY) + 0.5; + if (direction == 0 || direction == 1) { + posZ = masterZ + Math.sin(rotation) * multiplier; + posY = masterY + Math.cos(rotation) * multiplier; + }else{ + posX = masterX + Math.sin(rotation) * multiplier; + posY = masterY + Math.cos(rotation) * multiplier; + } + if (mirror){ + float modifier = 3F; + if (direction == 0 || direction == 1) { + posZ = masterZ + Math.sin(rotation + modifier) * multiplier; + posY = masterY + Math.cos(rotation + modifier) * multiplier; + }else{ + posX = masterX + Math.sin(rotation + modifier) * multiplier; + posY = masterY + Math.cos(rotation + modifier) * multiplier; + } + } + setPosition(posX, posY, posZ); + } + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; + if (direction == 0 || direction == 1) + moveEntity(motionX, 0, 0); + else + moveEntity(0, 0, motionZ); + particleAge ++; + if (direction == 0 || direction == 3) + rotation -= 0.15; + else + rotation += 0.15; + } + @Override + @SideOnly(Side.CLIENT) + public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6, float par7) {//Note U=X V=Y + + tesselator.draw(); + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(References.RESOURCESPREFIX + "textures/particle/particles.png")); + tesselator.startDrawingQuads(); + tesselator.setBrightness(200);//make sure you have this!! + + + float minU = 0.0F + 0F;//(float)this.particleTextureIndexX / 32.0F; + float maxU = 0.0F + 0.1245F;//minU + 0.124F; + float minV = 0F;//(float)this.particleTextureIndexY / 32.0F; + float maxV = 0.1245F;//minV + 0.124F; + float drawScale = 0.1F * particleScale; + + if (this.particleIcon != null) { + minU = particleIcon.getMinU(); + maxU = particleIcon.getMaxU(); + minV = particleIcon.getMinV(); + maxV = particleIcon.getMaxV(); + } + + float drawX = (float) (prevPosX + (posX - prevPosX) * (double) par2 - interpPosX); + float drawY = (float) (prevPosY + (posY - prevPosY) * (double) par2 - interpPosY); + float drawZ = (float) (prevPosZ + (posZ - prevPosZ) * (double) par2 - interpPosZ); + + tesselator.setColorRGBA_F(particleRed, particleGreen, particleBlue, particleAlpha); + + tesselator.addVertexWithUV((double) (drawX - par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ - par5 * drawScale - par7 * drawScale), (double) maxU, (double) maxV); + tesselator.addVertexWithUV((double) (drawX - par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ - par5 * drawScale + par7 * drawScale), (double) maxU, (double) minV); + tesselator.addVertexWithUV((double) (drawX + par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ + par5 * drawScale + par7 * drawScale), (double) minU, (double) minV); + tesselator.addVertexWithUV((double) (drawX + par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ + par5 * drawScale - par7 * drawScale), (double) minU, (double) maxV); + + for (int i = 0; i <= 14; i++){ + GL11.glPushMatrix(); + drawX = (float) (trailX[i] + (trailX[i] - trailX[i]) * (double) par2 - interpPosX); + drawY = (float) (trailY[i] + (trailY[i] - trailY[i]) * (double) par2 - interpPosY); + drawZ = (float) (trailZ[i] + (trailZ[i] - trailZ[i]) * (double) par2 - interpPosZ); + float scale = 0.1F * (1F - ((float)i / 14F)); + float scale2 = (1F - ((float)i / 14F)); + + if (!mirror) { + tesselator.setColorRGBA_F(1F, scale2, scale2, scale2); + }else{ + tesselator.setColorRGBA_F(scale2, 1F, scale2, scale2); + } + + tesselator.addVertexWithUV((double) (drawX - par3 * scale - par6 * scale), (double) (drawY - par4 * scale), (double) (drawZ - par5 * scale - par7 * scale), (double) maxU, (double) maxV); + tesselator.addVertexWithUV((double) (drawX - par3 * scale + par6 * scale), (double) (drawY + par4 * scale), (double) (drawZ - par5 * scale + par7 * scale), (double) maxU, (double) minV); + tesselator.addVertexWithUV((double) (drawX + par3 * scale + par6 * scale), (double) (drawY + par4 * scale), (double) (drawZ + par5 * scale + par7 * scale), (double) minU, (double) minV); + tesselator.addVertexWithUV((double) (drawX + par3 * scale - par6 * scale), (double) (drawY - par4 * scale), (double) (drawZ + par5 * scale - par7 * scale), (double) minU, (double) maxV); + GL11.glPopMatrix(); + } + + tesselator.draw(); + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/particle/particles.png")); + tesselator.startDrawingQuads(); + + } + } + + public static class EnergyTransferParticle extends EntityFX { + + private double targetX; + private double targetY; + private double targetZ; + private boolean passive; + + public EnergyTransferParticle(World world, double x, double y, double z, double tX, double tY, double tZ, boolean passive) { + super(world, x, y, z, 0.0D, 0.0D, 0.0D); + this.passive = passive; + this.targetX = tX; + this.targetY = tY; + this.targetZ = tZ; + this.motionX = 0; + this.motionY = 0; + this.motionZ = 0; + this.particleTextureIndexX = 0; + this.particleTextureIndexY = 0; + this.particleScale = world.rand.nextFloat() + 0.5F; + this.particleMaxAge = 100; + this.noClip = true; + if (!passive){ + this.particleRed = 0F; + this.particleGreen = 94F/255F; + this.particleBlue = 250F/255F; + } + } + + @Override + public void onUpdate() { + if (particleAge > particleMaxAge) setDead(); + if (particleAge > particleMaxAge || this.getDistanceSq(targetX, targetY, targetZ) < 0.05) setDead(); + particleAge ++; + motionX += (targetX - posX) * 0.001F; + motionY += (targetY - posY) * 0.001F; + motionZ += (targetZ - posZ) * 0.001F; + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; + moveEntity(motionX, motionY, motionZ); + return; + } + @Override + @SideOnly(Side.CLIENT) + public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6, float par7) {//Note U=X V=Y + + tesselator.draw(); + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(References.RESOURCESPREFIX + "textures/particle/particles.png")); + tesselator.startDrawingQuads(); + tesselator.setBrightness(200);//make sure you have this!! + + + float minU = 0.0F + 0F;//(float)this.particleTextureIndexX / 32.0F; + float maxU = 0.0F + 0.1245F;//minU + 0.124F; + float minV = 0F;//(float)this.particleTextureIndexY / 32.0F; + float maxV = 0.1245F;//minV + 0.124F; + float drawScale = 0.1F * this.particleScale; + + if (this.particleIcon != null) { + minU = this.particleIcon.getMinU(); + maxU = this.particleIcon.getMaxU(); + minV = this.particleIcon.getMinV(); + maxV = this.particleIcon.getMaxV(); + } + + float drawX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX); + float drawY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY); + float drawZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ); + + if (passive) + tesselator.setColorRGBA_F((float)this.getDistanceSq(targetX, targetY, targetZ)*5F*this.particleRed, (float)this.getDistanceSq(targetX, targetY, targetZ)*5F*this.particleGreen, this.particleBlue, this.particleAlpha); + else + tesselator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, (float)this.getDistanceSq(targetX, targetY, targetZ)*5F); + + //tesselator.setColorRGBA(0, 255, 255, (int) (this.particleAlpha * 255F)); + + tesselator.addVertexWithUV((double) (drawX - par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ - par5 * drawScale - par7 * drawScale), (double) maxU, (double) maxV); + tesselator.addVertexWithUV((double) (drawX - par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ - par5 * drawScale + par7 * drawScale), (double) maxU, (double) minV); + tesselator.addVertexWithUV((double) (drawX + par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ + par5 * drawScale + par7 * drawScale), (double) minU, (double) minV); + tesselator.addVertexWithUV((double) (drawX + par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ + par5 * drawScale - par7 * drawScale), (double) minU, (double) maxV); + + tesselator.draw(); + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/particle/particles.png")); + tesselator.startDrawingQuads(); + + } + } + +} diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/TestBlockRenderer.java b/src/main/java/com/brandon3055/draconicevolution/client/render/TestBlockRenderer.java index 59f294da..1717a075 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/render/TestBlockRenderer.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/TestBlockRenderer.java @@ -26,28 +26,32 @@ public class TestBlockRenderer extends TileEntitySpecialRenderer { public TestBlockRenderer() { iner_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj")); - outer_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_2.obj")); + //outer_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_2.obj")); } @Override public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float var8) { GL11.glPushMatrix(); - + GL11.glColor4f(1F, 1F, 1F, 1F); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) 100, (float) 100); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + //GL11.glDepthMask(false); + GL11.glTranslated(x+0.5, y+0.5, z+0.5); FMLClientHandler.instance().getClient().getTextureManager().bindTexture(iner_model_texture); GL11.glPushMatrix(); GL11.glRotatef(((TileTestBlock)var1).modelRotation, 0F, 1F, 0.5F); - GL11.glColor4f(2F, 2F, 2F, 1F); + //GL11.glColor4f(2F, 2F, 2F, 1F); iner_model.renderAll(); GL11.glPopMatrix(); GL11.glScalef(1.1F, 1.1F, 1.1F); - + GL11.glDepthMask(false); FMLClientHandler.instance().getClient().getTextureManager().bindTexture(outer_model_texture); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); @@ -56,6 +60,7 @@ public class TestBlockRenderer extends TileEntitySpecialRenderer { GL11.glColor4f(0.5F, 2F, 2F, 0.7F); outer_model.renderAll(); GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); GL11.glPopMatrix(); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java index 6e8e7f71..2beae7ef 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java @@ -1,5 +1,6 @@ package com.brandon3055.draconicevolution.common.blocks; +import com.brandon3055.draconicevolution.common.blocks.multiblock.EnergyPylon; import com.brandon3055.draconicevolution.common.blocks.multiblock.EnergyStorageCore; import com.brandon3055.draconicevolution.common.blocks.multiblock.InvisibleMultiblock; import net.minecraft.block.Block; @@ -26,6 +27,7 @@ public class ModBlocks { public static Block energyStorageCore; public static Block draconium; public static Block invisibleMultiblock; + public static Block energyPylon; public static void init() { @@ -45,6 +47,7 @@ public class ModBlocks { energyStorageCore = new EnergyStorageCore(); draconium = new Draconium(); invisibleMultiblock = new InvisibleMultiblock(); + energyPylon = new EnergyPylon(); if(ConfigHandler.disable_LRD < 2) longRangeDislocator = new LongRangeDislocator(); if(DraconicEvolution.debug) testBlock = new TestBlock(); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/ParticleGenerator.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/ParticleGenerator.java index 87afdfb1..42fed8be 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/ParticleGenerator.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/ParticleGenerator.java @@ -47,9 +47,9 @@ public class ParticleGenerator extends Block } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int meta, float p_149727_7_, float p_149727_8_, float p_149727_9_) + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float p_149727_7_, float p_149727_8_, float p_149727_9_) { - if (meta == 1) return false; + if (world.getBlockMetadata(x, y, z) == 1) return false; if (player.isSneaking()) { if (activateEnergyStorageCore(world, x, y, z, player)) return true; @@ -160,9 +160,16 @@ public class ParticleGenerator extends Block TileEnergyStorageCore tile = (world.getTileEntity(x1, y, z) != null && world.getTileEntity(x1, y, z) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore) world.getTileEntity(x1, y, z) : null; if (tile != null && !tile.isOnline()) { - if (!tile.tryActivate() && world.isRemote) { - player.addChatComponentMessage(new ChatComponentTranslation("msg.energyStorageCoreUTA.txt")); - return false; + if (player.capabilities.isCreativeMode) { + if (!tile.creativeActivate()) { + if (world.isRemote) player.addChatComponentMessage(new ChatComponentTranslation("msg.energyStorageCoreUTA.txt")); + return false; + } + }else { + if (!tile.tryActivate()) { + if (world.isRemote) player.addChatComponentMessage(new ChatComponentTranslation("msg.energyStorageCoreUTA.txt")); + return false; + } } return true; } @@ -174,9 +181,16 @@ public class ParticleGenerator extends Block TileEnergyStorageCore tile = (world.getTileEntity(x, y, z1) != null && world.getTileEntity(x, y, z1) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore) world.getTileEntity(x, y, z1) : null; if (tile != null && !tile.isOnline()) { - if (!tile.tryActivate() && world.isRemote) { - player.addChatComponentMessage(new ChatComponentTranslation("msg.energyStorageCoreUTA.txt")); - return false; + if (player.capabilities.isCreativeMode) { + if (!tile.creativeActivate()) { + if (world.isRemote) player.addChatComponentMessage(new ChatComponentTranslation("msg.energyStorageCoreUTA.txt")); + return false; + } + }else { + if (!tile.tryActivate()) { + if (world.isRemote) player.addChatComponentMessage(new ChatComponentTranslation("msg.energyStorageCoreUTA.txt")); + return false; + } } return true; } @@ -184,4 +198,20 @@ public class ParticleGenerator extends Block } return false; } + + @Override + public void breakBlock(World world, int x, int y, int z, Block p_149749_5_, int meta) { + if (meta == 1) + { + TileEntity tile = world.getTileEntity(x, y, z); + TileParticleGenerator gen = (tile != null && tile instanceof TileParticleGenerator) ? (TileParticleGenerator) tile : null; + if (gen != null && gen.getMaster() != null) + { + world.setBlockMetadataWithNotify(x, y, z, 0, 2); + //LogHelper.info("deActivate"); + gen.getMaster().isStructureStillValid(true); + } + } + super.breakBlock(world, x, y, z, p_149749_5_, meta); + } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyPylon.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyPylon.java new file mode 100644 index 00000000..92176596 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyPylon.java @@ -0,0 +1,119 @@ +package com.brandon3055.draconicevolution.common.blocks.multiblock; + +import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.common.blocks.DraconicEvolutionBlock; +import com.brandon3055.draconicevolution.common.blocks.ModBlocks; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.lib.References; +import com.brandon3055.draconicevolution.common.lib.Strings; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileInvisibleMultiblock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +/** + * Created by Brandon on 28/07/2014. + */ +public class EnergyPylon extends DraconicEvolutionBlock { + @SideOnly(Side.CLIENT) + public IIcon icon_active_face; + public IIcon icon_input; + public IIcon icon_output; + + public EnergyPylon() { + super(Material.iron); + this.setHardness(5F); + this.setResistance(20F); + this.setCreativeTab(DraconicEvolution.getCreativeTab(2)); + this.setBlockName(Strings.energyPylonName); + ModBlocks.register(this); + } + + @Override + public boolean hasTileEntity(int metadata) { + return metadata == 1 || metadata == 2; + } + + @Override + public TileEntity createTileEntity(World world, int metadata) { + if (metadata == 1 || metadata == 2) + return new TileEnergyPylon(); + else + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + icon_input = iconRegister.registerIcon(References.RESOURCESPREFIX + "energy_pylon_input"); + icon_output = iconRegister.registerIcon(References.RESOURCESPREFIX + "energy_pylon_output"); + icon_active_face = iconRegister.registerIcon(References.RESOURCESPREFIX + "energy_pylon_active_face"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + if (meta == 1 && side == 1) + return icon_active_face; + if (meta == 2 && side == 0) + return icon_active_face; + return icon_input; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + TileEnergyPylon thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEnergyPylon) ? (TileEnergyPylon) world.getTileEntity(x, y, z) : null; + if (thisTile == null) return icon_input; + return thisTile.input ? icon_output : icon_input; + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) { + int meta = world.getBlockMetadata(x, y, z); + if (meta == 0) { + if (world.getBlock(x, y + 1, z) == Blocks.glass) { + world.setBlockMetadataWithNotify(x, y, z, 1, 2); + world.setBlock(x, y + 1, z, ModBlocks.invisibleMultiblock, 2, 2); + } + else if (world.getBlock(x, y - 1, z) == Blocks.glass) { + world.setBlockMetadataWithNotify(x, y, z, 2, 2); + world.setBlock(x, y - 1, z, ModBlocks.invisibleMultiblock, 2, 2); + } + }else { + TileEnergyPylon thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEnergyPylon) ? (TileEnergyPylon) world.getTileEntity(x, y, z) : null; + if (thisTile == null || (meta == 1 && !isGlass(world, x, y+1, z)) || (meta == 2 && !isGlass(world, x, y-1, z))) { + world.setBlockMetadataWithNotify(x, y, z, 0, 2); + } + } + TileEnergyPylon thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEnergyPylon) ? (TileEnergyPylon) world.getTileEntity(x, y, z) : null; + if (thisTile != null) { + thisTile.onActivated(); + } + } + + private boolean isGlass(World world, int x, int y, int z){ + return world.getBlock(x, y, z) == ModBlocks.invisibleMultiblock && world.getBlockMetadata(x, y, z) == 2; + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + int meta = world.getBlockMetadata(x, y, z); + if (meta == 0) return false; + TileEnergyPylon thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEnergyPylon) ? (TileEnergyPylon) world.getTileEntity(x, y, z) : null; + if (thisTile != null) { + thisTile.onActivated(); + return true; + } + return false; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyStorageCore.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyStorageCore.java index fe52f9f1..2d276bce 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyStorageCore.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyStorageCore.java @@ -4,18 +4,21 @@ import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.blocks.DraconicEvolutionBlock; import com.brandon3055.draconicevolution.common.blocks.ModBlocks; import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.core.utills.Utills; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.Strings; -import com.brandon3055.draconicevolution.common.tileentities.TileGenerator; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileInvisibleMultiblock; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -58,10 +61,56 @@ public class EnergyStorageCore extends DraconicEvolutionBlock { LogHelper.error("Missing Tile Entity (EnergyStorageCore)"); return false; } - if (!world.isRemote) - tile.tryActivate(); - //if (world.isRemote) - //player.addChatComponentMessage(new ChatComponentText(""+tile.getEnergyStored(ForgeDirection.UP))); + + if (!world.isRemote) { + player.addChatComponentMessage(new ChatComponentText("Tier:" + tile.getTier())); + player.addChatComponentMessage(new ChatComponentText("" + Utills.formatNumber(tile.getEnergyStored()) + " / " + Utills.formatNumber(tile.getMaxEnergyStored()))); + } return true; } + + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { + TileEnergyStorageCore tile = (world.getTileEntity(x - ForgeDirection.getOrientation(side).offsetX, y - ForgeDirection.getOrientation(side).offsetY, z - ForgeDirection.getOrientation(side).offsetZ) != null && world.getTileEntity(x - ForgeDirection.getOrientation(side).offsetX, y - ForgeDirection.getOrientation(side).offsetY, z - ForgeDirection.getOrientation(side).offsetZ) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore) world.getTileEntity(x - ForgeDirection.getOrientation(side).offsetX, y - ForgeDirection.getOrientation(side).offsetY, z - ForgeDirection.getOrientation(side).offsetZ) : null; + //LogHelper.error(world.getTileEntity(x - ForgeDirection.getOrientation(side).offsetX, y - ForgeDirection.getOrientation(side).offsetY, z - ForgeDirection.getOrientation(side).offsetZ)); + if (tile == null) + { + LogHelper.error("Missing Tile Entity (EnergyStorageCore)(shouldSideBeRendered)"); + return true; + } + if (tile.isOnline()) + return false; + else + return super.shouldSideBeRendered(world, x, y, z, side); + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) { + TileEnergyStorageCore thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore) world.getTileEntity(x, y, z) : null; + if (thisTile != null && thisTile.isOnline() && thisTile.getTier() == 0) + { + thisTile.isStructureStillValid(false); + } + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block p_149749_5_, int p_149749_6_) { + TileEnergyStorageCore thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore) world.getTileEntity(x, y, z) : null; + if (thisTile != null && thisTile.isOnline() && thisTile.getTier() == 0) + { + thisTile.deactivateStabilizers(); + } + super.breakBlock(world, x, y, z, p_149749_5_, p_149749_6_); + } + + @Override + public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { + TileEnergyStorageCore thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore) world.getTileEntity(x, y, z) : null; + if (thisTile != null && thisTile.isOnline()) + { + return AxisAlignedBB.getBoundingBox(thisTile.xCoord + 0.5, thisTile.yCoord + 0.5, thisTile.zCoord + 0.5, thisTile.xCoord + 0.5, thisTile.yCoord + 0.5, thisTile.zCoord + 0.5); + } + return super.getSelectedBoundingBoxFromPool(world, x, y, z); + } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/InvisibleMultiblock.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/InvisibleMultiblock.java index 89b8d345..66b94c75 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/InvisibleMultiblock.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/InvisibleMultiblock.java @@ -5,8 +5,11 @@ import com.brandon3055.draconicevolution.common.blocks.DraconicEvolutionBlock; import com.brandon3055.draconicevolution.common.blocks.Draconium; import com.brandon3055.draconicevolution.common.blocks.ModBlocks; import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.core.utills.Utills; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.Strings; +import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileInvisibleMultiblock; import cpw.mods.fml.relauncher.Side; @@ -18,6 +21,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -63,12 +67,14 @@ public class InvisibleMultiblock extends DraconicEvolutionBlock { @Override public boolean hasTileEntity(int metadata) { - return true; + return metadata == 0 || metadata == 1; } @Override public TileEntity createTileEntity(World world, int metadata) { - return new TileInvisibleMultiblock(); + if (metadata == 0 || metadata == 1) + return new TileInvisibleMultiblock(); + else return null; } @Override @@ -83,38 +89,55 @@ public class InvisibleMultiblock extends DraconicEvolutionBlock { @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { - TileInvisibleMultiblock thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileInvisibleMultiblock) ? (TileInvisibleMultiblock) world.getTileEntity(x, y, z) : null; - if (thisTile == null) - { - LogHelper.error("Missing Tile Entity (TileInvisibleMultiblock)"); - return false; + int meta = world.getBlockMetadata(x, y, z); + if (meta == 0 || meta == 1) { + TileInvisibleMultiblock thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileInvisibleMultiblock) ? (TileInvisibleMultiblock) world.getTileEntity(x, y, z) : null; + if (thisTile == null) { + LogHelper.error("Missing Tile Entity (TileInvisibleMultiblock)"); + return false; + } + TileEnergyStorageCore master = thisTile.getMaster(); + if (master == null) { + onNeighborBlockChange(world, x, y, z, this); + return false; + } + if (!world.isRemote) { + player.addChatComponentMessage(new ChatComponentText("Tier:" + master.getTier())); + player.addChatComponentMessage(new ChatComponentText("" + Utills.formatNumber(master.getEnergyStored()) + " / " + Utills.formatNumber(master.getMaxEnergyStored()))); + } + return true; + } else if (meta == 2) { + TileEnergyPylon pylon = (world.getTileEntity(x, y+1, z) != null && world.getTileEntity(x, y+1, z) instanceof TileEnergyPylon) ? (TileEnergyPylon) world.getTileEntity(x, y+1, z) : (world.getTileEntity(x, y-1, z) != null && world.getTileEntity(x, y-1, z) instanceof TileEnergyPylon) ? (TileEnergyPylon) world.getTileEntity(x, y-1, z) : null; + if (pylon == null) return false; + pylon.input = !pylon.input; + world.markBlockForUpdate(pylon.xCoord, pylon.yCoord, pylon.zCoord); + pylon.onActivated(); + return true; } - TileEnergyStorageCore master= thisTile.getMaster(); - if (master == null) { - onNeighborBlockChange(world, x, y, z, this); - return false; - } - if (world.isRemote) - player.addChatComponentMessage(new ChatComponentText(""+master.getEnergyStored(ForgeDirection.UP))); - return true; + return false; } @Override public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) { - TileInvisibleMultiblock thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileInvisibleMultiblock) ? (TileInvisibleMultiblock) world.getTileEntity(x, y, z) : null; - if (thisTile == null) - { - LogHelper.error("Missing Tile Entity (TileInvisibleMultiblock)"); - revert(world, x, y, z); - return; + int meta = world.getBlockMetadata(x, y, z); + if (meta == 0 || meta == 1) { + TileInvisibleMultiblock thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileInvisibleMultiblock) ? (TileInvisibleMultiblock) world.getTileEntity(x, y, z) : null; + if (thisTile == null) { + LogHelper.error("Missing Tile Entity (TileInvisibleMultiblock)"); + revert(world, x, y, z); + return; + } + TileEnergyStorageCore master = thisTile.getMaster(); + if (master == null) { + LogHelper.error("Master = null reverting!"); + revert(world, x, y, z); + return; + } + if (master.isOnline()) master.isStructureStillValid(false); + if (!master.isOnline()) revert(world, x, y, z); + }else if (meta == 2) { + if (world.getBlock(x, y + 1, z) != ModBlocks.energyPylon && world.getBlock(x, y - 1, z) != ModBlocks.energyPylon) world.setBlock(x, y, z, Blocks.glass); } - TileEnergyStorageCore master = thisTile.getMaster(); - if (master == null) { - LogHelper.error("Master = null reverting!"); - revert(world, x, y, z); - return; - } - if (!master.isOnline()) revert(world, x, y, z); } private void revert(World world, int x, int y, int z){ @@ -124,4 +147,34 @@ public class InvisibleMultiblock extends DraconicEvolutionBlock { else if (meta == 1) world.setBlock(x, y, z, Blocks.redstone_block); } + + @Override + public void breakBlock(World world, int x, int y, int z, Block p_149749_5_, int meta) { + TileEntity tile = world.getTileEntity(x, y, z); + TileInvisibleMultiblock thisTile = (tile != null && tile instanceof TileInvisibleMultiblock) ? (TileInvisibleMultiblock) tile : null; + if (thisTile != null && thisTile.getMaster() != null && thisTile.getMaster().isOnline()) + { + world.setBlockMetadataWithNotify(x, y, z, 0, 2); + + thisTile.getMaster().isStructureStillValid(true); + } + super.breakBlock(world, x, y, z, p_149749_5_, meta); + } + + @Override + public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { + int meta = world.getBlockMetadata(x, y, z); + if (meta == 0 || meta == 1) { + TileInvisibleMultiblock thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileInvisibleMultiblock) ? (TileInvisibleMultiblock) world.getTileEntity(x, y, z) : null; + if (thisTile != null && thisTile.getMaster() != null) { + return AxisAlignedBB.getBoundingBox(thisTile.getMaster().xCoord, thisTile.getMaster().yCoord, thisTile.getMaster().zCoord, thisTile.getMaster().xCoord + 0.5, thisTile.getMaster().yCoord + 0.5, thisTile.getMaster().zCoord + 0.5); + } + return super.getSelectedBoundingBoxFromPool(world, x, y, z); + }else if (meta == 2) { + return AxisAlignedBB.getBoundingBox(x + 0.49, y + 0.49, z + 0.49, x + 0.51, y + 0.51, z + 0.51); + } + return super.getSelectedBoundingBoxFromPool(world, x, y, z); + } + + } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/handler/ParticleHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/core/handler/ParticleHandler.java index 1f1e4810..66e042eb 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/handler/ParticleHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/handler/ParticleHandler.java @@ -1,10 +1,13 @@ package com.brandon3055.draconicevolution.common.core.handler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.world.World; import com.brandon3055.draconicevolution.client.render.DistortionParticle; +@SideOnly(Side.CLIENT) public class ParticleHandler { private static Minecraft mc = Minecraft.getMinecraft(); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/ClientProxy.java b/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/ClientProxy.java index 933b67ca..a0090d8d 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/ClientProxy.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/ClientProxy.java @@ -4,6 +4,8 @@ import com.brandon3055.draconicevolution.client.render.*; import com.brandon3055.draconicevolution.common.tileentities.TileCustomSpawner; import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser; import com.brandon3055.draconicevolution.common.tileentities.TileTestBlock; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore; import net.minecraft.client.renderer.tileentity.TileEntityMobSpawnerRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.Item; @@ -67,5 +69,11 @@ public class ClientProxy extends CommonProxy { render = new TestBlockRenderer(); ClientRegistry.bindTileEntitySpecialRenderer(TileTestBlock.class, render); + + render = new EnergyStorageCoreRenderer(); + ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyStorageCore.class, render); + + render = new EnergyPylonRenderer(); + ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyPylon.class, render); } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/CommonProxy.java b/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/CommonProxy.java index 86e29a6c..fb235305 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/CommonProxy.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/CommonProxy.java @@ -5,6 +5,7 @@ import com.brandon3055.draconicevolution.common.core.network.*; import com.brandon3055.draconicevolution.common.entity.EntityCustomDragon; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.tileentities.*; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileInvisibleMultiblock; import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator; @@ -66,6 +67,7 @@ public class CommonProxy { GameRegistry.registerTileEntity(TileGenerator.class, "TileGenerator"); GameRegistry.registerTileEntity(TileEnergyStorageCore.class, "TileEnergyStorageCore"); GameRegistry.registerTileEntity(TileInvisibleMultiblock.class, "TileInvisibleMultiblock"); + GameRegistry.registerTileEntity(TileEnergyPylon.class, "TileEnergyPylon"); if(DraconicEvolution.debug) GameRegistry.registerTileEntity(TileTestBlock.class, "TileTestBlock"); } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/utills/Utills.java b/src/main/java/com/brandon3055/draconicevolution/common/core/utills/Utills.java index 85953c41..3c60648d 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/utills/Utills.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/utills/Utills.java @@ -8,5 +8,17 @@ import net.minecraft.world.World; */ public class Utills { + public static String formatNumber(double value){ + if (value < 1000D) + return String.valueOf(value); + else if (value < 1000000D) + return String.valueOf(Math.round(value/10D)/100D) + "K"; + else if (value < 1000000000D) + return String.valueOf(Math.round(value/10000D)/100D) + "M"; + else if (value < 1000000000000D) + return String.valueOf(Math.round(value/10000000D)/100D) + "B"; + else + return String.valueOf(Math.round(value/10000000000D)/100D) + "T"; + } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/lib/Strings.java b/src/main/java/com/brandon3055/draconicevolution/common/lib/Strings.java index 66835e23..c3570f87 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/lib/Strings.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/lib/Strings.java @@ -50,4 +50,5 @@ public class Strings {// public sta public static final String energyStorageCoreName = "energyStorageCore"; public static final String draconiumName = "draconium"; public static final String invisibleMultiblockName = "invisibleMultiblock"; + public static final String energyPylonName = "energyPylon"; } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileParticleGenerator.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileParticleGenerator.java index adac4ad0..1cdf1703 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileParticleGenerator.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileParticleGenerator.java @@ -2,6 +2,10 @@ package com.brandon3055.draconicevolution.common.tileentities; import java.util.Random; +import com.brandon3055.draconicevolution.client.render.Particles; +import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper.TileLocation; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.nbt.NBTTagCompound; @@ -11,9 +15,10 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import com.brandon3055.draconicevolution.client.render.CustomParticle; import com.brandon3055.draconicevolution.common.core.handler.ParticleHandler; +import net.minecraft.util.AxisAlignedBB; +import org.lwjgl.opengl.GL11; -public class TileParticleGenerator extends TileEntity -{ +public class TileParticleGenerator extends TileEntity { public int red = 0; public int green = 0; public int blue = 0; @@ -45,26 +50,29 @@ public class TileParticleGenerator extends TileEntity public boolean active = true; public boolean signal = false; public boolean inverted = false; - - + TileLocation master = new TileLocation(); + public float rotation = 0; + public boolean stabalizerMode = false; + private int tick = 0; @SideOnly(Side.CLIENT) @Override - public void updateEntity() - { - if (signal && !inverted) - active = true; - else if (!signal && inverted) - active = true; - else - active = false; - - if (tick >= spawn_rate && active) - { + public void updateEntity() { + + if (stabalizerMode && worldObj.isRemote) { + rotation += 0.5F; + spawnStabilizerParticle(); + } + if (stabalizerMode) return; + + if (signal && !inverted) active = true; + else if (!signal && inverted) active = true; + else active = false; + + if (tick >= spawn_rate && active) { tick = 0; - if (worldObj.isRemote) - { + if (worldObj.isRemote) { Random rand = worldObj.rand; float MX = motion_x + (random_motion_x * rand.nextFloat()); @@ -86,33 +94,54 @@ public class TileParticleGenerator extends TileEntity ParticleHandler.spawnCustomParticle(particle); } - } - else - tick++; + } else tick++; } - - public void toggleInverted(){ + + @SideOnly(Side.CLIENT) + private void spawnStabilizerParticle(){ + if (getMaster() == null || worldObj.getTotalWorldTime() % (20) != 1) return; + + double x = xCoord + 0.5; + double y = yCoord + 0.5; + double z = zCoord + 0.5; + int direction = 0; + + if (getMaster().xCoord > xCoord) + direction = 0; + else if (getMaster().xCoord < xCoord) + direction = 1; + else if (getMaster().zCoord > zCoord) + direction = 2; + else if (getMaster().zCoord < zCoord) + direction = 3; + + Particles.EnergyBeamParticle particle = new Particles.EnergyBeamParticle(worldObj, x, y, z, getMaster().xCoord + 0.5, getMaster().zCoord + 0.5, direction, false); + Particles.EnergyBeamParticle particle2 = new Particles.EnergyBeamParticle(worldObj, x, y, z, getMaster().xCoord + 0.5, getMaster().zCoord + 0.5, direction, true); + ParticleHandler.spawnCustomParticle(particle, 60); + ParticleHandler.spawnCustomParticle(particle2, 60); + } + + public void toggleInverted() { inverted = !inverted; } @Override - public Packet getDescriptionPacket() - { + public Packet getDescriptionPacket() { NBTTagCompound tagCompound = new NBTTagCompound(); this.writeToNBT(tagCompound); return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tagCompound); } @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) - { + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.func_148857_g()); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } @Override - public void writeToNBT(NBTTagCompound compound) - { + public void writeToNBT(NBTTagCompound compound) { + master.writeToNBT(compound, "Key"); + compound.setBoolean("StabalizerMode", stabalizerMode); compound.setInteger("Red", red); compound.setInteger("Green", green); compound.setInteger("Blue", blue); @@ -143,14 +172,15 @@ public class TileParticleGenerator extends TileEntity compound.setFloat("Gravity", gravity); compound.setBoolean("Active", active); compound.setBoolean("Signal", signal); - compound.setBoolean("Inverted", inverted); + compound.setBoolean("Inverted", inverted); super.writeToNBT(compound); } @Override - public void readFromNBT(NBTTagCompound compound) - { + public void readFromNBT(NBTTagCompound compound) { + master.readFromNBT(compound, "Key"); + stabalizerMode = compound.getBoolean("StabalizerMode"); red = compound.getInteger("Red"); green = compound.getInteger("Green"); blue = compound.getInteger("Blue"); @@ -181,9 +211,23 @@ public class TileParticleGenerator extends TileEntity gravity = compound.getFloat("Gravity"); active = compound.getBoolean("Active"); signal = compound.getBoolean("Signal"); - inverted = compound.getBoolean("Inverted"); + inverted = compound.getBoolean("Inverted"); super.readFromNBT(compound); } + public TileEnergyStorageCore getMaster() { + if (master == null) return null; + TileEnergyStorageCore tile = (worldObj.getTileEntity(master.getXCoord(), master.getYCoord(), master.getZCoord()) != null && worldObj.getTileEntity(master.getXCoord(), master.getYCoord(), master.getZCoord()) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore) worldObj.getTileEntity(master.getXCoord(), master.getYCoord(), master.getZCoord()) : null; + return tile; + } + + public void setMaster(TileLocation master) { + this.master = master; + } + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return INFINITE_EXTENT_AABB; + } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyPylon.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyPylon.java new file mode 100644 index 00000000..586d9c0c --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyPylon.java @@ -0,0 +1,277 @@ +package com.brandon3055.draconicevolution.common.tileentities.multiblocktiles; + +import cofh.api.energy.EnergyStorage; +import cofh.api.energy.IEnergyHandler; +import com.brandon3055.draconicevolution.client.render.Particles; +import com.brandon3055.draconicevolution.common.blocks.ModBlocks; +import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper.TileLocation; +import com.brandon3055.draconicevolution.common.core.handler.ParticleHandler; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.EntityLiving; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +/** + * Created by Brandon on 28/07/2014. + */ +public class TileEnergyPylon extends TileEntity implements IEnergyHandler { + + protected EnergyStorage storage = new EnergyStorage(500000, 0, 0); + public boolean active = false; + public boolean input = false; + public float modelRotation = 0; + public float modelScale = 0; + private TileLocation masterLocation = new TileLocation(); + private int particleRate = 0; + private int updateDelay = 0; + private boolean nextUpdate = false; + + + @Override + public void updateEntity() { + if (nextUpdate) { + updateDelay = 0; + nextUpdate = false; + } + if (active && worldObj.isRemote) { + modelRotation += 1.5; + modelScale += input ? -0.01F : 0.01F; + if ((modelScale < 0 && input)) modelScale = 10000F; + if ((modelScale < 0 && !input)) modelScale = 0F; + spawnParticles(); + } else if (worldObj.isRemote) modelScale = 0.5F; + if (active && input){ + updateInput(); + }else if (active){ + updateOutput(); + } + } + + public void onActivated(){ + if (!active){ + active = isValidStructure(); + findMaster(); + return; + } + findMaster(); + if (input){ + storage.setMaxReceive(0); + storage.setMaxExtract(500000); + }else{ + storage.setMaxReceive(500000); + storage.setMaxExtract(0); + } + } + //input from core out to acceptors + private void updateInput(){ + if (updateDelay > 0){ + updateDelay--; + if (particleRate > 0) particleRate--; + }else if (getMaster() != null && getMaster().isOnline() && storage.getEnergyStored() < storage.getMaxEnergyStored() && getMaster().getEnergyStored() > 0) { + int maxRecived = (int)Math.min(storage.getMaxEnergyStored() - storage.getEnergyStored(), getMaster().getEnergyStored()); + storage.modifyEnergyStored(maxRecived); + getMaster().extractEnergy(maxRecived, false); + if (particleRate < 10) particleRate++; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + }else { + if (particleRate > 0) particleRate--; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + updateDelay = 20; + } + if ((storage.getEnergyStored() > 0)) { + for (int i = 0; i < 6; i++){ + TileEntity tile = worldObj.getTileEntity(xCoord + ForgeDirection.getOrientation(i).offsetX, yCoord + ForgeDirection.getOrientation(i).offsetY, zCoord + ForgeDirection.getOrientation(i).offsetZ); + if (tile != null && tile instanceof IEnergyHandler) { + storage.extractEnergy(((IEnergyHandler)tile).receiveEnergy(ForgeDirection.getOrientation(i).getOpposite(), storage.extractEnergy(storage.getMaxExtract(), true), false), false); + } + } + } + } + //output to core in from generators + private void updateOutput(){ + if (getMaster() == null || !getMaster().isOnline()) return; + if (updateDelay > 0){ + updateDelay--; + if (particleRate > 0) particleRate--; + }else if (storage.getEnergyStored() > 0 && getMaster().isOnline() && getMaster().getEnergyStored() < getMaster().getMaxEnergyStored()){ + int maxSent = (int)Math.min(getMaster().getMaxEnergyStored() - getMaster().getEnergyStored(), storage.getEnergyStored()); + storage.modifyEnergyStored(-maxSent); + getMaster().receiveEnergy(maxSent, false); + + if (particleRate < 10) particleRate++; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + }else { + if (particleRate > 0) particleRate--; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + updateDelay = 20; + } + } + + private TileEnergyStorageCore getMaster(){ + return (worldObj.getTileEntity(masterLocation.getXCoord(), masterLocation.getYCoord(), masterLocation.getZCoord()) != null && worldObj.getTileEntity(masterLocation.getXCoord(), masterLocation.getYCoord(), masterLocation.getZCoord()) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore)worldObj.getTileEntity(masterLocation.getXCoord(), masterLocation.getYCoord(), masterLocation.getZCoord()) : null; + } + + private void findMaster(){ + int yMod = worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1 ? 3 : -3; + int range = 15; + for (int x = xCoord-range; x <= xCoord+range; x++){ + for (int y = yCoord+yMod-(range/2); y <= yCoord+yMod+(range/2); y++){ + for (int z = zCoord-range; z <= zCoord+range; z++){ + if (worldObj.getBlock(x, y, z) == ModBlocks.energyStorageCore){ + masterLocation = new TileLocation(x, y, z); + return; + } + } + } + + } + } + + @SideOnly(Side.CLIENT) + private void spawnParticles(){ + Random rand = new Random(); + int x = masterLocation.getXCoord(); + int y = masterLocation.getYCoord(); + int z = masterLocation.getZCoord(); + int cYCoord = worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1 ? yCoord+1 : yCoord-1; + TileEnergyStorageCore master = (worldObj.getTileEntity(x, y, z) != null && worldObj.getTileEntity(x, y, z) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore) worldObj.getTileEntity(x, y, z) : null; + if (master == null || !master.isOnline()) return; + float disMod = master.getTier()==0 ? 0.5F : master.getTier()==1 ? 1F: master.getTier()==2 ? 1F : master.getTier()==3 ? 2F : master.getTier()==4 ? 2F : master.getTier()==5 ? 3F : 4F; + double spawnX; + double spawnY; + double spawnZ; + double targetX; + double targetY; + double targetZ; + if (input){ + spawnX = x+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + spawnY = y+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + spawnZ = z+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + targetX = xCoord + 0.5; + targetY = cYCoord + 0.5; + targetZ = zCoord + 0.5; + if (rand.nextFloat() < 0.1F) { + Particles.EnergyTransferParticle passiveParticle = new Particles.EnergyTransferParticle(worldObj, spawnX, spawnY, spawnZ, targetX, targetY, targetZ, true); + ParticleHandler.spawnCustomParticle(passiveParticle, 50); + } + if (particleRate > 0){ + if (particleRate > 10) particleRate = 10; + for (int i = 0; i <= particleRate; i++){ + spawnX = x+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + spawnY = y+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + spawnZ = z+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + Particles.EnergyTransferParticle passiveParticle = new Particles.EnergyTransferParticle(worldObj, spawnX, spawnY, spawnZ, targetX, targetY, targetZ, false); + ParticleHandler.spawnCustomParticle(passiveParticle, 50); + } + } + + }else { + targetX = x+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + targetY = y+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + targetZ = z+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + spawnX = xCoord + 0.5; + spawnY = cYCoord + 0.5; + spawnZ = zCoord + 0.5; + if (rand.nextFloat() < 0.1F) { + Particles.EnergyTransferParticle passiveParticle = new Particles.EnergyTransferParticle(worldObj, spawnX, spawnY, spawnZ, targetX, targetY, targetZ, true); + ParticleHandler.spawnCustomParticle(passiveParticle, 50); + } + if (particleRate > 0){ + if (particleRate > 10) particleRate = 10; + for (int i = 0; i <= particleRate; i++){ + targetX = x+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + targetY = y+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + targetZ = z+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + Particles.EnergyTransferParticle passiveParticle = new Particles.EnergyTransferParticle(worldObj, spawnX, spawnY, spawnZ, targetX, targetY, targetZ, false); + ParticleHandler.spawnCustomParticle(passiveParticle, 50); + } + } + } + } + + private boolean isValidStructure(){ + return (isGlass(xCoord, yCoord+1, zCoord) || isGlass(xCoord, yCoord-1, zCoord)) && (!isGlass(xCoord, yCoord+1, zCoord) || !isGlass(xCoord, yCoord-1, zCoord)); + } + + private boolean isGlass(int x, int y, int z){ + return worldObj.getBlock(x, y, z) == ModBlocks.invisibleMultiblock && worldObj.getBlockMetadata(x, y, z) == 2; + } + + @Override + public void readFromNBT(NBTTagCompound compound) { + super.readFromNBT(compound); + storage.readFromNBT(compound); + active = compound.getBoolean("Active"); + input = compound.getBoolean("Input"); + masterLocation.readFromNBT(compound, "Master"); + particleRate = compound.getShort("ParticleRate"); + } + + @Override + public void writeToNBT(NBTTagCompound compound) { + + super.writeToNBT(compound); + storage.writeToNBT(compound); + compound.setBoolean("Active", active); + compound.setBoolean("Input", input); + masterLocation.writeToNBT(compound, "Master"); + compound.setShort("ParticleRate", (short)particleRate); + } + + @Override + public Packet getDescriptionPacket(){ + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + } + + /* IEnergyHandler */ + @Override + public boolean canConnectEnergy(ForgeDirection from) { + return true; + } + + @Override + public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { + nextUpdate = true; + return storage.receiveEnergy(maxReceive, simulate); + } + + @Override + public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { + nextUpdate = true; + return storage.extractEnergy(maxExtract, simulate); + } + + @Override + public int getEnergyStored(ForgeDirection from) { + return storage.getEnergyStored(); + } + + @Override + public int getMaxEnergyStored(ForgeDirection from) { + return storage.getMaxEnergyStored(); + } + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return INFINITE_EXTENT_AABB; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyStorageCore.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyStorageCore.java index 8c764566..721f7bf9 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyStorageCore.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyStorageCore.java @@ -5,29 +5,42 @@ import cofh.api.energy.IEnergyHandler; import com.brandon3055.draconicevolution.common.blocks.ModBlocks; import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper.TileLocation; import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; /** * Created by Brandon on 25/07/2014. */ -public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler { +public class TileEnergyStorageCore extends TileEntity { - protected EnergyStorage storage = new EnergyStorage(1000000, 1000000, 1000000); protected TileLocation[] stabilizers = new TileLocation[4]; - protected int tier = 6; + protected int tier = 0; protected boolean online = false; + public float modelRotation = 0; + private double energy = 0; + private double capacity = 0; + private int maxReceive = 1000000; + private int maxExtract = 1000000; + public TileEnergyStorageCore(){ + for (int i = 0; i < stabilizers.length; i++) + { + stabilizers[i] = new TileLocation(); + } + } + @Override public void updateEntity() { - if (tier != 6) - LogHelper.info(tier); + if (!online) return; + if (worldObj.isRemote) modelRotation += 0.5; } @@ -39,51 +52,109 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler if (!findStabalyzers()) return false; if (!setTier(false)) return false; if (!testOrActivateStructureIfValid(false, false)) return false; - if (!testOrActivateStructureIfValid(false, true)) return false; - //LogHelper.info(testOrActivateStructureIfValid(false, true)); - + online = true; + if (!testOrActivateStructureIfValid(false, true)) { + online = false; + deactivateStabilizers(); + return false; + } + activateStabilizers(); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); return true; } - public boolean isStructureStillValid(){ + public boolean creativeActivate() { + if (!findStabalyzers()) return false; + if (!setTier(false)) return false; + if (!testOrActivateStructureIfValid(true, false)) return false; + online = true; + if (!testOrActivateStructureIfValid(false, true)) { + online = false; + deactivateStabilizers(); + return false; + } + activateStabilizers(); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); return true; } + public boolean isStructureStillValid(boolean update){ + if (!checkStabilizers()) online = false; + if (!testOrActivateStructureIfValid(false, false)) online = false; + if (!areStabilizersActive()) online = false; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + if (!online) deactivateStabilizers(); + if (update && !online) reIntegrate(); + //if (update && !online && worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) != null && worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) instanceof TileInvisibleMultiblock) ((TileInvisibleMultiblock)worldObj.getTileEntity(xCoord, yCoord + 1, zCoord)).isStructureStillValid(); + return online; + } + + private void reIntegrate(){ + for (int x = xCoord - 1; x <= xCoord + 1; x++) { + for (int y = yCoord - 1; y <= yCoord + 1; y++) { + for (int z = zCoord - 1; z <= zCoord + 1; z++) { + if (worldObj.getBlock(x, y, z) == ModBlocks.invisibleMultiblock) + { + if (worldObj.getBlockMetadata(x, y, z) == 0) worldObj.setBlock(x, y, z, ModBlocks.draconium); + else if (worldObj.getBlockMetadata(x, y, z) == 1) worldObj.setBlock(x, y, z, Blocks.redstone_block); + } + } + } + } + } + private boolean findStabalyzers() { + boolean flag = true; for (int x = xCoord; x <= xCoord + 11; x++) { if (worldObj.getBlock(x, yCoord, zCoord) == ModBlocks.particleGenerator) { + if (worldObj.getBlockMetadata(x, yCoord, zCoord) == 1) { + flag = false; + break; + } stabilizers[0] = new TileLocation(x, yCoord, zCoord); break; } else if (x == xCoord + 11) { - return false; + flag = false; } } for (int x = xCoord; x >= xCoord - 11; x--) { if (worldObj.getBlock(x, yCoord, zCoord) == ModBlocks.particleGenerator) { + if (worldObj.getBlockMetadata(x, yCoord, zCoord) == 1) { + flag = false; + break; + } stabilizers[1] = new TileLocation(x, yCoord, zCoord); break; } else if (x == xCoord - 11) { - return false; + flag = false; } } for (int z = zCoord; z <= zCoord + 11; z++) { if (worldObj.getBlock(xCoord, yCoord, z) == ModBlocks.particleGenerator) { + if (worldObj.getBlockMetadata(xCoord, yCoord, z) == 1) { + flag = false; + break; + } stabilizers[2] = new TileLocation(xCoord, yCoord, z); break; } else if (z == zCoord + 11) { - return false; + flag = false; } } for (int z = zCoord; z >= zCoord - 11; z--) { if (worldObj.getBlock(xCoord, yCoord, z) == ModBlocks.particleGenerator) { + if (worldObj.getBlockMetadata(xCoord, yCoord, z) == 1) { + flag = false; + break; + } stabilizers[3] = new TileLocation(xCoord, yCoord, z); break; } else if (z == zCoord - 11) { - return false; + flag = false; } } - return true; + return flag; } private boolean setTier(boolean force) { @@ -106,7 +177,6 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler for (int x = 0; x <= range; x++) { if (testForOrActivateDraconium(xCoord - x, yCoord, zCoord, false, false)) { xNeg = x; - if (xNeg != xPos) return false; break; } } @@ -114,7 +184,6 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler for (int y = 0; y <= range; y++) { if (testForOrActivateDraconium(xCoord, yCoord + y, zCoord, false, false)) { yPos = y; - if (yPos != xNeg) return false; break; } } @@ -122,7 +191,6 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler for (int y = 0; y <= range; y++) { if (testForOrActivateDraconium(xCoord, yCoord - y, zCoord, false, false)) { yNeg = y; - if (yNeg != yPos) return false; break; } } @@ -130,7 +198,6 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler for (int z = 0; z <= range; z++) { if (testForOrActivateDraconium(xCoord, yCoord, zCoord + z, false, false)) { zPos = z; - if (zPos != yNeg) return false; break; } } @@ -138,17 +205,16 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler for (int z = 0; z <= range; z++) { if (testForOrActivateDraconium(xCoord, yCoord, zCoord - z, false, false)) { zNeg = z; - if (zNeg != zPos) return false; break; } } + if (zNeg != zPos || zNeg != yNeg || zNeg != yPos || zNeg != xNeg || zNeg != xPos) return false; tier = xPos; if (tier > 1) tier++; if (tier == 1){ if (testForOrActivateDraconium(xCoord + 1, yCoord + 1, zCoord, false, false)) tier = 2; } - //LogHelper.info(""+tier); return true; } @@ -521,6 +587,99 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler return online; } + private void activateStabilizers(){ + for (int i = 0; i < stabilizers.length; i++) + { + if (stabilizers[i] == null){ + LogHelper.error("activateStabilizers stabalizers["+i+"] == null!!!"); + return; + } + TileParticleGenerator tile = (worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) != null && worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) instanceof TileParticleGenerator) ? (TileParticleGenerator) worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) : null; + if (tile == null) + { + LogHelper.error("Missing Tile Entity (Particle Generator)"); + return; + } + tile.stabalizerMode = true; + tile.setMaster(new TileLocation(xCoord, yCoord, zCoord)); + worldObj.setBlockMetadataWithNotify(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord(), 1, 2); + } + double capacity = 0; + switch (tier){ + case 0: + capacity = 45500000D; + break; + case 1: + capacity = 273000000D; + break; + case 2: + capacity = 1640000000D; + break; + case 3: + capacity = 9880000000D; + break; + case 4: + capacity = 59300000000D; + break; + case 5: + capacity = 356000000000D; + break; + case 6: + capacity = 2140000000000D; + break; + } + this.capacity = capacity; + } + + public void deactivateStabilizers(){ + for (int i = 0; i < stabilizers.length; i++) + { + if (stabilizers[i] == null){ + LogHelper.error("activateStabilizers stabalizers["+i+"] == null!!!"); + }else { + TileParticleGenerator tile = (worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) != null && worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) instanceof TileParticleGenerator) ? (TileParticleGenerator) worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) : null; + if (tile == null) { + //LogHelper.error("Missing Tile Entity (Particle Generator)"); + }else { + tile.stabalizerMode = false; + worldObj.setBlockMetadataWithNotify(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord(), 0, 2); + } + } + } + } + + private boolean areStabilizersActive(){ + for (int i = 0; i < stabilizers.length; i++) + { + if (stabilizers[i] == null){ + LogHelper.error("activateStabilizers stabalizers["+i+"] == null!!!"); + return false; + } + TileParticleGenerator tile = (worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) != null && worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) instanceof TileParticleGenerator) ? (TileParticleGenerator) worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) : null; + if (tile == null) + { + //LogHelper.error("Missing Tile Entity (Particle Generator)"); + return false; + } + if (!tile.stabalizerMode || worldObj.getBlockMetadata(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) != 1) return false; + } + return true; + } + + private boolean checkStabilizers(){ + for (int i = 0; i < stabilizers.length; i++) + { + if (stabilizers[i] == null) return false; + TileParticleGenerator gen = (worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) != null && worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) instanceof TileParticleGenerator) ? (TileParticleGenerator)worldObj.getTileEntity(stabilizers[i].getXCoord(), stabilizers[i].getYCoord(), stabilizers[i].getZCoord()) : null; + if (gen == null || !gen.stabalizerMode) return false; + if (gen.getMaster().xCoord != xCoord || gen.getMaster().yCoord != yCoord || gen.getMaster().zCoord != zCoord) return false; + } + return true; + } + + public int getTier(){ + return tier; + } /** * ############################################################### */ @@ -528,8 +687,10 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler @Override public void writeToNBT(NBTTagCompound compound) { - storage.writeToNBT(compound); super.writeToNBT(compound); + compound.setBoolean("Online", online); + compound.setShort("Tier", (short)tier); + compound.setDouble("Energy", energy); for (int i = 0; i < stabilizers.length; i++){ if (stabilizers[i] != null) stabilizers[i].writeToNBT(compound, String.valueOf(i)); @@ -538,12 +699,39 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler @Override public void readFromNBT(NBTTagCompound compound) { - storage.readFromNBT(compound); - super.readFromNBT(compound); + online = compound.getBoolean("Online"); + tier = (int)compound.getShort("Tier"); + energy = compound.getDouble("Energy"); for (int i = 0; i < stabilizers.length; i++){ if (stabilizers[i] != null) stabilizers[i].readFromNBT(compound, String.valueOf(i)); } + double capacity = 0; + switch (tier){ + case 0: + capacity = 45500000D;//000 + break; + case 1: + capacity = 273000000D;//000 + break; + case 2: + capacity = 1640000000D;//000 + break; + case 3: + capacity = 9880000000D;//000 + break; + case 4: + capacity = 59300000000D;//000 + break; + case 5: + capacity = 356000000000D;//000 + break; + case 6: + capacity = 2140000000000D;//000 + break; + } + this.capacity = capacity; + super.readFromNBT(compound); } @Override @@ -558,31 +746,37 @@ public class TileEnergyStorageCore extends TileEntity implements IEnergyHandler readFromNBT(pkt.func_148857_g()); } - /* IEnergyHandler */ - @Override - public boolean canConnectEnergy(ForgeDirection from) { - return true; + /* EnergyHandler */ + + public int receiveEnergy(int maxReceive, boolean simulate) { + double energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); + + if (!simulate) { + energy += energyReceived; + } + return (int)energyReceived; } - @Override - public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { - - return storage.receiveEnergy(maxReceive, simulate); - } - - @Override - public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { + public int extractEnergy(int maxExtract, boolean simulate) { worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - return storage.extractEnergy(maxExtract, simulate); + double energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); + + if (!simulate) { + energy -= energyExtracted; + } + return (int)energyExtracted; + } + + public double getEnergyStored() { + return energy; + } + + public double getMaxEnergyStored() { + return capacity; } @Override - public int getEnergyStored(ForgeDirection from) { - return storage.getEnergyStored(); - } - - @Override - public int getMaxEnergyStored(ForgeDirection from) { - return storage.getMaxEnergyStored(); + public AxisAlignedBB getRenderBoundingBox() { + return INFINITE_EXTENT_AABB; } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileInvisibleMultiblock.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileInvisibleMultiblock.java index 8275938a..df9b8b26 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileInvisibleMultiblock.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileInvisibleMultiblock.java @@ -1,18 +1,21 @@ package com.brandon3055.draconicevolution.common.tileentities.multiblocktiles; +import com.brandon3055.draconicevolution.common.blocks.ModBlocks; import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper.TileLocation; import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; /** * Created by Brandon on 26/07/2014. */ public class TileInvisibleMultiblock extends TileEntity { - public TileLocation master; + public TileLocation master = new TileLocation(); public boolean isMasterOnline() { TileEnergyStorageCore tile = (worldObj.getTileEntity(master.getXCoord(), master.getYCoord(), master.getZCoord()) != null && worldObj.getTileEntity(master.getXCoord(), master.getYCoord(), master.getZCoord()) instanceof TileEnergyStorageCore) ? (TileEnergyStorageCore) worldObj.getTileEntity(master.getXCoord(), master.getYCoord(), master.getZCoord()) : null; @@ -31,13 +34,15 @@ public class TileInvisibleMultiblock extends TileEntity { @Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); - master.writeToNBT(compound, "Key"); + //if (master != null) + master.writeToNBT(compound, "Key"); } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); - master.readFromNBT(compound, "Key"); + //if (master != null) + master.readFromNBT(compound, "Key"); } @Override @@ -52,4 +57,20 @@ public class TileInvisibleMultiblock extends TileEntity { readFromNBT(pkt.func_148857_g()); } + public void isStructureStillValid(){ + if (getMaster() == null) { + LogHelper.error("{Tile} Master = null reverting!"); + revert(); + return; + } + if (!getMaster().isOnline()) revert(); + } + + private void revert(){ + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + if (meta == 0) + worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.draconium); + else if (meta == 1) + worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.redstone_block); + } } diff --git a/src/main/resources/assets/draconicevolution/models/power_sphere_layer_2.obj b/src/main/resources/assets/draconicevolution/models/pylon_sphere.obj similarity index 100% rename from src/main/resources/assets/draconicevolution/models/power_sphere_layer_2.obj rename to src/main/resources/assets/draconicevolution/models/pylon_sphere.obj diff --git a/src/main/resources/assets/draconicevolution/models/stabilizer_sphere.obj b/src/main/resources/assets/draconicevolution/models/stabilizer_sphere.obj new file mode 100644 index 00000000..62dd9430 --- /dev/null +++ b/src/main/resources/assets/draconicevolution/models/stabilizer_sphere.obj @@ -0,0 +1,41 @@ +# Blender v2.70 (sub 0) OBJ File: 'stabilizer_sphere.blend' +# www.blender.org +mtllib stabilizer_sphere.mtl +o Icosphere +v 0.000000 -1.000000 0.000000 +v 0.723600 -0.447215 0.525720 +v -0.276385 -0.447215 0.850640 +v -0.894425 -0.447215 0.000000 +v -0.276385 -0.447215 -0.850640 +v 0.723600 -0.447215 -0.525720 +v 0.276385 0.447215 0.850640 +v -0.723600 0.447215 0.525720 +v -0.723600 0.447215 -0.525720 +v 0.276385 0.447215 -0.850640 +v 0.894425 0.447215 0.000000 +v 0.000000 1.000000 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +usemtl None +s off +f 1/1 2/2 3/3 +f 2/1 1/2 6/3 +f 1/1 3/2 4/3 +f 1/1 4/2 5/3 +f 1/1 5/2 6/3 +f 2/1 6/2 11/3 +f 3/1 2/2 7/3 +f 4/1 3/2 8/3 +f 5/1 4/2 9/3 +f 6/1 5/2 10/3 +f 2/1 11/2 7/3 +f 3/1 7/2 8/3 +f 4/1 8/2 9/3 +f 5/1 9/2 10/3 +f 6/1 10/2 11/3 +f 7/1 11/2 12/3 +f 8/1 7/2 12/3 +f 9/1 8/2 12/3 +f 10/1 9/2 12/3 +f 11/1 10/2 12/3 diff --git a/src/main/resources/assets/draconicevolution/textures/blocks/energy_pylon_active_face.png b/src/main/resources/assets/draconicevolution/textures/blocks/energy_pylon_active_face.png new file mode 100644 index 0000000000000000000000000000000000000000..696b981de25898ce4608d777109ca55df47cec30 GIT binary patch literal 6127 zcmV5jTz2P)+~<7ko)X zK~#9!t()7AXW4bvKWpuMewVs-^=*1CZhM%q9dHb>01F{GKoE=*Kv5#W3rLYr9*~d_ zL=aiZKhRi-cn!Se0bU}MNRdH-AWRg2AR!o>3r=I%X6R1Obaz$P?RPt8uf@aO`OqQgSC@C3B5iU1Y~XBZxBR)e;iU52gsKrDG?NCIPf3#R6kVVr zv1k_@uTGg9U1QxeL}?Illz;|BG;ar0MF@z5qJV&>Q1)@zGF3RqE?hUTqeCpoQK0Vp z;w6fsSwExqa~v=b%L2J%;am|CX5c0mhINJ|$K6PlFcQ#$7;$3kUY}vEB)~DE0OpVk zx(+tMP=kaJM6>Xnq7qQaf{O&y0}!&%Ddd3WIc`*c%`R-ccqql{j$oJw;*PuafimxD zhOOgy>mdplE(XaXwCf!7UEk%jh?M-R)U(T5eK; zU%xeKl((|&5{cBupt{rYZq%~Q{C>>axjs=b&&dLBP$J?Hk%$lx583@aAYRhrbFb>N zqo2o@XW>JM1Gr%xNXfHD`GpKPx~CM+3Hd`&s(QR=*EM^VNJ2CrrlhJwbu@yjmI#uA zZp`acM6_r)AY_*hG9gHV5|C0Gh=&q?_0r<<_0PZkcR6YwpoFsjhHI+Z{G+#iv1AED zisBtXL~(cS-Txwj5+u_3=EC1Ak)QtLSNg2dtEgrTaYPi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rXN^ut~lB5>ARU#H_^m=tm%%FGd=3y zilLxItE3K_utP(O#-2Fzpc|5Gn5VAfDyO!zwVZhsIMnaC9-EbVfXcj{Axg@;ETo)? zSxM?dywFyHkn_yN@+~wTPJ_kTb01{0bqI1Hs1ZXs=qLg~9Z@5N#4cxinwe!`YYXRt za}HqBKG}7Lh+|SnJ4w#?-~#)TnIDo@xc%I=Kw>I@B$5x9 z&17nllX{TqcyPSjc&m^UVl?_bbFwlvov~`2E_xwbamG~htvewcj=36hk|K<#pjc2p z9%DNWnqE$!YDo0`0;5msa z@nat&9yGfJKB}j-t?KyvdM1}c)8kSsO(~l(I8mLT_1v$(VlZcc1x76fX~H3P50aeg z&}pI*)G!mWDJj?E8Y%>-Cqt|3zY)kLG||xD#88?gLn;wltHjX@yv{HOxh!0zGv0hR dG5ybl{|DR!#`B^Ow0{5q002ovPDHLkV1k7d&8PqX literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/draconicevolution/textures/models/ParticleGenTextureSheet.png b/src/main/resources/assets/draconicevolution/textures/models/ParticleGenTextureSheet.png index 64b696849fb8d9c94b8ad1e7bf20401000309a9e..5aeda8f72582eb54668f10ddfc682eb4ff42eb45 100644 GIT binary patch delta 442 zcmV;r0Y(1n1F8g&QV9nd2RRW49|zfyTP%N$Nkl6bA6GMM+2usmsQ$ z-LYcp#=TxZjzGLZFVS!XTm-o>QFb`C;H?|7Eo;4ADk0hH1K#uf@t+cp?48 z)S@gDxuPij-r{_1UgGC5pyYUY&92XpAd0j3WVZ1FSle!abJYT0_BI9%YSLl`@#p$ zkm3h0vv|Gdx$`FJwVZ$bwYR_h0H=nBn+d9SL!4g0Je?-YJN86GL_|bHL_{V;L_|bH kL_|bHL_|bHM6}~R0ELVih<{u!$N&HU07*qoM6N<$f*E(#TL1t6 delta 378 zcmV-=0fqjm1nUEkQV9kX11LCqel4GoTP%N1Nkl-;tIJ$)GHvSN>!(b0d?XEup_Y|bs#J}hPc5A0jV^!RQ~@YD=)4a`PqJs z=Hu9UabNE*uiD4+eEKX&ic~W9j9l#Zuj6{Sr94Z_mMUA3nk{8{mRO!8W~-rDk=lQH zOx5qkR%4p)?mNxcAD?GQ`CFM=t(n)Fecl>%qc$ObVs24tNwy^A|F;=`JFZBpKIvDj zGts_F;KG%_rt|J>0XjcYo1VayY^)_ytG`D&G&fhrvei&|mS{Tq%=M>QZ}$I13GBpT zGLRLi@+{Hp^vh=N^$yt0&KId3W+!I4yHr>flRFiqJnT{0Ru?GME000000000000000008`R YAJI3bi?ZOhz5oCK07*qoM6N<$f&^H%=>Px# diff --git a/src/main/resources/assets/draconicevolution/textures/models/pylon_sphere_texture.png b/src/main/resources/assets/draconicevolution/textures/models/pylon_sphere_texture.png new file mode 100644 index 0000000000000000000000000000000000000000..0efaa8911238faceff9568db1bdca8ef5aab4dd6 GIT binary patch literal 534 zcmV+x0_pvUP)+VSkXoj3E=fx-11Vg$_&Ve`FNRTHnUMu8mD2z!Vc&@OPZHsG?8H`M_9onUBd zU0;Ul<2EzLuV*CZ}Wa6x*=a73}FK}wcOiYM|#D`VMV zFp{3}@rod0z2N?iB&mnC%9-CXyJh}`Di<|BMv1X#OnOu&MKg+|=JmTEU$R~@|IX|y ztNZpP=E&MH&Tm*f5)bLejml+BdG*Mj8}eD(bzpE^J%8~Ly-}@ql++hg%NktF>gjjv YA6wjtLG$8T>i_@%07*qoM6N<$f+;oVNB{r; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/draconicevolution/textures/models/stabilizer_beam.png b/src/main/resources/assets/draconicevolution/textures/models/stabilizer_beam.png new file mode 100644 index 0000000000000000000000000000000000000000..4a933d42ea8436f60f63c0a56b7b1ab7f359e11e GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSK$uZf!>a)($X?><>&kwQU7FF#%!>2ZGN8~FPZ!4!i_>!_TMHdB;Bk?cyS1di z&+(w3g>Cx61rDrR&a^0PJ63p&Z$t0X^RG5f;@|UJ(sX@<)NpDJump7{OiPmxu# zB%^W1MsK#7xow3zefBss&RUaGKe?$bXT@>Tu=2E%jz<5EPLv4rGc&#JvFC!4R$zF5 zl2-a%o|tA?#j7$;befb_o#@&#CBXH+RGibrV9~<$(m~Dl0@k|SG|spZnRPKM{fFwW lXZjW5XLhaHZYOqt{qL^akVe$zucQRbN_7( zrGU_m6T8AiJ2Fb=f2sFKNOL(7HSM1Dx7zqv^=3o1Z?)`#jnC4BCO-XK8mN?XajqqU zMDl~O-FGEtNE!*h>oa7F%D(R`mCWd)8LqCOq-8vPS@xMbQ!n=H?2P}}`ai08Z@eog O^gLbtT-G@yGywokK93*( literal 0 HcmV?d00001