aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/ClientProxy.java5
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java18
-rw-r--r--src/main/java/com/github/technus/tectech/thing/block/EyeOfHarmonyBlock.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/block/RenderEyeOfHarmony.java10
-rw-r--r--src/main/java/com/github/technus/tectech/thing/block/TileEyeOfHarmony.java7
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java1
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/RenderEyeOfHarmonyItem.java97
7 files changed, 133 insertions, 13 deletions
diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
index 573fdc2c61..7d33091d1e 100644
--- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
+++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
@@ -1,12 +1,14 @@
package com.github.technus.tectech.proxy;
import static com.github.technus.tectech.TecTech.RANDOM;
+import static com.github.technus.tectech.thing.casing.TT_Container_Casings.eyeOfHarmonyRenderBlock;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.gui.GuiNewChat;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
@@ -18,6 +20,7 @@ import com.github.technus.tectech.compatibility.openmodularturrets.TT_turret_loa
import com.github.technus.tectech.thing.block.*;
import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM;
import com.github.technus.tectech.thing.item.ElementalDefinitionContainer_EM;
+import com.github.technus.tectech.thing.item.RenderEyeOfHarmonyItem;
import com.github.technus.tectech.thing.item.renderElemental.RenderElementalName;
import com.gtnewhorizon.structurelib.entity.fx.WeightlessParticleFX;
@@ -38,6 +41,8 @@ public class ClientProxy extends CommonProxy {
.registerItemRenderer(ElementalDefinitionContainer_EM.INSTANCE, RenderElementalName.INSTANCE);
MinecraftForgeClient
.registerItemRenderer(DebugElementalInstanceContainer_EM.INSTANCE, RenderElementalName.INSTANCE);
+ MinecraftForgeClient
+ .registerItemRenderer(Item.getItemFromBlock(eyeOfHarmonyRenderBlock), new RenderEyeOfHarmonyItem());
if (Loader.isModLoaded("openmodularturrets")) {
new TT_turret_loader().run();
diff --git a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java
index d7c0fd1e5e..48897d0ea3 100644
--- a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java
+++ b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java
@@ -129,11 +129,21 @@ public class EyeOfHarmonyRecipe {
}
// End item processing.
- // --- Output and process fluids of the recipe.
- ArrayList<FluidStack> fluidStackArrayList = validPlasmaGenerator(materialList);
+ // --- Fluid handling ---
+ ArrayList<FluidStack> fluidStackArrayList = new ArrayList<>();
+
+ // If DeepDark then it should output all plasmas involved in making exotic catalyst.
+ if (rocketTier == 9) {
+ for (Materials material : VALID_PLASMAS) {
+ fluidStackArrayList.add(material.getPlasma(1));
+ }
+ } else {
+ // --- Output and process fluids of the recipe.
+ fluidStackArrayList.addAll(validPlasmaGenerator(materialList));
+ }
for (FluidStack fluidStack : fluidStackArrayList) {
- fluidStack.amount = (int) ((this.spacetimeCasingTierRequired + 1) * 1_000_000L);
+ fluidStack.amount = (int) ((this.spacetimeCasingTierRequired + 1) * 8_000_000L);
}
// Add a bonus fluid of compressed star matter.
@@ -157,7 +167,7 @@ public class EyeOfHarmonyRecipe {
fluidStackArrayList.add(SPECIAL_FLUIDS[spacetimeTier + 1]);
outputFluids = fluidStackArrayList;
- // End fluid processing.
+ // --- End fluid handling ---.
this.hydrogenRequirement = hydrogenRequirement;
this.heliumRequirement = heliumRequirement;
diff --git a/src/main/java/com/github/technus/tectech/thing/block/EyeOfHarmonyBlock.java b/src/main/java/com/github/technus/tectech/thing/block/EyeOfHarmonyBlock.java
index 1085c2b3f3..38670df38b 100644
--- a/src/main/java/com/github/technus/tectech/thing/block/EyeOfHarmonyBlock.java
+++ b/src/main/java/com/github/technus/tectech/thing/block/EyeOfHarmonyBlock.java
@@ -1,8 +1,11 @@
package com.github.technus.tectech.thing.block;
+import java.util.ArrayList;
+
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@@ -60,4 +63,9 @@ public class EyeOfHarmonyBlock extends Block {
GameRegistry.registerBlock(block, name.substring(name.indexOf(":") + 1));
}
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune) {
+ return new ArrayList<>();
+ }
+
}
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 9143afb18e..8b90abef82 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
@@ -19,10 +19,10 @@ import cpw.mods.fml.client.FMLClientHandler;
public class RenderEyeOfHarmony extends TileEntitySpecialRenderer {
- private static final ResourceLocation STAR_LAYER_0 = new ResourceLocation(MODID, "models/StarLayer0.png");
- private static final ResourceLocation STAR_LAYER_1 = new ResourceLocation(MODID, "models/StarLayer1.png");
- private static final ResourceLocation STAR_LAYER_2 = new ResourceLocation(MODID, "models/StarLayer2.png");
- private static IModelCustom starModel;
+ public static final ResourceLocation STAR_LAYER_0 = new ResourceLocation(MODID, "models/StarLayer0.png");
+ public static final ResourceLocation STAR_LAYER_1 = new ResourceLocation(MODID, "models/StarLayer1.png");
+ public static final ResourceLocation STAR_LAYER_2 = new ResourceLocation(MODID, "models/StarLayer2.png");
+ public static IModelCustom starModel;
private static IModelCustom spaceModel;
public RenderEyeOfHarmony() {
@@ -80,7 +80,7 @@ public class RenderEyeOfHarmony extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
- private static void renderOuterSpaceShell() {
+ public static void renderOuterSpaceShell() {
// Begin animation.
GL11.glPushMatrix();
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 655a531432..bb32afbd8b 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
@@ -29,8 +29,8 @@ public class TileEyeOfHarmony extends TileEntity {
this.rotationSpeed = rotationSpeed;
}
- private float size = 1;
- private float rotationSpeed = 0;
+ private float size = 10;
+ private float rotationSpeed = 10;
// Fun fact, these methods were entirely written by ChatGPT3... Take that as you will.
public static <T> ArrayList<T> selectNRandomElements(Collection<T> inputList, long n) {
@@ -58,7 +58,7 @@ public class TileEyeOfHarmony extends TileEntity {
this.tier = tier;
}
- private long tier = -1;
+ private long tier = 9;
public void incrementSize() {
size += 1.5f;
@@ -180,4 +180,5 @@ public class TileEyeOfHarmony extends TileEntity {
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
readFromNBT(pkt.func_148857_g());
}
+
}
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java b/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java
index 90b6ee4ed9..bcaadbedf5 100644
--- a/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java
+++ b/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java
@@ -18,7 +18,6 @@ public final class TT_Container_Casings {
public static Block SpacetimeCompressionFieldGenerators;
public static Block StabilisationFieldGenerators;
- // Do NOT delete, it will break. The IDE is a liar.
public static Block eyeOfHarmonyRenderBlock = new EyeOfHarmonyBlock();
private TT_Container_Casings() {}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/RenderEyeOfHarmonyItem.java b/src/main/java/com/github/technus/tectech/thing/item/RenderEyeOfHarmonyItem.java
new file mode 100644
index 0000000000..35fc174310
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/item/RenderEyeOfHarmonyItem.java
@@ -0,0 +1,97 @@
+package com.github.technus.tectech.thing.item;
+
+import static com.github.technus.tectech.thing.block.RenderEyeOfHarmony.*;
+import static java.lang.Math.pow;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+import net.minecraftforge.client.IItemRenderer;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.client.FMLClientHandler;
+
+public class RenderEyeOfHarmonyItem implements IItemRenderer {
+
+ @Override
+ public boolean handleRenderType(ItemStack item, ItemRenderType type) {
+ return true;
+ }
+
+ @Override
+ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
+ return true;
+ }
+
+ @Override
+ public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
+ GL11.glPushMatrix();
+
+ if (type == ItemRenderType.INVENTORY) GL11.glRotated(180, 0, 1, 0);
+ else if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
+ GL11.glTranslated(0.5, 0.5, 0.5);
+ if (type == ItemRenderType.EQUIPPED) GL11.glRotated(90, 0, 1, 0);
+ }
+
+ // Render star stuff.
+ renderStarLayer(0, STAR_LAYER_0, 1.0f);
+ renderStarLayer(1, STAR_LAYER_1, 0.4f);
+ renderStarLayer(2, STAR_LAYER_2, 0.2f);
+
+ GL11.glPopMatrix();
+ }
+
+ private void renderStarLayer(int layer, ResourceLocation texture, float alpha) {
+
+ // Begin animation.
+ GL11.glPushMatrix();
+
+ // OpenGL settings, not sure exactly what these do.
+
+ // Disables lighting, so star is always lit (I think).
+ GL11.glDisable(GL11.GL_LIGHTING);
+ // Culls things out of line of sight?
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ // Merges colours of the various layers of the star?
+ GL11.glEnable(GL11.GL_BLEND);
+ // ???
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+
+ // Bind animation to layer of star.
+ FMLClientHandler.instance().getClient().getTextureManager().bindTexture(texture);
+
+ // 0.01f magic number to shrink sphere obj down.
+ // Size obtained from the multis current recipe.
+ float scale = 0.01f;
+
+ // Put each subsequent layer further out.
+ scale *= pow(1.04f, layer);
+
+ // Scale the star up in the x, y and z directions.
+ GL11.glScalef(scale, scale, scale);
+
+ switch (layer) {
+ case 0:
+ GL11.glRotatef(130 + (System.currentTimeMillis() / 64) % 360, 0F, 1F, 1F);
+ break;
+ case 1:
+ GL11.glRotatef(-49 + (System.currentTimeMillis() / 64) % 360, 1F, 1F, 0F);
+ break;
+ case 2:
+ GL11.glRotatef(67 + (System.currentTimeMillis() / 64) % 360, 1F, 0F, 1F);
+ break;
+ }
+
+ // Set colour and alpha (transparency) of the star layer.
+ GL11.glColor4f(1, 1, 1, alpha);
+
+ starModel.renderAll();
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDepthMask(true);
+ GL11.glEnable(GL11.GL_LIGHTING);
+
+ // Finish animation.
+ GL11.glPopMatrix();
+ }
+
+}