mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-15 01:25:16 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6d48b32f7 | ||
|
|
4fb3d1edaa | ||
|
|
678bb6dd44 | ||
|
|
5333808d65 | ||
|
|
4750486375 | ||
|
|
0f9710a9f9 | ||
|
|
0c0ac4fcfa | ||
|
|
a189446cac | ||
|
|
6279ef2b09 | ||
|
|
6cf6dafb53 | ||
|
|
2f738bc728 | ||
|
|
8329a4f186 | ||
|
|
e5ab6193a5 |
No files matched your search
@@ -27,3 +27,4 @@ whitelist.json
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
layout.json
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.5.25-GTNH:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.7.31-GTNH:dev')
|
||||
|
||||
shadowImplementation('au.com.bytecode:opencsv:2.4')
|
||||
}
|
||||
+12
-1
@@ -85,6 +85,11 @@ accessTransformersFile =
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
|
||||
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||
separateMixinSourceSet =
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = false
|
||||
|
||||
@@ -117,9 +122,15 @@ minimizeShadowedDependencies = true
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
|
||||
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||
|
||||
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.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -84,7 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -203,7 +205,7 @@ fi
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
Vendored
+2
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.19'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.37'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mcp.mobius.waila;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
@@ -23,6 +24,9 @@ import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkCheckHandler;
|
||||
import cpw.mods.fml.common.versioning.ArtifactVersion;
|
||||
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
@@ -52,6 +56,7 @@ public class Waila {
|
||||
public static ProxyServer proxy;
|
||||
public static Logger log = LogManager.getLogger("Waila");
|
||||
public boolean serverPresent = false;
|
||||
private final ArtifactVersion minimumClientJoinVersion = new DefaultArtifactVersion("1.7.3");
|
||||
|
||||
/* INIT SEQUENCE */
|
||||
@EventHandler
|
||||
@@ -130,4 +135,16 @@ public class Waila {
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
event.registerServerCommand(new CommandDumpHandlers());
|
||||
}
|
||||
|
||||
/**
|
||||
* Block any clients older than 1.7.3 to ensure the vanilla.show_invisible_players property is respected
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@NetworkCheckHandler
|
||||
public boolean checkModList(Map<String, String> versions, Side side) {
|
||||
if (side == Side.CLIENT && versions.containsKey("Waila")) {
|
||||
return minimumClientJoinVersion.compareTo(new DefaultArtifactVersion(versions.get("Waila"))) <= 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -24,11 +24,11 @@ public class BCModule {
|
||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerBCTanks(), TileTank);
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerBCTanks(), TileTank);
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.WARN, "[BC] Class not found. " + e);
|
||||
} catch (NoSuchMethodException e) {
|
||||
Waila.log.log(Level.WARN, "[BC] Method not found." + e);
|
||||
} catch (ClassNotFoundException | NoSuchMethodException e) {
|
||||
Waila.log.log(Level.INFO, "[BC] Buildcraft mod not found.");
|
||||
return;
|
||||
}
|
||||
Waila.log.log(Level.INFO, "Buildcraft mod found.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -84,8 +84,14 @@ public class IC2Module {
|
||||
ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.outputeu");
|
||||
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[IndustrialCraft 2] Error while loading generator hooks." + e);
|
||||
if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) {
|
||||
Waila.log.log(Level.INFO, "[IndustrialCraft 2] IndustrialCraft 2 mod not found.");
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[IndustrialCraft 2] Error while loading generator hooks." + e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Waila.log.log(Level.INFO, "IndustrialCraft 2 mod found.");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package mcp.mobius.waila.addons.projectred;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import mcp.mobius.waila.api.ITaggedList;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaFMPAccessor;
|
||||
import mcp.mobius.waila.api.IWailaFMPProvider;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NBTUtil;
|
||||
|
||||
public class HUDFMPWires implements IWailaFMPProvider {
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (!config.getConfig("pr.showsignal")) return currenttip;
|
||||
|
||||
ITaggedList<String, String> tagList = (ITaggedList<String, String>) currenttip;
|
||||
int signal = ((NBTUtil.getNBTInteger(accessor.getNBTData(), "signal") & 0xff) + 16) / 17;
|
||||
if (tagList.getEntries("signal").isEmpty()) {
|
||||
tagList.add(String.format("%s : %s", LangUtil.translateG("hud.msg.power"), signal), "signal");
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ public class ProjectRedModule {
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("Project:Red", "pr.showio");
|
||||
ModuleRegistrar.instance().addConfigRemote("Project:Red", "pr.showdata");
|
||||
ModuleRegistrar.instance().addConfigRemote("Project:Red", "pr.showsignal");
|
||||
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_sgate");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_igate");
|
||||
@@ -25,6 +26,10 @@ public class ProjectRedModule {
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_bgate");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_agate");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_rgate");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPWires(), "pr_redwire");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPWires(), "pr_insulated");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPWires(), "pr_fredwire");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPWires(), "pr_finsulated");
|
||||
|
||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_sgate");
|
||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_igate");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mcp.mobius.waila.addons.thaumcraft;
|
||||
|
||||
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||
import static mcp.mobius.waila.api.SpecialChars.AQUA;
|
||||
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||
|
||||
@@ -19,6 +20,7 @@ import net.minecraft.world.World;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
|
||||
public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
||||
|
||||
@@ -45,17 +47,33 @@ public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
||||
|
||||
List<String> unknownAspects = new ArrayList<>();
|
||||
|
||||
int total = 0;
|
||||
|
||||
for (int i = 0; i < taglist.tagCount(); i++) {
|
||||
NBTTagCompound subtag = taglist.getCompoundTagAt(i);
|
||||
|
||||
String aspect = subtag.getString("key");
|
||||
String amount = String.valueOf(subtag.getInteger("value"));
|
||||
int value = subtag.getInteger("value");
|
||||
total += value;
|
||||
String amount = String.valueOf(value);
|
||||
|
||||
if (!aspect.equals("???"))
|
||||
currenttip.add(String.format("%s" + TAB + ALIGNRIGHT + WHITE + "%s", aspect, amount));
|
||||
else unknownAspects.add(String.format("%s" + TAB + ALIGNRIGHT + WHITE + "%s", aspect, amount));
|
||||
}
|
||||
|
||||
String id = tag.getString("WailaID");
|
||||
|
||||
if ((id.equals("TileNode") || id.equals("TileExtendedNode") || id.equals("TileJarNode"))
|
||||
&& (taglist.tagCount() > 10 || total > 300)) {
|
||||
currenttip.add(
|
||||
0,
|
||||
String.format(
|
||||
AQUA + "%s" + TAB + ALIGNRIGHT + WHITE + "%s",
|
||||
LangUtil.translateG("hud.msg.tcnodetotalsize"),
|
||||
total));
|
||||
}
|
||||
|
||||
currenttip.addAll(unknownAspects);
|
||||
}
|
||||
|
||||
@@ -112,7 +130,7 @@ public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (ReflectiveOperationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,10 +66,13 @@ public class ThaumcraftModule {
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIAspectContainer(), TileAlchemyFurnace);
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.WARN, "[Thaumcraft] Class not found. " + e);
|
||||
Waila.log.log(Level.INFO, "[Thaumcraft] Thaumcraft mod not found.");
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thaumcraft] Unhandled exception." + e);
|
||||
Waila.log.log(Level.WARN, "[Thaumcraft] Unhandled exception. {}", e);
|
||||
return;
|
||||
}
|
||||
Waila.log.log(Level.INFO, "Thaumcraft mod found.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,14 @@ public class ThermalDynamicsModule {
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerDuct(), TileFluidDuct);
|
||||
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks." + e);
|
||||
if (e instanceof ClassNotFoundException) {
|
||||
Waila.log.log(Level.INFO, "[Thermal Dynamics] Thermal Dynamics mod not found.");
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks. {}", e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Waila.log.log(Level.INFO, "Thermal Dynamics mod found.");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,6 +51,7 @@ public class ThermalExpansionModule {
|
||||
public static Method IBlockInfo_getBlockInfo = null;
|
||||
|
||||
public static void register() {
|
||||
boolean printedThermalExpansionNotFound = false;
|
||||
// XXX : We register the Energy interface first
|
||||
try {
|
||||
IEnergyProvider = Class.forName("cofh.api.energy.IEnergyProvider");
|
||||
@@ -74,7 +75,12 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIEnergyHandler(), IEnergyInfo);
|
||||
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy hooks." + e);
|
||||
if (e instanceof ClassNotFoundException) {
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
printedThermalExpansionNotFound = true;
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy hooks. {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX : We register the energy cell
|
||||
@@ -88,7 +94,14 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerEnergyCell(), TileEnergyCell);
|
||||
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy Cell hooks." + e);
|
||||
if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy Cell hooks. {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX : We register the Tank interface
|
||||
@@ -107,7 +120,14 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTank(), TileTank);
|
||||
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tank hooks." + e);
|
||||
if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tank hooks. {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX : We register the Tesseract interface
|
||||
@@ -123,7 +143,14 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e);
|
||||
if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks. {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX : We register the ISecureTile interface
|
||||
@@ -137,7 +164,14 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerISecureTile(), ISecureTile);
|
||||
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks." + e);
|
||||
if (e instanceof ClassNotFoundException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks. {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX : We register the Cache interface
|
||||
@@ -153,7 +187,17 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerCache(), TileCache);
|
||||
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e);
|
||||
if (e instanceof ClassNotFoundException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks. {}", e);
|
||||
}
|
||||
}
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
Waila.log.log(Level.INFO, "Thermal Expansion mod found.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -235,6 +235,7 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.redstone");
|
||||
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.silverfish");
|
||||
ModuleRegistrar.instance().addConfigRemote("VanillaMC", "vanilla.jukebox");
|
||||
ModuleRegistrar.instance().addConfigRemote("VanillaMC", "vanilla.show_invisible_players");
|
||||
|
||||
IWailaDataProvider provider = new HUDHandlerVanilla();
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.gui.screens.config.ScreenConfig;
|
||||
import mcp.mobius.waila.handlers.nei.NEIHandler;
|
||||
import mcp.mobius.waila.utils.Constants;
|
||||
|
||||
public class KeyEvent {
|
||||
@@ -37,43 +38,36 @@ public class KeyEvent {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKeyEvent(KeyInputEvent event) {
|
||||
boolean showKey = key_show.isPressed();
|
||||
if (key_cfg.isPressed()) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc.currentScreen == null) {
|
||||
mc.displayGuiScreen(new ScreenConfig(null));
|
||||
}
|
||||
} else if (key_show.isPressed() && ConfigHandler.instance()
|
||||
return;
|
||||
}
|
||||
if (showKey && ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)) {
|
||||
boolean status = ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
||||
ConfigHandler.instance()
|
||||
.setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, !status);
|
||||
boolean status = ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
||||
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, !status);
|
||||
} else if (showKey && !ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)) {
|
||||
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
||||
} else
|
||||
if (key_show.isPressed() && !ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)) {
|
||||
ConfigHandler.instance()
|
||||
.setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
||||
} else
|
||||
if (key_liquid.isPressed()) {
|
||||
boolean status = ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, true);
|
||||
ConfigHandler.instance()
|
||||
.setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, !status);
|
||||
} else if (key_recipe.isPressed()) {
|
||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||
try {
|
||||
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler")
|
||||
.getDeclaredMethod("openRecipeGUI", boolean.class).invoke(null, true);
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
} else if (key_usage.isPressed()) {
|
||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||
try {
|
||||
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler")
|
||||
.getDeclaredMethod("openRecipeGUI", boolean.class).invoke(null, false);
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
if (key_liquid.isPressed()) {
|
||||
boolean status = ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, true);
|
||||
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, !status);
|
||||
} else if (key_recipe.isPressed()) {
|
||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||
NEIHandler.openRecipeGUI(true);
|
||||
}
|
||||
} else if (key_usage.isPressed()) {
|
||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||
NEIHandler.openRecipeGUI(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.DataAccessorCommon;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
@@ -17,6 +16,7 @@ import mcp.mobius.waila.gui.truetyper.TrueTypeFont;
|
||||
import mcp.mobius.waila.handlers.HUDHandlerBlocks;
|
||||
import mcp.mobius.waila.handlers.HUDHandlerEntities;
|
||||
import mcp.mobius.waila.handlers.VanillaTooltipHandler;
|
||||
import mcp.mobius.waila.handlers.nei.NEIHandler;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderHealth;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderProgressBar;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderStack;
|
||||
@@ -34,12 +34,7 @@ public class ProxyClient extends ProxyServer {
|
||||
LangUtil.loadLangDir("waila");
|
||||
|
||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||
try {
|
||||
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler").getDeclaredMethod("register").invoke(null);
|
||||
} catch (Exception e) {
|
||||
Waila.log.error("Failed to hook into NEI properly. Reverting to Vanilla tooltip handler");
|
||||
MinecraftForge.EVENT_BUS.register(new VanillaTooltipHandler());
|
||||
}
|
||||
NEIHandler.register();
|
||||
} else {
|
||||
MinecraftForge.EVENT_BUS.register(new VanillaTooltipHandler());
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -38,8 +39,8 @@ public class RayTracing {
|
||||
private final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
public void fire() {
|
||||
if (mc.objectMouseOver != null
|
||||
&& mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
|
||||
if (mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY
|
||||
&& !shouldHidePlayer(mc.objectMouseOver.entityHit)) {
|
||||
this.target = mc.objectMouseOver;
|
||||
return;
|
||||
}
|
||||
@@ -50,6 +51,15 @@ public class RayTracing {
|
||||
this.target = this.rayTrace(viewpoint, mc.playerController.getBlockReachDistance(), 0);
|
||||
}
|
||||
|
||||
private static boolean shouldHidePlayer(Entity targetEnt) {
|
||||
// Check if entity is player with invisibility effect
|
||||
if (targetEnt instanceof EntityPlayer thePlayer) {
|
||||
boolean shouldHidePlayerSetting = !ConfigHandler.instance().getConfig("vanilla.show_invisible_players");
|
||||
return shouldHidePlayerSetting && thePlayer.isInvisible();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public MovingObjectPosition getTarget() {
|
||||
return this.target;
|
||||
}
|
||||
@@ -124,7 +134,7 @@ public class RayTracing {
|
||||
.getWailaStack(DataAccessorCommon.instance, ConfigHandler.instance());
|
||||
if (providerStack != null) {
|
||||
|
||||
if (providerStack.getItem() == null) return new ArrayList<ItemStack>();
|
||||
if (providerStack.getItem() == null) return new ArrayList<>();
|
||||
|
||||
items.add(providerStack);
|
||||
}
|
||||
@@ -141,7 +151,7 @@ public class RayTracing {
|
||||
.getWailaStack(DataAccessorCommon.instance, ConfigHandler.instance());
|
||||
if (providerStack != null) {
|
||||
|
||||
if (providerStack.getItem() == null) return new ArrayList<ItemStack>();
|
||||
if (providerStack.getItem() == null) return new ArrayList<>();
|
||||
|
||||
items.add(providerStack);
|
||||
}
|
||||
@@ -165,12 +175,11 @@ public class RayTracing {
|
||||
try {
|
||||
ItemStack pick = mouseoverBlock.getPickBlock(this.target, world, x, y, z);
|
||||
if (pick != null) items.add(pick);
|
||||
} catch (Exception e) {}
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
if (!items.isEmpty()) return items;
|
||||
|
||||
if (mouseoverBlock instanceof IShearable) {
|
||||
IShearable shearable = (IShearable) mouseoverBlock;
|
||||
if (mouseoverBlock instanceof IShearable shearable) {
|
||||
if (shearable.isShearable(new ItemStack(Items.shears), world, x, y, z)) {
|
||||
items.addAll(shearable.onSheared(new ItemStack(Items.shears), world, x, y, z, 0));
|
||||
}
|
||||
|
||||
@@ -134,9 +134,20 @@ public class Tooltip {
|
||||
// We correct if we only have one column
|
||||
if (columnsWidth.size() == 1) columnsWidth.set(0, maxStringW);
|
||||
|
||||
// We compute the position of the columns to be able to align the renderable later on
|
||||
for (int i = 1; i < columnsWidth.size(); i++)
|
||||
columnsPos.set(i, columnsWidth.get(i - 1) + columnsPos.get(i - 1) + TabSpacing);
|
||||
int tmp = 0;
|
||||
|
||||
for (int i = 0; i < columnsWidth.size(); i++) {
|
||||
tmp += columnsWidth.get(i);
|
||||
|
||||
// We compute the position of the columns to be able to align the renderable later on
|
||||
if (i != 0) {
|
||||
columnsPos.set(i, columnsWidth.get(i - 1) + columnsPos.get(i - 1) + TabSpacing);
|
||||
}
|
||||
}
|
||||
|
||||
// We correct for edge cases where the longest string in a column is in a line shorter than the longest line
|
||||
tmp += TabSpacing * (columnsWidth.size() - 1);
|
||||
maxStringW = Math.max(maxStringW, tmp);
|
||||
|
||||
this.computeRenderables();
|
||||
this.computePositionAndSize(hasIcon);
|
||||
|
||||
@@ -17,11 +17,20 @@ public class WailaExceptionHandler {
|
||||
if (!errs.contains(className)) {
|
||||
errs.add(className);
|
||||
|
||||
for (StackTraceElement elem : e.getStackTrace()) {
|
||||
Waila.log.log(
|
||||
Level.WARN,
|
||||
String.format("%s.%s:%s", elem.getClassName(), elem.getMethodName(), elem.getLineNumber()));
|
||||
if (elem.getClassName().contains("waila")) break;
|
||||
Throwable working = e;
|
||||
|
||||
while (working != null) {
|
||||
if (working != e) {
|
||||
Waila.log.log(Level.WARN, String.format("Caused by: %s", working));
|
||||
}
|
||||
for (StackTraceElement elem : working.getStackTrace()) {
|
||||
Waila.log.log(
|
||||
Level.WARN,
|
||||
String.format("%s.%s:%s", elem.getClassName(), elem.getMethodName(), elem.getLineNumber()));
|
||||
if (working == e && elem.getClassName().contains("waila")) break;
|
||||
}
|
||||
|
||||
working = working.getCause();
|
||||
}
|
||||
|
||||
Waila.log.log(Level.WARN, String.format("Catched unhandled exception : [%s] %s", className, e));
|
||||
|
||||
@@ -95,6 +95,8 @@ hud.msg.record=Record
|
||||
hud.msg.offers=Offers
|
||||
hud.msg.demands=Demands
|
||||
|
||||
hud.msg.tcnodetotalsize=Total Size
|
||||
|
||||
option.appeng.monitorcontent=Monitor's content
|
||||
option.bb.content=Barrel's content
|
||||
option.bc.tankamount=Liquid amount
|
||||
@@ -135,6 +137,7 @@ option.bcapi.consump=Show maximum power
|
||||
option.bcapi.trigger=Show triggering energy
|
||||
option.pr.showio=Show gates IO
|
||||
option.pr.showdata=Show gates data
|
||||
option.pr.showsignal=Show wire signal strength
|
||||
option.extrautilities.fluidamount=Show fluid amount
|
||||
option.openblocks.fluidamount=Show fluid amount
|
||||
option.railcraft.fluidamount=Show fluid amount
|
||||
|
||||
Reference in new issue
Block a user