Skip to content

Commit

Permalink
Dev (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub GTNH Actions <>
  • Loading branch information
Dream-Master authored Feb 11, 2025
1 parent 995fad8 commit c437a67
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 15 deletions.
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

dependencies {
api("com.github.GTNewHorizons:waila:1.8.2:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.25-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.29-GTNH:dev")

devOnlyNonPublishable("com.github.GTNewHorizons:TinkersConstruct:1.13.7-GTNH:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:TinkersConstruct:1.13.8-GTNH:dev")
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.31'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.32'
}


Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,26 @@ protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {

GL11.glPushMatrix();
boolean isFilled = tank.getFluid() != null;
String name = isFilled ? WordUtils.capitalize(tank.getFluid().getFluid().getName()) : "None";
String name = isFilled ? WordUtils.capitalize(tank.getFluid().getLocalizedName()) : "None";
String amount = isFilled ? "" + tank.getFluid().amount : "0";
String capacity = Integer.toString(tank.getCapacity());
int offsetY = 8;
int offsetX = 83;
fontRendererObj.drawString(name, 1 + offsetX, offsetY, 0x373737, false);
fontRendererObj.drawString(amount, 1 + offsetX, 10 + offsetY, 0x373737, false);
fontRendererObj.drawString(capacity, 1 + offsetX, 20 + offsetY, 0x373737, false);
int offsetX = 70;
int textWidth = 100;
for (Object chunk : fontRendererObj.listFormattedStringToWidth(name, textWidth)) {
fontRendererObj.drawString((String) chunk, 1 + offsetX, offsetY, 0x373737, false);
offsetY += 10;
}
fontRendererObj.drawString(amount, 1 + offsetX, offsetY, 0x373737, false);
offsetY += 10;
fontRendererObj.drawString(capacity, 1 + offsetX, offsetY, 0x373737, false);
offsetY += 10;

if (isFilled) {
Float rate = GeneralReference.getFuelRate(name.toLowerCase());
String conLev = (rate != null) ? rate.toString() : "0";
fontRendererObj.drawString("Consumption: " + conLev, 1 + offsetX, 40 + offsetY, 0x373737, false);
offsetY += 10;
fontRendererObj.drawString("Consumption: " + conLev, 1 + offsetX, offsetY, 0x373737, false);
}

GL11.glPopMatrix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ private void drawMethodOne(GuiWithTanks gui) {
for (int i = (startX + offsetX); i < (startX + offsetX) + width; i += resolution) {
for (int j = maxY - resolution; j >= maxY - pixelsY; j -= resolution) {
GL11.glPushMatrix();
GL11.glColor4f(1, 1, 1, 1);
int rgb = fluid.getFluid().getColor();
int red = (rgb >> 16) & 0xFF;
int green = (rgb >> 8) & 0xFF;
int blue = rgb & 0xFF;
GL11.glColor4f(red / 256f, green / 256f, blue / 256f, 1f);
gui.drawTexturedModelRectFromIcon(i, j, icon, resolution, resolution);
GL11.glPopMatrix();
}
Expand All @@ -116,7 +120,11 @@ private void drawMethodTwo() {
int iconY = 7;
for (int j = maxY; j >= top; j--) {
GL11.glPushMatrix();
GL11.glColor4f(1, 1, 1, 1);
int rgb = fluid.getFluid().getColor();
int red = (rgb >> 16) & 0xFF;
int green = (rgb >> 8) & 0xFF;
int blue = rgb & 0xFF;
GL11.glColor4f(red / 256f, green / 256f, blue / 256f, 1f);
drawFluidPixelFromIcon(i, j, icon, resolution, 1, 0, iconY, resolution, 0, zLevel);
iconY = (iconY == 0) ? 7 : iconY - 1;
GL11.glPopMatrix();
Expand All @@ -136,10 +144,14 @@ private void drawMethodThree() {
for (int j = (startY + offsetY) + height - 1; j >= top; j--) {
for (int i = (startX + offsetX); i <= (startX + offsetX) + width - 1; i++) {
GL11.glPushMatrix();
int rgb = fluid.getFluid().getColor();
int red = (rgb >> 16) & 0xFF;
int green = (rgb >> 8) & 0xFF;
int blue = rgb & 0xFF;
if (j >= top + 5) {
GL11.glColor4f(0.9f, 0.9f, 0.9f, 1);
GL11.glColor4f(red / 256f * 0.9f, green / 256f * 0.9f, blue / 256f * 0.9f, 1f);
} else {
GL11.glColor4f(1, 1, 1, 1);
GL11.glColor4f(red / 256f, green / 256f, blue / 256f, 1f);
}
drawFluidPixelFromIcon(i, j, icon, 1, 1, 0, 0, 0, 0, zLevel);
GL11.glPopMatrix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ public class ConfigHandler {
public static String[] forbiddenDimensions;
public static String[] copterFuels;
private static final String[] defaultFuels = { "biodiesel, 1.0", "biofuel, 1.0", "bioethanol, 1.5", "creosote, 7.0",
"fuel, 0.8", "lava, 5.0", "liquid_light_oil, 3.0", "liquid_medium_oil, 3.0", "liquid_heavy_oil, 3.0",
"liquid_light_fuel, 1.0", "liquid_heavy_fuel, 1.3", "nitrofuel, 0.4", "oil, 3.0", "rocket_fuel, 0.8" };
"fuel, 0.8", "highoctanegasoline, 0.16", "lava, 5.0", "liquid_light_oil, 3.0", "liquid_medium_oil, 3.0",
"liquid_heavy_oil, 3.0", "liquid_light_fuel, 1.0", "liquid_heavy_fuel, 1.3", "nitrofuel, 0.4", "oil, 3.0",
"rocket_fuel, 0.8" };

public static String[] nameLocalized;
public static String[] nameInternalID;
Expand Down

0 comments on commit c437a67

Please sign in to comment.