Skip to content

Commit

Permalink
Add Waila Pipe info (#3839)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: Maya <[email protected]>
  • Loading branch information
3 people authored Jan 21, 2025
1 parent 3f08a8e commit 98426a7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
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"));
}

// 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

0 comments on commit 98426a7

Please sign in to comment.