Skip to content

Commit

Permalink
Long Distance Pipeline tweaks (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchej123 authored Apr 27, 2021
1 parent 4e42474 commit 16a5c69
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/tterrag/wailaplugins/plugins/PluginGregtech5U.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer;
import gregtech.common.covers.GT_Cover_Fluidfilter;
import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler_Solar;
import gregtech.common.tileentities.machines.long_distance.GT_MetaTileEntity_LongDistancePipelineBase;
import lombok.SneakyThrows;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaRegistrar;
Expand Down Expand Up @@ -41,6 +42,7 @@ public void load(IWailaRegistrar registrar)
addConfig("machineFacing");
addConfig("transformer");
addConfig("solar");
addConfig("LDP");
addConfig("basicmachine");
addConfig("multiblock");
addConfig("fluidFilter");
Expand All @@ -65,6 +67,7 @@ protected void getBody(ItemStack stack, List<String> currenttip, IWailaDataAcces
final GT_MetaTileEntity_MultiBlockBase multiBlockBase = tMeta instanceof GT_MetaTileEntity_MultiBlockBase ? ((GT_MetaTileEntity_MultiBlockBase) tMeta) : null;

final boolean showTransformer = tMeta instanceof GT_MetaTileEntity_Transformer && getConfig("transformer");
final boolean showLDP = tMeta instanceof GT_MetaTileEntity_LongDistancePipelineBase && getConfig("LDP");
final boolean showSolar = tMeta instanceof GT_MetaTileEntity_Boiler_Solar && getConfig("solar");
final boolean allowedToWork = tag.hasKey("isAllowedToWork") && tag.getBoolean("isAllowedToWork");

Expand Down Expand Up @@ -102,6 +105,13 @@ protected void getBody(ItemStack stack, List<String> currenttip, IWailaDataAcces
} else {
currenttip.add(String.format(BLUE + "Output:" + RESET + " %d(%dA)", tag.getLong("maxEUOutput"), tag.getLong("maxAmperesOut")));
}
} else if (showLDP) {
if(side == facing)
currenttip.add(GOLD + "Pipeline Input" + RESET);
else if (side == ForgeDirection.OPPOSITES[facing])
currenttip.add(BLUE + "Pipeline Output" + RESET);
else
currenttip.add("Pipeline Side");
} else {
currenttip.add(String.format("%s: %s", facingStr, ForgeDirection.getOrientation(facing).name()));
}
Expand Down Expand Up @@ -147,7 +157,7 @@ protected void getNBTData(TileEntity tile, NBTTagCompound tag, World world, Bloc
final GT_MetaTileEntity_Boiler_Solar solar = (GT_MetaTileEntity_Boiler_Solar)tMeta;
tag.setInteger("calcificationOutput", (solar.getProductionPerSecond()));
tag.setInteger("maxCalcificationOutput", (solar.getMaxOutputPerSecond()));
}
}

if (BasicMachine != null) {
final int progressSingleBlock = BasicMachine.mProgresstime/20;
Expand Down

0 comments on commit 16a5c69

Please sign in to comment.