Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Waila Pipe info #3839

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -67,6 +68,8 @@
import gregtech.common.covers.CoverDrain;
import gregtech.common.covers.CoverFluidRegulator;
import gregtech.common.covers.CoverInfo;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;

public class MTEFluid extends MetaPipeEntity {

Expand Down Expand Up @@ -931,6 +934,43 @@ public FluidStack drain(ForgeDirection side, FluidStack aFluid, boolean doDrain)
return null;
}

@Override
public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {

// Basic pipe stats
currenttip.add(
StatCollector.translateToLocal("GT5U.item.pipe.capacity") + ": "
+ EnumChatFormatting.BLUE
+ GTUtility.formatNumbers(mCapacity * 20L)
+ " L/s");

currenttip.add(
StatCollector.translateToLocal("GT5U.item.pipe.heat_resistance") + ": "
+ EnumChatFormatting.RED
+ GTUtility.formatNumbers(mHeatResistance)
+ "K");

// Gas handling info
if (mGasProof) {
currenttip.add(
StatCollector.translateToLocal("GT5U.item.pipe.gas_proof") + ": "
+ EnumChatFormatting.GREEN
+ StatCollector.translateToLocal("GT5U.item.pipe.gas_proof.yes"));
} else {
currenttip.add(
StatCollector.translateToLocal("GT5U.item.pipe.gas_proof") + ": "
+ EnumChatFormatting.RED
+ StatCollector.translateToLocal("GT5U.item.pipe.gas_proof.no"));
}
serenibyss marked this conversation as resolved.
Show resolved Hide resolved

// Multi-pipe info
if (mPipeAmount > 1) {
currenttip.add(
StatCollector.translateToLocal("GT5U.item.pipe.amount") + ": " + EnumChatFormatting.AQUA + mPipeAmount);
}
}

private static EnumMap<Border, ForgeDirection> borderMap(ForgeDirection topSide, ForgeDirection bottomSide,
ForgeDirection leftSide, ForgeDirection rightSide) {
final EnumMap<Border, ForgeDirection> sideMap = new EnumMap<>(Border.class);
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/assets/gregtech/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,14 @@ GT5U.item.cable.loss=Loss/Meter/Ampere
GT5U.item.cable.eu_volt=EU-Volt
GT5U.item.tank.locked_to=Content locked to %s

GT5U.item.pipe.capacity=Capacity
GT5U.item.pipe.heat_resistance=Heat Resistance
GT5U.item.pipe.gas_proof=Gas Proof
GT5U.item.pipe.gas_proof.yes=Yes
GT5U.item.pipe.gas_proof.no=No
GT5U.item.pipe.amount=Pipe Amount
GT5U.item.pipe.empty=Empty

gt.behaviour.paintspray.infinite.gui.header=Select a Color
gt.behaviour.paintspray.infinite.gui.lock_error=§eSpray can is §clocked§e! §bSneak middle-click to unlock.
gt.behaviour.paintspray.infinite.gui.solvent=Solvent
Expand Down
Loading