aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java83
-rw-r--r--src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java31
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java30
-rw-r--r--src/main/java/com/github/technus/tectech/util/CelestialBody.java17
4 files changed, 108 insertions, 53 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java
index 4fdb6f1df3..8b24371965 100644
--- a/src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java
+++ b/src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java
@@ -16,16 +16,19 @@ import static com.github.technus.tectech.Reference.MODID;
public class RenderEyeOfHarmony extends TileEntitySpecialRenderer {
- private static final ResourceLocation inner_model_texture =
- new ResourceLocation(MODID ,"models/Earth.png");
+ private static final ResourceLocation starLayer0 =
+ new ResourceLocation(MODID ,"models/StarLayer0.png");
+
+ private static final ResourceLocation starLayer1 = new ResourceLocation(MODID ,"models/StarLayer1.png");
+
+ private static final ResourceLocation starLayer2 = new ResourceLocation(MODID ,"models/StarLaye1.png");
- private static final ResourceLocation outer_model_texture = new ResourceLocation(MODID ,"models/OuterEOH.png");
public static IModelCustom modelCustom;
public RenderEyeOfHarmony() {
modelCustom =
- AdvancedModelLoader.loadModel(new ResourceLocation(MODID, "models/Earth.obj"));
+ AdvancedModelLoader.loadModel(new ResourceLocation(MODID, "models/lowerres.obj"));
}
@Override
@@ -35,53 +38,57 @@ public class RenderEyeOfHarmony extends TileEntitySpecialRenderer {
TileEyeOfHarmony EOHRenderTile = (TileEyeOfHarmony) tile;
float scale = 0.01f * EOHRenderTile.getSize();
- GL11.glPushMatrix();
- GL11.glColor4f(1F, 1F, 1F, 1F);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 150f, 150f);
- 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(inner_model_texture);
-
- float brightness = (float) Math.abs(Math.sin((float) Minecraft.getSystemTime() / 3000f) * 100f);
+ {
+ GL11.glPushMatrix();
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 150f, 150f);
+ 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(starLayer0);
- float starRed = 0.3f;
- float starGreen = 0.0f;
- float starBlue = 0.3f;
+ float starRed = 1.0f;
+ float starGreen = 1.0f;
+ float starBlue = 1.0f;
- GL11.glScalef(scale, scale, scale);
+ GL11.glScalef(scale, scale, scale);
GL11.glPushMatrix();
- GL11.glRotatef(-180, 1F, 0F, 1F);
- GL11.glRotatef(90, 1F, 0F, 0F);
+
GL11.glColor4d(starRed, starGreen, starBlue, 1F);
if (EOHRenderTile.getRotationSpeed() != 0) {
- GL11.glRotatef((System.currentTimeMillis() / EOHRenderTile.getRotationSpeed()) % 360, 0F, 0F, 1F);
+ GL11.glRotatef((System.currentTimeMillis() / (int) EOHRenderTile.getRotationSpeed()) % 360, 0F, 0F, 1F);
}
- // OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 80f + brightness, 80f +
- // brightness);
modelCustom.renderAll();
GL11.glPopMatrix();
- float outerShellScaleIncrease = 1.05f;
- GL11.glScalef(outerShellScaleIncrease, outerShellScaleIncrease, outerShellScaleIncrease);
- GL11.glDepthMask(false);
- FMLClientHandler.instance().getClient().getTextureManager().bindTexture(outer_model_texture);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glColor4f(starRed, starGreen, starBlue, 0.3F);
- modelCustom.renderAll();
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glDepthMask(true);
- GL11.glEnable(GL11.GL_LIGHTING);
-
-
+ float outerShellScaleIncrease = 1.05f;
+ GL11.glScalef(outerShellScaleIncrease, outerShellScaleIncrease, outerShellScaleIncrease);
+ GL11.glDepthMask(false);
+ FMLClientHandler.instance().getClient().getTextureManager().bindTexture(starLayer1);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ // GL11.glRotatef(-180, 1F, 0F, 1F);
+ // GL11.glRotatef(90, 1F, 0F, 0F);
+ // Random axis of rotation.
+ GL11.glRotatef(42, 1F, 1F, 0F);
+ GL11.glRotatef(-139, 1F, 0F, 0F);
+ GL11.glRotatef(29, 0F, 1F, 1F);
+ // End.
+ GL11.glColor4f(starRed, starGreen, starBlue, 0.3F);
+ if (EOHRenderTile.getRotationSpeed() != 0) {
+ GL11.glRotatef(-(System.currentTimeMillis() / (int) EOHRenderTile.getRotationSpeed()) % 360, 0F, 0F, 1F);
+ }
+ modelCustom.renderAll();
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glColor4d(starRed, starGreen, starBlue, 0.1F);
+ GL11.glColor4d(starRed, starGreen, starBlue, 0.1F);
- GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java
index 5df86da3c1..d30136f52d 100644
--- a/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java
+++ b/src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java
@@ -15,26 +15,31 @@ public class TileEyeOfHarmony extends TileEntity {
return INFINITE_EXTENT_AABB;
}
- private static final int maxRotationSpeed = 64;
- private static final int maxSize = 200;
+ public void setSize(float size) {
+ this.size = size;
+ }
+
+ public void setRotationSpeed(float rotationSpeed) {
+ this.rotationSpeed = rotationSpeed;
+ }
- private int size = 1;
- private int rotationSpeed = 0;
+ private float size = 1;
+ private float rotationSpeed = 0;
public void incrementSize() {
- size++;
+ size += 1.5f;
}
public void increaseRotationSpeed() {
rotationSpeed++;
}
- public int getSize() {
- return size % maxSize;
+ public float getSize() {
+ return size;
}
- public int getRotationSpeed() {
- return rotationSpeed % maxRotationSpeed;
+ public float getRotationSpeed() {
+ return rotationSpeed;
}
private static final String rotationSpeedNBTTag = "EOH:rotationSpeed";
@@ -43,15 +48,15 @@ public class TileEyeOfHarmony extends TileEntity {
@Override
public void writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
- compound.setInteger(rotationSpeedNBTTag, rotationSpeed);
- compound.setInteger(sizeNBTTag, size);
+ compound.setFloat(rotationSpeedNBTTag, rotationSpeed);
+ compound.setFloat(sizeNBTTag, size);
}
@Override
public void readFromNBT(NBTTagCompound compound) {
super.readFromNBT(compound);
- rotationSpeed = compound.getInteger(rotationSpeedNBTTag);
- size = compound.getInteger(sizeNBTTag);
+ rotationSpeed = compound.getFloat(rotationSpeedNBTTag);
+ size = compound.getFloat(sizeNBTTag);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
index 63bb5d5fd6..dfbd1098e6 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
@@ -2,6 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
+import static com.github.technus.tectech.thing.casing.TT_Container_Casings.eyeOfHarmonyRenderBlock;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsBA0;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.enums.GT_Values.AuthorColen;
@@ -11,8 +12,10 @@ import static java.lang.Math.*;
import static net.minecraft.util.EnumChatFormatting.*;
import appeng.util.ReadableNumberConverter;
+import com.cricketcraft.chisel.api.IChiselItem;
import com.github.technus.tectech.recipe.EyeOfHarmonyRecipe;
import com.github.technus.tectech.recipe.EyeOfHarmonyRecipeStorage;
+import com.github.technus.tectech.thing.block.TileEyeOfHarmony;
import com.github.technus.tectech.thing.casing.TT_Block_SpacetimeCompressionFieldGenerators;
import com.github.technus.tectech.thing.casing.TT_Block_StabilisationFieldGenerators;
import com.github.technus.tectech.thing.casing.TT_Block_TimeAccelerationFieldGenerators;
@@ -23,6 +26,7 @@ import com.github.technus.tectech.util.ItemStackLong;
import com.google.common.collect.ImmutableList;
import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Materials;
@@ -48,6 +52,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.tuple.Pair;
import org.lwjgl.opengl.GL11;
@@ -1577,9 +1583,9 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
.addSeparator()
.addStructureInfo("Eye of Harmony structure is too complex! See schematic for details.")
.addStructureInfo(
- EnumChatFormatting.GOLD + "896" + EnumChatFormatting.GRAY + " Ultimate Molecular Casing.")
+ EnumChatFormatting.GOLD + "896" + EnumChatFormatting.GRAY + " Reinforced Spacetime Structure Casing.")
.addStructureInfo(EnumChatFormatting.GOLD + "534" + EnumChatFormatting.GRAY
- + " Ultimate Advanced Molecular Casing.")
+ + " Ultimate Temporal Boundary Casing.")
.addStructureInfo(
EnumChatFormatting.GOLD + "680" + EnumChatFormatting.GRAY + " Time Dilation Field Generator.")
.addStructureInfo(
@@ -1758,10 +1764,30 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
updateSlots();
+ createRenderBlock();
+
recipeRunning = true;
return true;
}
+ private void createRenderBlock() {
+
+ IGregTechTileEntity gregTechTileEntity = this.getBaseMetaTileEntity();
+
+ int x = gregTechTileEntity.getXCoord();
+ int y = gregTechTileEntity.getYCoord();
+ int z = gregTechTileEntity.getZCoord();
+
+ double xOffset = 16 * getExtendedFacing().getRelativeBackInWorld().offsetX;
+ double zOffset = 16 * getExtendedFacing().getRelativeBackInWorld().offsetZ;
+ double yOffset = 16 * getExtendedFacing().getRelativeBackInWorld().offsetZ;
+
+ this.getBaseMetaTileEntity().getWorld().setBlock((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset), eyeOfHarmonyRenderBlock);
+ TileEyeOfHarmony rendererTileEntity = (TileEyeOfHarmony) this.getBaseMetaTileEntity().getWorld().getTileEntity((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset));
+ rendererTileEntity.setSize(100);
+ rendererTileEntity.setRotationSpeed(100);
+ }
+
private double successChance;
private void outputFailedChance() {
diff --git a/src/main/java/com/github/technus/tectech/util/CelestialBody.java b/src/main/java/com/github/technus/tectech/util/CelestialBody.java
new file mode 100644
index 0000000000..790624a774
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/util/CelestialBody.java
@@ -0,0 +1,17 @@
+package com.github.technus.tectech.util;
+
+import net.minecraft.block.Block;
+
+import java.util.ArrayList;
+
+public class CelestialBody {
+
+ CelestialBody(Block mainBody, ArrayList<CelestialBody> orbitingBodies) {
+ this.mainBody = mainBody;
+ this.orbitingBodies = orbitingBodies;
+ }
+
+ public Block mainBody;
+
+ public ArrayList<CelestialBody> orbitingBodies;
+}