mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-15 09:34:53 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d946500c0d | ||
|
|
487829a16e | ||
|
|
f153502858 | ||
|
|
095ea9e3c4 | ||
|
|
c6d48b32f7 | ||
|
|
4fb3d1edaa | ||
|
|
678bb6dd44 | ||
|
|
5333808d65 | ||
|
|
4750486375 | ||
|
|
0f9710a9f9 |
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.6.11-GTNH:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.7.49-GTNH:dev')
|
||||
|
||||
shadowImplementation('au.com.bytecode:opencsv:2.4')
|
||||
}
|
||||
+13
-2
@@ -14,7 +14,7 @@ modId = Waila
|
||||
modGroup = mcp.mobius.waila
|
||||
|
||||
# Whether to use modGroup as the maven publishing group.
|
||||
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
|
||||
# When false, com.github.GTNewHorizons is used.
|
||||
useModGroupForPublishing = false
|
||||
|
||||
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||
@@ -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, Modrinth, 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.8-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
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -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.23'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
package mcp.mobius.waila.addons.enderio;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
|
||||
public class EnderIOModule {
|
||||
|
||||
public static Class<?> TileCapacitorBank = null;
|
||||
public static Method TCB_getMaxInput = null;
|
||||
public static Method TCB_getMaxOutput = null;
|
||||
public static Method TCB_getEnergyStored = null;
|
||||
public static Method TCB_getMaxEnergyStored = null;
|
||||
public static Method TCB_getMaxIO = null;
|
||||
|
||||
public static Class<?> TileTesseract = null;
|
||||
|
||||
public static void register() {
|
||||
try {
|
||||
Class.forName("crazypants.enderio.EnderIO");
|
||||
Waila.log.log(Level.INFO, "EnderIO mod found.");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.INFO, "[EnderIO] EnderIO mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
TileCapacitorBank = Class.forName("crazypants.enderio.machine.power.TileCapacitorBank");
|
||||
TCB_getEnergyStored = TileCapacitorBank.getMethod("getEnergyStored");
|
||||
TCB_getMaxInput = TileCapacitorBank.getMethod("getMaxInput");
|
||||
TCB_getMaxOutput = TileCapacitorBank.getMethod("getMaxOutput");
|
||||
TCB_getMaxEnergyStored = TileCapacitorBank.getMethod("getMaxEnergyStored");
|
||||
TCB_getMaxIO = TileCapacitorBank.getMethod("getMaxIO");
|
||||
|
||||
TileTesseract = Class.forName("crazypants.enderio.machine.hypercube.TileHyperCube");
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.WARN, "[EnderStorage] Class not found. " + e);
|
||||
return;
|
||||
} catch (NoSuchMethodException e) {
|
||||
Waila.log.log(Level.WARN, "[EnderStorage] Method not found." + e);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[EnderStorage] Unhandled exception." + e);
|
||||
return;
|
||||
}
|
||||
|
||||
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.inout");
|
||||
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.storage");
|
||||
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.owner");
|
||||
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.channel");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerCapacitor(), TileCapacitorBank);
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerCapacitor(), TileCapacitorBank);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
package mcp.mobius.waila.addons.enderio;
|
||||
|
||||
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||
import static mcp.mobius.waila.api.SpecialChars.RESET;
|
||||
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
|
||||
public class HUDHandlerCapacitor implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
if (accessor.getPlayer().isSneaking()) {
|
||||
try {
|
||||
|
||||
String maxIOStr = LangUtil.translateG("hud.msg.maxio");
|
||||
String inputStr = LangUtil.translateG("hud.msg.input");
|
||||
String outputStr = LangUtil.translateG("hud.msg.output");
|
||||
|
||||
if (config.getConfig("enderio.storage")) {
|
||||
Integer maxEnergyStored = (Integer) EnderIOModule.TCB_getMaxEnergyStored
|
||||
.invoke(accessor.getTileEntity());
|
||||
Double energyStored = (Double) EnderIOModule.TCB_getEnergyStored.invoke(accessor.getTileEntity());
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s%.1f%s / %s%d%s RF",
|
||||
WHITE,
|
||||
energyStored * 10,
|
||||
RESET,
|
||||
WHITE,
|
||||
maxEnergyStored * 10,
|
||||
RESET));
|
||||
}
|
||||
|
||||
if (config.getConfig("enderio.inout")) {
|
||||
Integer maxIO = (Integer) EnderIOModule.TCB_getMaxIO.invoke(accessor.getTileEntity());
|
||||
Integer maxInput = (Integer) EnderIOModule.TCB_getMaxInput.invoke(accessor.getTileEntity());
|
||||
Integer maxOutput = (Integer) EnderIOModule.TCB_getMaxOutput.invoke(accessor.getTileEntity());
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s : %s%d%sRF/t ",
|
||||
maxIOStr,
|
||||
TAB + ALIGNRIGHT + WHITE,
|
||||
maxIO * 10,
|
||||
TAB + ALIGNRIGHT));
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s : %s%d%sRF/t ",
|
||||
inputStr,
|
||||
TAB + ALIGNRIGHT + WHITE,
|
||||
maxInput * 10,
|
||||
TAB + ALIGNRIGHT));
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s : %s%d%sRF/t ",
|
||||
outputStr,
|
||||
TAB + ALIGNRIGHT + WHITE,
|
||||
maxOutput * 10,
|
||||
TAB + ALIGNRIGHT));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
currenttip = WailaExceptionHandler
|
||||
.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
if (te != null) te.writeToNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package mcp.mobius.waila.addons.enderio;
|
||||
|
||||
import static mcp.mobius.waila.api.SpecialChars.RESET;
|
||||
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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 HUDHandlerTesseract implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
if (accessor.getPlayer().isSneaking()) {
|
||||
|
||||
String channel = "%s : %s%s%s %s";
|
||||
String freq;
|
||||
String frequser;
|
||||
|
||||
if (config.getConfig("enderio.channel")) {
|
||||
|
||||
if (accessor.getNBTData().hasKey("channelName")) {
|
||||
freq = accessor.getNBTData().getString("channelName");
|
||||
|
||||
if (accessor.getNBTData().hasKey("channelUser"))
|
||||
frequser = "[ " + WHITE + accessor.getNBTData().getString("channelUser") + RESET + " ]";
|
||||
else frequser = "[ " + WHITE + LangUtil.translateG("hud.msg.public") + RESET + " ]";
|
||||
|
||||
} else {
|
||||
freq = LangUtil.translateG("hud.msg.none");
|
||||
frequser = "";
|
||||
}
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
channel,
|
||||
LangUtil.translateG("hud.msg.frequency"),
|
||||
TAB + WHITE,
|
||||
freq,
|
||||
RESET,
|
||||
frequser));
|
||||
}
|
||||
|
||||
if (config.getConfig("enderio.owner")) {
|
||||
if (accessor.getNBTData().hasKey("owner")) currenttip.add(
|
||||
String.format(
|
||||
"%s : %s%s",
|
||||
LangUtil.translateG("hud.msg.owner"),
|
||||
TAB + WHITE,
|
||||
accessor.getNBTData().getString("owner")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
if (te != null) te.writeToNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
@@ -43,38 +44,30 @@ public class KeyEvent {
|
||||
if (mc.currentScreen == null) {
|
||||
mc.displayGuiScreen(new ScreenConfig(null));
|
||||
}
|
||||
} else if (showKey && 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 (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_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());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -44,13 +44,17 @@ public class WailaTickHandler {
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void tickRender(TickEvent.RenderTickEvent event) {
|
||||
OverlayRenderer.renderOverlay();
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
OverlayRenderer.renderOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void tickClient(TickEvent.ClientTickEvent event) {
|
||||
|
||||
if (event.phase == TickEvent.Phase.START) return;
|
||||
|
||||
if (!Keyboard.isKeyDown(KeyEvent.key_show.getKeyCode())
|
||||
&& !ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)
|
||||
&& ConfigHandler.instance()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user