Compare commits

..
Author SHA1 Message Date
Martin Robertz 78b49c45d7 sa 2025-11-14 19:28:18 +01:00
Martin Robertz 66cbe586ef update
(cherry picked from commit 6b573fba035a5b729182bc99c31f9260f1f91077)
2025-11-14 19:22:20 +01:00
Martin Robertzanddanyadev 00118d3905 Waila plugins compat (#56)
Co-authored-by: danyadev <[email protected]>
2025-11-14 19:21:30 +01:00
Martin Robertz 2ea05f2ad9 Merge remote-tracking branch 'danyadev/add-contribution-note' into dev 2025-11-14 18:45:35 +01:00
Martin Robertz 3bba4e931c Merge remote-tracking branch 'MalTeeez/master' into dev 2025-11-14 18:45:27 +01:00
danyadev 4b9ffa5f2c add commands to fetch tags manually 2025-11-14 14:46:28 +03:00
danyadev 61cb18bad0 refine the text 2025-11-12 12:35:40 +03:00
danyadev c9db4f214b add a note about forking the repo in README.md 2025-11-12 01:39:56 +03:00
14 changed files with 31 additions and 179 deletions

No files matched your search

+6 -15
View File
@@ -1,23 +1,14 @@
// Add your dependencies here
dependencies {
implementation('com.github.GTNewHorizons:NotEnoughItems:2.8.20-GTNH:dev')
implementation('com.github.GTNewHorizons:NotEnoughItems:2.8.37-GTNH:dev')
shadowImplementation('au.com.bytecode:opencsv:2.4')
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.69:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.106:dev") { transitive = false }
runtimeOnly("com.github.GTNewHorizons:WAILAPlugins:0.7.0:dev") {
exclude group: 'com.github.GTNewHorizons', module: 'waila'
}
runtimeOnly("com.github.GTNewHorizons:EnderCore:0.5.0:dev")
runtimeOnly("com.github.GTNewHorizons:BuildCraft:7.1.31:dev")
runtimeOnly("curse.maven:cofh-lib-220333:2388748")
runtimeOnly("curse.maven:extrautils-225561:2264383")
runtimeOnly("com.github.GTNewHorizons:OpenBlocks:1.12.3-GTNH:dev")
runtimeOnly("com.github.GTNewHorizons:Railcraft:9.17.6:dev")
runtimeOnly('curse.maven:thermal-foundation-222880:2388753')
runtimeOnly('curse.maven:thermal-expansion-69163:2388759')
runtimeOnly('curse.maven:thermal-dynamics-227443:2388756')
implementation('curse.maven:cofh-core-69162:2388751')
// For testing addon integration
runtimeOnly("com.github.GTNewHorizons:WAILAPlugins:0.7.0:dev") { transitive = false }
runtimeOnly("com.github.GTNewHorizons:EnderCore:0.5.0:dev") { transitive = false }
runtimeOnly("com.mod-buildcraft:buildcraft:7.1.23:dev") { transitive = false }
}
+6
View File
@@ -174,6 +174,12 @@ curseForgeRelations =
# projects. New projects should not use this parameter.
# customArchiveBaseName =
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
# runClientWorkingDirectory = run/client
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
# runServerWorkingDirectory = run/server
# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+2 -2
View File
@@ -114,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
Vendored
+2 -2
View File
@@ -70,11 +70,11 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.46'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.48'
}
@@ -1,6 +1,5 @@
package mcp.mobius.waila.addons.thermalexpansion;
import java.text.NumberFormat;
import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -14,7 +13,7 @@ import mcp.mobius.waila.api.ITaggedList;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.SpecialChars;
import mcp.mobius.waila.utils.WailaExceptionHandler;
public class HUDHandlerIEnergyHandler implements IWailaDataProvider {
@@ -35,27 +34,15 @@ public class HUDHandlerIEnergyHandler implements IWailaDataProvider {
if (!config.getConfig("thermalexpansion.energyhandler")) return currenttip;
if (!accessor.getNBTData().hasKey("Energy")) return currenttip;
if (!accessor.getNBTData().hasKey("MaxStorage")) return currenttip;
if (currenttip instanceof ITaggedList taggedTips) {
int energy = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
int maxEnergy = accessor.getNBTInteger(accessor.getNBTData(), "MaxStorage");
if (maxEnergy > 0 && taggedTips.getEntries("RFEnergyStorage").isEmpty()) {
if (config.getConfig("thermalexpansion.rfenergybar")) {
taggedTips.add(
SpecialChars.getRenderString("waila.rfenergy", energy + "", maxEnergy + ""),
"RFEnergyStorage");
} else {
taggedTips.add(
// TODO: Use NumberFormatter from #54
String.format(
"%s / %s RF",
NumberFormat.getInstance().format(energy),
NumberFormat.getInstance().format(maxEnergy)),
"RFEnergyStorage");
}
int energy = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
int maxEnergy = accessor.getNBTInteger(accessor.getNBTData(), "MaxStorage");
try {
if ((maxEnergy != 0) && (((ITaggedList) currenttip).getEntries("RFEnergyStorage").size() == 0)) {
((ITaggedList) currenttip).add(String.format("%d / %d RF", energy, maxEnergy), "RFEnergyStorage");
}
} catch (Exception e) {
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
}
return currenttip;
@@ -68,7 +68,6 @@ public class ThermalExpansionModule {
IEnergyInfo_getCurStorage = IEnergyInfo.getMethod("getInfoEnergyStored");
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.rfenergybar");
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyProvider);
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIEnergyHandler(), IEnergyProvider);
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyReceiver);
@@ -24,7 +24,6 @@ import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderAspectString;
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderFluidBar;
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderHealth;
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderProgressBar;
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderRFBar;
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderStack;
import mcp.mobius.waila.server.ProxyServer;
import mcp.mobius.waila.utils.LoadedMods;
@@ -62,7 +61,6 @@ public class ProxyClient extends ProxyServer {
ModuleRegistrar.instance().registerTooltipRenderer("waila.stack", new TTRenderStack());
ModuleRegistrar.instance().registerTooltipRenderer("waila.progress", new TTRenderProgressBar());
ModuleRegistrar.instance().registerTooltipRenderer("waila.fluid", new TTRenderFluidBar());
ModuleRegistrar.instance().registerTooltipRenderer("waila.rfenergy", new TTRenderRFBar());
ModuleRegistrar.instance().registerTooltipRenderer("waila.tcaspect", new TTRenderAspectString());
@@ -1,133 +0,0 @@
package mcp.mobius.waila.overlay.tooltiprenderers;
import java.awt.Dimension;
import java.text.NumberFormat;
import java.util.function.Function;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import mcp.mobius.waila.api.IWailaCommonAccessor;
import mcp.mobius.waila.api.IWailaVariableWidthTooltipRenderer;
import mcp.mobius.waila.overlay.DisplayUtil;
public class TTRenderRFBar implements IWailaVariableWidthTooltipRenderer {
int maxStringW;
private final Function<Integer, String> formatNumber;
private static final NumberFormat energyFormat = NumberFormat.getInstance();
private static final int height = 12;
private static final int width = 2;
static {
energyFormat.setGroupingUsed(true);
}
public TTRenderRFBar() {
formatNumber = energyFormat::format;
}
@Override
public Dimension getSize(String[] params, IWailaCommonAccessor accessor) {
int commaCount = (int) (Math.floor((params[0].length() - 1) / 3D) + Math.floor((params[1].length() - 1) / 3D));
StringBuilder sb = new StringBuilder(commaCount);
for (int i = 0; i < commaCount; i++) {
sb.append(",");
}
return new Dimension(
DisplayUtil.getDisplayWidth(String.format("%s / %s RF%s", params[0], params[1], sb)) + 4,
height);
}
public static final ResourceLocation barTexture = new ResourceLocation("waila", "textures/rf_energy_bar.png");
public static final ResourceLocation gradientTexture = new ResourceLocation("waila", "textures/gradient.png");
@Override
public void draw(String[] params, IWailaCommonAccessor accessor) {
int amount = Integer.parseInt(params[0]);
int capacity = Integer.parseInt(params[1]);
Tessellator tessellator = Tessellator.instance;
Minecraft mc = Minecraft.getMinecraft();
mc.getTextureManager().bindTexture(barTexture);
GL11.glColor4f(1F, 1F, 1F, 1F);
tessellator.startDrawingQuads();
// Draw dark (uncharged) background for whole bar first
for (int i = 0; i < (maxStringW - 2); i += width) {
drawRect(tessellator, 1 + i, 0, 0, width, height, 0.0, 0.0, 0.5, 1.0);
}
double i = (double) (maxStringW - 2) * amount / capacity;
int drawnRects = 0;
for (; i > width; i -= width) {
drawRect(tessellator, 1 + (drawnRects * width), 0, 0, width, height, 0.5, 0.0, 1.0, 1.0);
drawnRects++;
}
// Do less than full increments just as much as they take up on the scaled texture
drawRectD(tessellator, 1 + (drawnRects * width), 0, 0, i, height, 0.5, 0.0, 0.5 + 0.25 * i, 1.0);
tessellator.draw();
// Border
drawThickBeveledBox(0, 0, maxStringW, height, 1, 0xFF505050, 0xFF505050, -1);
// Gradient
GL11.glEnable(GL11.GL_BLEND);
GL11.glColor4f(1F, 1F, 1F, 0.5F);
mc.getTextureManager().bindTexture(gradientTexture);
tessellator.startDrawingQuads();
drawRect(tessellator, 1, 1, 0, maxStringW - 2, height - 2, 0, 0, 1, 1);
tessellator.draw();
DisplayUtil.drawString(
String.format("%s / %s RF", formatNumber.apply(amount), formatNumber.apply(capacity)),
2,
2,
0xFFFFFFFF,
true);
}
public static void drawRect(Tessellator tessellator, int x, int y, double z, int width, int height, double minU,
double minV, double maxU, double maxV) {
tessellator.addVertexWithUV(x, y + height, z, minU, maxV);
tessellator.addVertexWithUV(x + width, y + height, z, maxU, maxV);
tessellator.addVertexWithUV(x + width, y, z, maxU, minV);
tessellator.addVertexWithUV(x, y, z, minU, minV);
}
public static void drawRectD(Tessellator tessellator, double x, double y, double z, double width, double height,
double minU, double minV, double maxU, double maxV) {
tessellator.addVertexWithUV(x, y + height, z, minU, maxV);
tessellator.addVertexWithUV(x + width, y + height, z, maxU, maxV);
tessellator.addVertexWithUV(x + width, y, z, maxU, minV);
tessellator.addVertexWithUV(x, y, z, minU, minV);
}
public static void drawThickBeveledBox(int x1, int y1, int x2, int y2, int thickness, int topleftcolor,
int botrightcolor, int fillcolor) {
if (fillcolor != -1) {
Gui.drawRect(x1 + 1, y1 + 1, x2 - 1, y2 - 1, fillcolor);
}
Gui.drawRect(x1, y1, x2 - 1, y1 + thickness, topleftcolor);
Gui.drawRect(x1, y1, x1 + thickness, y2 - 1, topleftcolor);
Gui.drawRect(x2 - thickness, y1, x2, y2 - 1, botrightcolor);
Gui.drawRect(x1, y2 - thickness, x2, y2, botrightcolor);
}
@Override
public void setMaxLineWidth(int width) {
maxStringW = width + 2;
}
@Override
public int getMaxLineWidth() {
return maxStringW;
}
}
@@ -11,6 +11,10 @@ public class NumberFormatter {
private static NumberFormat numberFormat = NumberFormat.getInstance(getCurrentLocale());
static {
numberFormat.setGroupingUsed(true);
}
public static String format(long number) {
if (LoadedMods.GT5U) {
return GTUtility.formatNumbers(number);
@@ -30,5 +34,6 @@ public class NumberFormatter {
public static void onResourcesReload() {
numberFormat = NumberFormat.getInstance(getCurrentLocale());
numberFormat.setGroupingUsed(true);
}
}
@@ -114,7 +114,6 @@ option.ic2.consump=Show consumption
option.ic2.tradeomat=Show Trade-O-Mat request
option.thaumcraft.storedvis=Capacitor storage
option.thermalexpansion.energyhandler=Show RF storage
option.thermalexpansion.rfenergybar=Use Progress Bar for RF
option.thermalexpansion.energycell=Show ECell IN/OUT
option.thermalexpansion.fluidtype=Show fluid type
option.thermalexpansion.fluidamount=Show fluid amount
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB