Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	dependencies.gradle
  • Loading branch information
Dream-Master committed Apr 24, 2024
2 parents c2bd560 + 7b4f399 commit d441f37
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_Utility.filterValidMTEs;
import static gregtech.api.util.GT_Utility.formatNumbers;
import static mcp.mobius.waila.api.SpecialChars.GREEN;
import static mcp.mobius.waila.api.SpecialChars.RED;
import static mcp.mobius.waila.api.SpecialChars.RESET;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;

import gregtech.GT_Mod;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IHatchElement;
import gregtech.api.interfaces.ITexture;
Expand All @@ -26,11 +32,14 @@
import gregtech.api.recipe.RecipeMap;
import gregtech.api.util.GT_HatchElementBuilder;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_Waila;
import gregtech.api.util.IGT_HatchAdder;
import gregtech.api.util.shutdown.ShutDownReasonRegistry;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusOutput;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;

public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMultiBase<T>>
extends GregtechMeta_MultiBlockBase<T> {
Expand Down Expand Up @@ -325,6 +334,39 @@ public boolean resetRecipeMapForAllInputHatches(RecipeMap<?> aMap) {
return ret;
}

@Override
public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
final NBTTagCompound tag = accessor.getNBTData();

if (tag.getBoolean("incompleteStructure")) {
currentTip.add(RED + "** INCOMPLETE STRUCTURE **" + RESET);
}
currentTip.add(
(tag.getBoolean("hasProblems") ? (RED + "** HAS PROBLEMS **") : GREEN + "Running Fine") + RESET
+ " Efficiency: "
+ tag.getFloat("efficiency")
+ "%");

boolean isActive = tag.getBoolean("isActive");
if (isActive) {
long actualEnergyUsage = tag.getLong("energyUsage");
if (actualEnergyUsage > 0) {
currentTip.add(
StatCollector
.translateToLocalFormatted("GTPP.waila.steam.use", formatNumbers(actualEnergyUsage)));
}
}
currentTip.add(
GT_Waila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress")));
// Show ns on the tooltip
if (GT_Mod.gregtechproxy.wailaAverageNS && tag.hasKey("averageNS")) {
int tAverageTime = tag.getInteger("averageNS");
currentTip.add("Average CPU load of ~" + formatNumbers(tAverageTime) + " ns");
}
super.getMTEWailaBody(itemStack, currentTip, accessor, config);
}

protected static <T extends GregtechMeta_SteamMultiBase<T>> GT_HatchElementBuilder<T> buildSteamInput(
Class<T> typeToken) {
return buildHatchAdder(typeToken).adder(GregtechMeta_SteamMultiBase::addToMachineList).hatchIds(31040)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public String getMachineType() {
protected GT_Multiblock_Tooltip_Builder createTooltip() {
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType(getMachineType()).addInfo("Controller Block for the Steam Compressor")
.addInfo("Compresses " + getMaxParallelRecipes() + " things at a time").addSeparator()
.addInfo("33.3% faster than using a single block Steam Compressor.")
.addInfo("Uses only 66.6% of the steam/s compared to a single block Steam Compressor.")
.addInfo("Compresses up to " + getMaxParallelRecipes() + " things at a time").addSeparator()
.beginStructureBlock(3, 3, 4, true).addController("Front center")
.addCasingInfoMin(mCasingName, 28, false).addOtherStructurePart(TT_steaminputbus, "Any casing", 1)
.addOtherStructurePart(TT_steamoutputbus, "Any casing", 1)
Expand Down Expand Up @@ -127,14 +129,15 @@ public RecipeMap<?> getRecipeMap() {
return RecipeMaps.compressorRecipes;
}

// note that a basic steam machine has .setEUtDiscount(2F).setSpeedBoost(2F). So these are bonuses.
@Override
protected ProcessingLogic createProcessingLogic() {
return new ProcessingLogic() {

@Override
@Nonnull
protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) {
return GT_OverclockCalculator.ofNoOverclock(recipe);
return GT_OverclockCalculator.ofNoOverclock(recipe).setEUtDiscount(1.33F).setSpeedBoost(1.5F);
}
}.setMaxParallel(getMaxParallelRecipes());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ protected GT_Multiblock_Tooltip_Builder createTooltip() {
}
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType(getMachineType()).addInfo("Controller Block for the Steam Macerator")
.addInfo("Macerates " + getMaxParallelRecipes() + " ores at a time").addSeparator()
.addInfo("33.3% faster than using a single block Steam Macerator.")
.addInfo("Uses only 66.6% of the steam/s required compared to a single block Steam Macerator.")
.addInfo("Macerates up to " + getMaxParallelRecipes() + " things at a time").addSeparator()
.beginStructureBlock(3, 3, 3, true).addController("Front center")
.addCasingInfoMin(mCasingName, 14, false).addOtherStructurePart(TT_steaminputbus, "Any casing", 1)
.addOtherStructurePart(TT_steamoutputbus, "Any casing", 1)
Expand Down Expand Up @@ -131,14 +133,15 @@ public RecipeMap<?> getRecipeMap() {
return RecipeMaps.maceratorRecipes;
}

// note that a basic steam machine has .setEUtDiscount(2F).setSpeedBoost(2F). So these are bonuses.
@Override
protected ProcessingLogic createProcessingLogic() {
return new ProcessingLogic() {

@Override
@Nonnull
protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) {
return GT_OverclockCalculator.ofNoOverclock(recipe);
return GT_OverclockCalculator.ofNoOverclock(recipe).setEUtDiscount(1.33F).setSpeedBoost(1.5F);
}

}.setMaxParallel(getMaxParallelRecipes());
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/gregtech/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ GTPP.multiblock.multimachine.metal=Metal Mode. Does compressor (circuit 20), lat
GTPP.multiblock.multimachine.fluid=Fluid Mode. Does fermenter (circuit 20), fluid extractor (circuit 21) and extractor (circuit 22).
GTPP.multiblock.multimachine.misc=Misc. Mode. Does precision laser engraver (circuit 20), autoclave (circuit 21) and fluid solidifier (circuit 22).


GTPP.waila.steam.use=Probably uses: §e%s§r L/t Steam

GTPP.CC.machinetier=Control Core Tier
GTPP.CC.discount=EU Discount
GTPP.CC.parallel=Maximum Parallel
Expand Down

0 comments on commit d441f37

Please sign in to comment.