mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-15 17:44:46 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b612897ddb | ||
|
|
a5607eda00 | ||
|
|
f242cf77a9 |
No files matched your search
+5
-5
@@ -1,24 +1,24 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.8.50-GTNH:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.8.55-GTNH:dev')
|
||||
|
||||
shadowImplementation('au.com.bytecode:opencsv:2.4')
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.205:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.9.6:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.226:dev") { transitive = false }
|
||||
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:WAILAPlugins:0.7.2:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'waila'
|
||||
}
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:EnderCore:0.5.3:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:EnderCore:0.5.5:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:BuildCraft:7.1.48:dev")
|
||||
runtimeOnlyNonPublishable("curse.maven:cofh-lib-220333:2388748")
|
||||
runtimeOnlyNonPublishable("curse.maven:extrautils-225561:2264383")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:OpenBlocks:1.12.4-GTNH:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:Railcraft:9.17.12:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:Railcraft:9.17.15:dev")
|
||||
runtimeOnlyNonPublishable('curse.maven:thermal-foundation-222880:2388753')
|
||||
runtimeOnlyNonPublishable('curse.maven:thermal-expansion-69163:2388759')
|
||||
runtimeOnlyNonPublishable('curse.maven:thermal-dynamics-227443:2388756')
|
||||
implementation('curse.maven:cofh-core-69162:2388751')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.9.6:dev")
|
||||
}
|
||||
+30
-3
@@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
# Enables modern Java syntax support. Valid values:
|
||||
# - false: No modern syntax, Java 8 only
|
||||
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||
# - modern: Native modern Java bytecode, no downgrading
|
||||
enableModernJavaSyntax = jabel
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||
# downgradeTargetVersion = 8
|
||||
|
||||
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||
|
||||
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||
# - shade: Shade minimized stubs into the jar
|
||||
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||
# - (empty): Warning reminding you to configure stubs
|
||||
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||
# jvmDowngraderStubsProvider =
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
@@ -209,3 +233,6 @@ curseForgeRelations =
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
# Non-GTNH properties
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.parallel = true
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/93aeea858331bd6bb00ba94759830234/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/93aeea858331bd6bb00ba94759830234/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7799fb2cb9f9eb382df2b8b6fb793b77/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/99a42fd36e2e41c7c8ed49f423f49fdf/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/93aeea858331bd6bb00ba94759830234/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3087f28f30be41ab6818c16a488f5f8a/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -172,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
|
||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%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" %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.49'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.18'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package mcp.mobius.waila.addons.buildcraft;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatFluid;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -19,7 +22,6 @@ import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class TankFluidHandler implements IWailaDataProvider {
|
||||
|
||||
@@ -60,12 +62,7 @@ public class TankFluidHandler implements IWailaDataProvider {
|
||||
int liquidAmount = stack != null ? stack.amount : 0;
|
||||
int capacity = tank != null ? tank.capacity : 0;
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(liquidAmount),
|
||||
NumberFormatter.format(capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
currenttip.add(String.format("%s / %s", formatNumber(liquidAmount), formatFluid(capacity)));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package mcp.mobius.waila.addons.exu;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatFluid;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -14,8 +17,6 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class DrumFluidHandler implements IWailaDataProvider {
|
||||
|
||||
@@ -43,12 +44,7 @@ public class DrumFluidHandler implements IWailaDataProvider {
|
||||
if (tanks.length != 1) return currenttip;
|
||||
|
||||
int amount = tanks[0].fluid == null ? 0 : tanks[0].fluid.amount;
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(tanks[0].capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
currenttip.add(String.format("%s / %s", formatNumber(amount), formatFluid(tanks[0].capacity)));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package mcp.mobius.waila.addons.openblocks;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatFluid;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -15,9 +18,7 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class TankFluidHandler implements IWailaDataProvider {
|
||||
|
||||
@@ -59,12 +60,7 @@ public class TankFluidHandler implements IWailaDataProvider {
|
||||
if (tanks.length != 1) return currenttip;
|
||||
|
||||
int amount = tanks[0].fluid == null ? 0 : tanks[0].fluid.amount;
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(tanks[0].capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
currenttip.add(String.format("%s / %s", formatNumber(amount), formatFluid(tanks[0].capacity)));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package mcp.mobius.waila.addons.railcraft;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatFluid;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -15,9 +18,7 @@ import net.minecraftforge.fluids.IFluidTank;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
|
||||
public class TankFluidHandler implements IWailaDataProvider {
|
||||
@@ -56,12 +57,7 @@ public class TankFluidHandler implements IWailaDataProvider {
|
||||
FluidStack fluid = tank.getFluid();
|
||||
int amount = fluid == null ? 0 : fluid.amount;
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(tank.getCapacity()),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
currenttip.add(String.format("%s / %s", formatNumber(amount), formatFluid(tank.getCapacity())));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mcp.mobius.waila.addons.stevescarts;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||
import static mcp.mobius.waila.api.SpecialChars.GRAY;
|
||||
import static mcp.mobius.waila.api.SpecialChars.ITALIC;
|
||||
@@ -80,7 +81,8 @@ public class HUDCargoManager implements IWailaDataProvider {
|
||||
|
||||
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
||||
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
||||
String sAmount = amount == 0 ? "All" : this.getAmount(amount) + " " + this.getAmountType(amount);
|
||||
String sAmount = amount == 0 ? "All"
|
||||
: formatNumber(this.getAmount(amount)) + " " + this.getAmountType(amount);
|
||||
|
||||
String selection = (String) StevesCartsModule.GetSelectionName
|
||||
.invoke(StevesCartsModule.CargoItemSelection.cast(itemSelection.get(target)));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mcp.mobius.waila.addons.stevescarts;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatFluid;
|
||||
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||
import static mcp.mobius.waila.api.SpecialChars.GRAY;
|
||||
import static mcp.mobius.waila.api.SpecialChars.ITALIC;
|
||||
@@ -77,13 +78,14 @@ public class HUDLiquidManager implements IWailaDataProvider {
|
||||
fluidAmount = tag.getCompoundTag("Fluid" + i).getInteger("Amount");
|
||||
}
|
||||
|
||||
String fluidString = fluidAmount == 0 ? "<Empty>" : String.format("%s mB of %s", fluidAmount, fluidName);
|
||||
String fluidString = fluidAmount == 0 ? "<Empty>"
|
||||
: String.format("%s of %s", formatFluid(fluidAmount), fluidName);
|
||||
|
||||
if (color == 5) continue;
|
||||
|
||||
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
||||
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
||||
String sAmount = amount == 0 ? "All" : this.getMaxAmountBuckets(amount) + " mB";
|
||||
String sAmount = amount == 0 ? "All" : formatFluid(this.getMaxAmountBuckets(amount));
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mcp.mobius.waila.addons.stevescarts;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||
import static mcp.mobius.waila.api.SpecialChars.GRAY;
|
||||
import static mcp.mobius.waila.api.SpecialChars.ITALIC;
|
||||
@@ -47,7 +48,7 @@ public class HUDMinecartModular implements IWailaEntityProvider {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
Item ItemCartModule = null;
|
||||
Item ItemCartModule;
|
||||
try {
|
||||
ItemCartModule = (Item) StevesCartsModule.ItemCartModule.get(null);
|
||||
} catch (Exception e) {
|
||||
@@ -76,12 +77,11 @@ public class HUDMinecartModular implements IWailaEntityProvider {
|
||||
currenttip.add(
|
||||
new ItemStack(ItemCartModule, 1, metas[i]).getDisplayName() + TAB
|
||||
+ ALIGNRIGHT
|
||||
+ GRAY
|
||||
+ " [ "
|
||||
+ WHITE
|
||||
+ amount
|
||||
+ GRAY
|
||||
+ " mB of "
|
||||
+ WHITE
|
||||
+ formatNumber(amount)
|
||||
+ " of "
|
||||
+ fluid
|
||||
+ GRAY
|
||||
+ " ]");
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package mcp.mobius.waila.addons.thermaldynamics;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatFluid;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -15,9 +18,7 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
/**
|
||||
* Created by Lordmau5 on 28.02.2015.
|
||||
@@ -71,12 +72,7 @@ public class FluiductFluidHandler implements IWailaDataProvider {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
currenttip.add(String.format("%s / %s", formatNumber(amount), formatFluid(capacity)));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -12,7 +14,6 @@ import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class HUDHandlerEnergyCell implements IWailaDataProvider {
|
||||
|
||||
@@ -40,8 +41,8 @@ public class HUDHandlerEnergyCell implements IWailaDataProvider {
|
||||
"%s/%s : %s / %s RF/t",
|
||||
LangUtil.translateG("hud.msg.in"),
|
||||
LangUtil.translateG("hud.msg.out"),
|
||||
NumberFormatter.format(energyReceive),
|
||||
NumberFormatter.format(energySend)));
|
||||
formatNumber(energyReceive),
|
||||
formatNumber(energySend)));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
+3
-5
@@ -1,5 +1,7 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -14,7 +16,6 @@ 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.NumberFormatter;
|
||||
|
||||
public class HUDHandlerIEnergyHandler implements IWailaDataProvider {
|
||||
|
||||
@@ -48,10 +49,7 @@ public class HUDHandlerIEnergyHandler implements IWailaDataProvider {
|
||||
"RFEnergyStorage");
|
||||
} else {
|
||||
taggedTips.add(
|
||||
String.format(
|
||||
"%s / %s RF",
|
||||
NumberFormatter.format(energy),
|
||||
NumberFormatter.format(maxEnergy)),
|
||||
String.format("%s / %s RF", formatNumber(energy), formatNumber(maxEnergy)),
|
||||
"RFEnergyStorage");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatFluid;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -12,9 +15,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
|
||||
public class TankFluidHandler implements IWailaDataProvider {
|
||||
@@ -65,12 +66,7 @@ public class TankFluidHandler implements IWailaDataProvider {
|
||||
int amount = (Integer) ThermalExpansionModule.TileTank_getTankAmount.invoke(tileEntity);
|
||||
int capacity = (Integer) ThermalExpansionModule.TileTank_getTankCapacity.invoke(tileEntity);
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
currenttip.add(String.format("%s / %s", formatNumber(amount), formatFluid(capacity)));
|
||||
|
||||
} catch (Exception e) {
|
||||
WailaExceptionHandler.handleErr(e, tileEntity.getClass().getName(), currenttip);
|
||||
|
||||
@@ -34,8 +34,6 @@ public class ConfigHandler implements IWailaConfigHandler {
|
||||
public HashMap<String, Boolean> forcedConfigs = new HashMap<>();
|
||||
public Configuration config = null;
|
||||
|
||||
public String fluidUnit;
|
||||
|
||||
public void addModule(String modName, HashMap<String, String> options) {
|
||||
this.addModule(modName, new ConfigModule(modName, options));
|
||||
}
|
||||
@@ -152,7 +150,6 @@ public class ConfigHandler implements IWailaConfigHandler {
|
||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_KEYBIND, true);
|
||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_NEWFILTERS, true);
|
||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOWICON, true);
|
||||
fluidUnit = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_FLUIDUNIT, "mB").getString();
|
||||
|
||||
OverlayConfig.posX = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSX, 5000).getInt();
|
||||
OverlayConfig.posY = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSY, 100).getInt();
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package mcp.mobius.waila.client;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -28,7 +24,6 @@ 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;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class ProxyClient extends ProxyServer {
|
||||
|
||||
@@ -67,9 +62,6 @@ public class ProxyClient extends ProxyServer {
|
||||
ModuleRegistrar.instance().registerTooltipRenderer("waila.tcaspect", new TTRenderAspectString());
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new WorldUnloadEventHandler());
|
||||
|
||||
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager())
|
||||
.registerReloadListener(new NumberFormatterReloadListener());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,12 +80,4 @@ public class ProxyClient extends ProxyServer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class NumberFormatterReloadListener implements IResourceManagerReloadListener {
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
NumberFormatter.onResourcesReload();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,14 +15,16 @@ public class OverlayRenderer {
|
||||
private static boolean hasDepthTest;
|
||||
private static int boundTexIndex;
|
||||
|
||||
public static void renderOverlay(Tooltip tooltip) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (!(mc.currentScreen == null && mc.theWorld != null
|
||||
public static boolean isOverlayVisible() {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
return (mc.currentScreen == null && mc.theWorld != null
|
||||
&& Minecraft.isGuiEnabled()
|
||||
&& !mc.gameSettings.keyBindPlayerList.getIsKeyPressed()
|
||||
&& ConfigHandler.instance().showTooltip()
|
||||
&& RayTracing.instance().getTarget() != null))
|
||||
return;
|
||||
&& ConfigHandler.instance().showTooltip());
|
||||
}
|
||||
|
||||
public static void renderOverlay(Tooltip tooltip) {
|
||||
if (!isOverlayVisible() || RayTracing.instance().getTarget() == null) return;
|
||||
|
||||
if (RayTracing.instance().getTarget().typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
|
||||
&& RayTracing.instance().getTargetStack() != null) {
|
||||
|
||||
@@ -35,13 +35,9 @@ public class WailaTickHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void tickClient(TickEvent.ClientTickEvent event) {
|
||||
|
||||
if (event.phase == TickEvent.Phase.START) return;
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
World world = mc.theWorld;
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
if (world == null || player == null) {
|
||||
if (!OverlayRenderer.isOverlayVisible()) {
|
||||
this.tooltip = null;
|
||||
RayTracing.instance().clear();
|
||||
return;
|
||||
@@ -49,6 +45,9 @@ public class WailaTickHandler {
|
||||
|
||||
RayTracing.instance().fire();
|
||||
MovingObjectPosition target = RayTracing.instance().getTarget();
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
World world = mc.theWorld;
|
||||
|
||||
List<String> currenttip;
|
||||
List<String> currenttipHead;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package mcp.mobius.waila.overlay.tooltiprenderers;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatFluid;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -20,11 +23,9 @@ import gtPlusPlus.api.objects.minecraft.FluidGT6;
|
||||
import gtPlusPlus.core.util.minecraft.FluidUtils;
|
||||
import mcp.mobius.waila.api.IWailaCommonAccessor;
|
||||
import mcp.mobius.waila.api.IWailaVariableWidthTooltipRenderer;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.overlay.DisplayUtil;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class TTRenderFluidBar implements IWailaVariableWidthTooltipRenderer {
|
||||
|
||||
@@ -124,18 +125,8 @@ public class TTRenderFluidBar implements IWailaVariableWidthTooltipRenderer {
|
||||
}
|
||||
|
||||
public String buildDisplayText(double amount, double capacity, String fluidName, boolean isEmpty) {
|
||||
return isEmpty
|
||||
? String.format(
|
||||
"%s / %s %s",
|
||||
LangUtil.translateG("hud.msg.empty"),
|
||||
NumberFormatter.format((int) capacity),
|
||||
ConfigHandler.instance().fluidUnit)
|
||||
: String.format(
|
||||
"%s / %s %s %s",
|
||||
NumberFormatter.format((int) amount),
|
||||
NumberFormatter.format((int) capacity),
|
||||
ConfigHandler.instance().fluidUnit,
|
||||
fluidName);
|
||||
return isEmpty ? String.format("%s / %s", LangUtil.translateG("hud.msg.empty"), formatFluid(capacity))
|
||||
: String.format("%s / %s %s", formatNumber(amount), formatFluid(capacity), fluidName);
|
||||
}
|
||||
|
||||
public static void drawRectFromIcon(Tessellator tessellator, int x, int y, double z, IIcon icon, int width,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package mcp.mobius.waila.overlay.tooltiprenderers;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.awt.Dimension;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -12,7 +14,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import mcp.mobius.waila.api.IWailaCommonAccessor;
|
||||
import mcp.mobius.waila.api.IWailaVariableWidthTooltipRenderer;
|
||||
import mcp.mobius.waila.overlay.DisplayUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class TTRenderRFBar implements IWailaVariableWidthTooltipRenderer {
|
||||
|
||||
@@ -74,7 +75,7 @@ public class TTRenderRFBar implements IWailaVariableWidthTooltipRenderer {
|
||||
}
|
||||
|
||||
public String buildDisplayText(int amount, int capacity) {
|
||||
return String.format("%s / %s RF", NumberFormatter.format(amount), NumberFormatter.format(capacity));
|
||||
return String.format("%s / %s RF", formatNumber(amount), formatNumber(capacity));
|
||||
}
|
||||
|
||||
public static void drawRect(Tessellator tessellator, int x, int y, double z, int width, int height, double minU,
|
||||
|
||||
@@ -7,6 +7,5 @@ public class LoadedMods {
|
||||
public static boolean FORGE_MULTIPART = Loader.isModLoaded("ForgeMultipart");
|
||||
public static boolean NEI = Loader.isModLoaded("NotEnoughItems");
|
||||
public static boolean GT5U = Loader.isModLoaded("gregtech_nh");
|
||||
public static boolean GTNH_LIB = Loader.isModLoaded("gtnhlib");
|
||||
public static boolean WAILA_PLUGINS = Loader.isModLoaded("wailaplugins");
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package mcp.mobius.waila.utils;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class NumberFormatter {
|
||||
|
||||
private static NumberFormat numberFormat = NumberFormat.getInstance(getCurrentLocale());
|
||||
|
||||
public static String format(long number) {
|
||||
if (LoadedMods.GTNH_LIB) {
|
||||
return formatNumber(number);
|
||||
}
|
||||
|
||||
return numberFormat.format(number);
|
||||
}
|
||||
|
||||
public static Locale getCurrentLocale() {
|
||||
String langCode = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
|
||||
String[] parts = langCode.split("_", 2);
|
||||
String language = parts[0];
|
||||
String country = parts.length == 1 ? "" : parts[1];
|
||||
|
||||
return new Locale(language, country);
|
||||
}
|
||||
|
||||
public static void onResourcesReload() {
|
||||
numberFormat = NumberFormat.getInstance(getCurrentLocale());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user