Skip to content

Commit

Permalink
Godforge encore (#3213)
Browse files Browse the repository at this point in the history
Co-authored-by: GDCloud <[email protected]>
  • Loading branch information
serenibyss and GDCloudstrike authored Oct 3, 2024
1 parent 2f5a788 commit e16f7ac
Show file tree
Hide file tree
Showing 22 changed files with 851 additions and 277 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ public void run() {
GTOreDictUnificator.get(OrePrefixes.cell, MaterialsUEVplus.Protomatter, 1L),
ItemList.Cell_Empty.get(1L));

GTFluidFactory.builder("InfinityPlasma")
GTFluidFactory.builder("plasma.infinity")
.withLocalizedName("Infinity Plasma")
.withStateAndTemperature(PLASMA, 10000)
.buildAndRegister()
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/tectech/loader/recipe/BaseRecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public void run() {
new Extractor().run();
new ResearchStationAssemblyLine().run();
new Godforge().run();
} else {
Godforge.runDevEnvironmentRecipes();
}
}
}
33 changes: 26 additions & 7 deletions src/main/java/tectech/loader/recipe/Godforge.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.HashMap;
import java.util.List;

import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -301,17 +302,19 @@ public void run() {
// Single step
ItemStack[] solids_t2_1step = { MaterialsElements.STANDALONE.RHUGNOR.getDust(1),
MaterialsElements.STANDALONE.DRAGON_METAL.getDust(1),
MaterialsElements.STANDALONE.CHRONOMATIC_GLASS.getDust(1), Materials.CosmicNeutronium.getDust(1),
Materials.Draconium.getDust(1), Materials.DraconiumAwakened.getDust(1), Materials.Ichorium.getDust(1) };
MaterialsElements.STANDALONE.CHRONOMATIC_GLASS.getDust(1), Materials.Bedrockium.getDust(1),
Materials.CosmicNeutronium.getDust(1), Materials.Draconium.getDust(1),
Materials.DraconiumAwakened.getDust(1), Materials.Ichorium.getDust(1), };

FluidStack[] molten_t2_1step = convertToFluid(solids_t2_1step);

FluidStack[] solid_plasmas_t2_1step = {
new FluidStack(MaterialsElements.STANDALONE.RHUGNOR.getPlasma(), 144),
new FluidStack(MaterialsElements.STANDALONE.DRAGON_METAL.getPlasma(), 144),
new FluidStack(MaterialsElements.STANDALONE.CHRONOMATIC_GLASS.getPlasma(), 144),
Materials.CosmicNeutronium.getPlasma(144), Materials.Draconium.getPlasma(144),
Materials.DraconiumAwakened.getPlasma(144), Materials.Ichorium.getPlasma(144) };
Materials.Bedrockium.getPlasma(144), Materials.CosmicNeutronium.getPlasma(144),
Materials.Draconium.getPlasma(144), Materials.DraconiumAwakened.getPlasma(144),
Materials.Ichorium.getPlasma(144), };

for (int i = 0; i < solids_t2_1step.length; i++) {
GTValues.RA.stdBuilder()
Expand Down Expand Up @@ -340,14 +343,16 @@ public void run() {

// Multi-step
ItemStack[] solids_t2_xstep = { MaterialsElements.STANDALONE.HYPOGEN.getDust(1),
Materials.Tritanium.getDust(1), Materials.Flerovium.getDust(1), Materials.Neutronium.getDust(1) };
Materials.Tritanium.getDust(1), Materials.Flerovium.getDust(1), Materials.Neutronium.getDust(1),
Materials.Infinity.getDust(1), MaterialsUEVplus.SixPhasedCopper.getDust(1), };

FluidStack[] molten_t2_xstep = convertToFluid(solids_t2_xstep);

FluidStack[] solid_plasmas_t2_xstep = {
new FluidStack(MaterialsElements.STANDALONE.HYPOGEN.getPlasma(), 144),
Materials.Tritanium.getPlasma(144), Materials.Flerovium.getPlasma(144),
Materials.Neutronium.getPlasma(144), };
Materials.Neutronium.getPlasma(144), Materials.Infinity.getPlasma(144),
MaterialsUEVplus.SixPhasedCopper.getPlasma(144), };

for (int i = 0; i < solids_t2_xstep.length; i++) {
GTValues.RA.stdBuilder()
Expand Down Expand Up @@ -459,7 +464,7 @@ public void run() {
GTValues.RA.stdBuilder()
.itemInputs(Materials.Iron.getDust(1))
.fluidInputs(Materials.Iron.getMolten(1), Materials.Bismuth.getMolten(1))
.fluidOutputs(MaterialsUEVplus.MagMatter.getMolten(144))
.fluidOutputs(MaterialsUEVplus.MagMatter.getMolten(576))
.duration(10 * SECONDS)
.eut(TierEU.RECIPE_MAX)
.metadata(FOG_EXOTIC_TIER, 1)
Expand Down Expand Up @@ -653,6 +658,9 @@ public void run() {
exoticModuleMagmatterItemMap.put(Materials.Ichorium.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(Materials.Neutronium.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(Materials.Flerovium.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(Materials.Bedrockium.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(Materials.Infinity.getDustTiny(1), 100000);
exoticModuleMagmatterItemMap.put(MaterialsUEVplus.SixPhasedCopper.getDustTiny(1), 100000);

// GT++ materials
exoticModuleMagmatterItemMap.put(MaterialsElements.STANDALONE.CELESTIAL_TUNGSTEN.getTinyDust(1), 100000);
Expand Down Expand Up @@ -748,6 +756,17 @@ public void run() {

}

public static void runDevEnvironmentRecipes() {
// put something in here to not crash the game in dev environment when opening the manual insertion window
godforgeUpgradeMats.put(0, new ItemStack[] { new ItemStack(Blocks.cobblestone) });
godforgeUpgradeMats.put(5, new ItemStack[] { new ItemStack(Blocks.cobblestone) });
godforgeUpgradeMats.put(7, new ItemStack[] { new ItemStack(Blocks.cobblestone) });
godforgeUpgradeMats.put(11, new ItemStack[] { new ItemStack(Blocks.cobblestone) });
godforgeUpgradeMats.put(26, new ItemStack[] { new ItemStack(Blocks.cobblestone) });
godforgeUpgradeMats.put(29, new ItemStack[] { new ItemStack(Blocks.cobblestone) });
godforgeUpgradeMats.put(30, new ItemStack[] { new ItemStack(Blocks.cobblestone) });
}

public static void initMoltenModuleRecipes() {
for (GTRecipe recipe : RecipeMaps.blastFurnaceRecipes.getAllRecipes()) {
List<ItemStack> itemOutputs = new ArrayList<>(1);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/tectech/thing/block/RenderForgeOfGods.java
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ public void renderTileEntityAt(TileEntity tile, double x, double y, double z, fl
long millis = System.currentTimeMillis() % (1000 * 36000);
float timer = millis / (50f); // to ticks

if (forgeTile.getRainbowMode()) {
forgeTile.incrementRainbowColors();
}

RenderEntireStar(forgeTile, x, y, z, timer);
RenderRings(forgeTile, x, y, z, timer);

Expand Down
70 changes: 67 additions & 3 deletions src/main/java/tectech/thing/block/TileEntityForgeOfGods.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ public class TileEntityForgeOfGods extends TileEntity {
private int ringCount = 1;
private float colorR = .7f, colorG = .8f, colorB = 1f, gamma = 3f;
private float rotAngle = 0, rotAxisX = 1, rotAxisY = 0, rotAxisZ = 0;
private int rainbowR = 255, rainbowG = 0, rainbowB = 0;
private int rainbowState = 0;
private boolean rainbowMode = false;
private int rainbowCycleSpeed = 1;

private static final String NBT_TAG = "FOG:";
private static final String ROTATION_SPEED_NBT_TAG = NBT_TAG + "ROTATION";
Expand All @@ -30,6 +34,8 @@ public class TileEntityForgeOfGods extends TileEntity {
private static final String ROT_AXIS_X_NBT_TAG = NBT_TAG + "ROT_AXIS_X";
private static final String ROT_AXIS_Y_NBT_TAG = NBT_TAG + "ROT_AXIS_Y";
private static final String ROT_AXIS_Z_NBT_TAG = NBT_TAG + "ROT_AXIS_Z";
private static final String RAINBOW_MODE_NBT_TAG = NBT_TAG + "RAINBOW_MODE";
private static final String RAINBOW_MODE_CYCLE_SPEED_NBT_TAG = NBT_TAG + "RAINBOW_MODE_CYCLE_SPEED";

public static final float BACK_PLATE_DISTANCE = -121.5f, BACK_PLATE_RADIUS = 13f;

Expand Down Expand Up @@ -60,15 +66,15 @@ public void setRotationSpeed(float speed) {
}

public float getColorR() {
return colorR;
return rainbowMode ? rainbowR / 255f : colorR;
}

public float getColorG() {
return colorG;
return rainbowMode ? rainbowG / 255f : colorG;
}

public float getColorB() {
return colorB;
return rainbowMode ? rainbowB / 255f : colorB;
}

public float getGamma() {
Expand All @@ -86,6 +92,15 @@ public void setColor(float r, float g, float b, float gamma) {
this.gamma = gamma;
}

public void setRainbowMode(boolean state, int cycleSpeed) {
this.rainbowMode = state;
this.rainbowCycleSpeed = cycleSpeed;
}

public boolean getRainbowMode() {
return rainbowMode;
}

public int getRingCount() {
return ringCount;
}
Expand Down Expand Up @@ -157,6 +172,51 @@ public static float interpolate(float x0, float x1, float y0, float y1, float x)
return y0 + ((x - x0) * (y1 - y0)) / (x1 - x0);
}

public void incrementRainbowColors() {
if (rainbowState == 0) {
rainbowG += rainbowCycleSpeed;
if (rainbowG >= 255) {
rainbowG = 255;
rainbowState = 1;
}
}
if (rainbowState == 1) {
rainbowR -= rainbowCycleSpeed;
if (rainbowR <= 0) {
rainbowR = 0;
rainbowState = 2;
}
}
if (rainbowState == 2) {
rainbowB += rainbowCycleSpeed;
if (rainbowB >= 255) {
rainbowB = 255;
rainbowState = 3;
}
}
if (rainbowState == 3) {
rainbowG -= rainbowCycleSpeed;
if (rainbowG <= 0) {
rainbowG = 0;
rainbowState = 4;
}
}
if (rainbowState == 4) {
rainbowR += rainbowCycleSpeed;
if (rainbowR >= 255) {
rainbowR = 255;
rainbowState = 5;
}
}
if (rainbowState == 5) {
rainbowB -= rainbowCycleSpeed;
if (rainbowB <= 0) {
rainbowB = 0;
rainbowState = 0;
}
}
}

@Override
public void writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
Expand All @@ -171,6 +231,8 @@ public void writeToNBT(NBTTagCompound compound) {
compound.setFloat(ROT_AXIS_X_NBT_TAG, rotAxisX);
compound.setFloat(ROT_AXIS_Y_NBT_TAG, rotAxisY);
compound.setFloat(ROT_AXIS_Z_NBT_TAG, rotAxisZ);
compound.setBoolean(RAINBOW_MODE_NBT_TAG, rainbowMode);
compound.setInteger(RAINBOW_MODE_CYCLE_SPEED_NBT_TAG, rainbowCycleSpeed);
}

@Override
Expand All @@ -190,6 +252,8 @@ public void readFromNBT(NBTTagCompound compound) {
rotAxisX = compound.getFloat(ROT_AXIS_X_NBT_TAG);
rotAxisY = compound.getFloat(ROT_AXIS_Y_NBT_TAG);
rotAxisZ = compound.getFloat(ROT_AXIS_Z_NBT_TAG);
rainbowMode = compound.getBoolean(RAINBOW_MODE_NBT_TAG);
rainbowCycleSpeed = compound.getInteger(RAINBOW_MODE_CYCLE_SPEED_NBT_TAG);
}

@Override
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/tectech/thing/gui/TecTechUITextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class TecTechUITextures {
public static final UITexture BACKGROUND_GLOW_PURPLE = UITexture.fullImage(MODID, "gui/background/purple_glow");
public static final UITexture BACKGROUND_GLOW_BLUE = UITexture.fullImage(MODID, "gui/background/blue_glow");
public static final UITexture BACKGROUND_GLOW_GREEN = UITexture.fullImage(MODID, "gui/background/green_glow");
public static final UITexture BACKGROUND_GLOW_RED = UITexture.fullImage(MODID, "gui/background/red_glow");
public static final UITexture BACKGROUND_GLOW_WHITE = UITexture.fullImage(MODID, "gui/background/white_glow");
public static final UITexture BACKGROUND_GLOW_RAINBOW = UITexture.fullImage(MODID, "gui/background/rainbow_glow");
public static final UITexture BACKGROUND_SPACE = UITexture.fullImage(MODID, "gui/background/space");
Expand Down Expand Up @@ -84,6 +85,10 @@ public class TecTechUITextures {
.fullImage(MODID, "gui/overlay_button/battery_off");
public static final UITexture OVERLAY_BUTTON_FLAG = UITexture.fullImage(MODID, "gui/overlay_button/flag");
public static final UITexture OVERLAY_BUTTON_HEART = UITexture.fullImage(MODID, "gui/overlay_button/heart");
public static final UITexture OVERLAY_BUTTON_RAINBOW_SPIRAL = UITexture
.fullImage(MODID, "gui/overlay_button/rainbow_spiral");
public static final UITexture OVERLAY_BUTTON_RAINBOW_SPIRAL_OFF = UITexture
.fullImage(MODID, "gui/overlay_button/rainbow_spiral_off");
public static final UITexture OVERLAY_CYCLIC_BLUE = UITexture.fullImage(MODID, "gui/overlay_button/cyclic_blue");
public static final UITexture OVERLAY_EJECTION_LOCKED = UITexture
.fullImage(MODID, "gui/overlay_button/eject_disabled");
Expand Down Expand Up @@ -206,5 +211,7 @@ public class TecTechUITextures {
public static final UITexture PICTURE_OVERLAY_ORANGE = UITexture.fullImage(MODID, "gui/picture/overlay_orange");
public static final UITexture PICTURE_OVERLAY_GREEN = UITexture.fullImage(MODID, "gui/picture/overlay_green");
public static final UITexture PICTURE_OVERLAY_PURPLE = UITexture.fullImage(MODID, "gui/picture/overlay_purple");
public static final UITexture PICTURE_OVERLAY_RED = UITexture.fullImage(MODID, "gui/picture/overlay_red");
public static final UITexture PICTURE_RAINBOW_SQUARE = UITexture.fullImage(MODID, "gui/picture/rainbow_square");

}
Loading

0 comments on commit e16f7ac

Please sign in to comment.