Compare commits

..
3 Commits
Author SHA1 Message Date
Martin Robertz ddb5c0f58d update 2025-03-19 16:23:57 +01:00
Glease 49c648c689 narrow catch scope 2025-03-17 17:20:52 +08:00
Glease 792952fbbd Print stack trace of suppressed exception as well 2025-03-17 17:19:33 +08:00
34 changed files with 562 additions and 543 deletions

No files matched your search

-1
View File
@@ -27,4 +27,3 @@ whitelist.json
*.iws
src/main/resources/mixins.*.json
*.bat
layout.json
+1 -1
View File
@@ -1,7 +1,7 @@
// Add your dependencies here
dependencies {
implementation('com.github.GTNewHorizons:NotEnoughItems:2.8.14-GTNH:dev')
implementation('com.github.GTNewHorizons:NotEnoughItems:2.7.30-GTNH:dev')
shadowImplementation('au.com.bytecode:opencsv:2.4')
}
+2 -2
View File
@@ -14,7 +14,7 @@ modId = Waila
modGroup = mcp.mobius.waila
# Whether to use modGroup as the maven publishing group.
# When false, com.github.GTNewHorizons is used.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
useModGroupForPublishing = false
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
@@ -151,7 +151,7 @@ modrinthProjectId =
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.43'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.37'
}
+15 -2
View File
@@ -1,5 +1,6 @@
package mcp.mobius.waila;
import java.lang.reflect.Field;
import java.util.Map;
import net.minecraftforge.common.MinecraftForge;
@@ -7,7 +8,11 @@ import net.minecraftforge.common.MinecraftForge;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.FMLModContainer;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
@@ -64,10 +69,18 @@ public class Waila {
@EventHandler
public void initialize(FMLInitializationEvent event) {
try {
Field eBus = FMLModContainer.class.getDeclaredField("eventBus");
eBus.setAccessible(true);
EventBus FMLbus = (EventBus) eBus.get(FMLCommonHandler.instance().findContainerFor(this));
FMLbus.register(this);
} catch (Throwable ignored) {}
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
MinecraftForge.EVENT_BUS.register(new DecoratorRenderer());
FMLCommonHandler.instance().bus().register(new KeyEvent());
FMLCommonHandler.instance().bus().register(new WailaTickHandler());
FMLCommonHandler.instance().bus().register(WailaTickHandler.instance());
}
FMLCommonHandler.instance().bus().register(new NetworkHandler());
}
@@ -78,7 +91,7 @@ public class Waila {
ModIdentification.init();
}
@EventHandler
@Subscribe
public void loadComplete(FMLLoadCompleteEvent event) {
proxy.registerMods();
proxy.registerIMCs();
@@ -0,0 +1,62 @@
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);
}
}
@@ -0,0 +1,110 @@
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;
}
}
@@ -0,0 +1,94 @@
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,7 +1,6 @@
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;
@@ -20,8 +19,6 @@ 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.api.SpecialChars;
import mcp.mobius.waila.cbcore.LangUtil;
public class HUDHandlerIAspectContainer implements IWailaDataProvider {
@@ -48,32 +45,15 @@ 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");
int value = subtag.getInteger("value");
total += value;
String amount = String.valueOf(value);
String amount = String.valueOf(subtag.getInteger("value"));
if (!aspect.equals("???")) currenttip.add(
SpecialChars.getRenderString("waila.tcaspect", aspect) + TAB + ALIGNRIGHT + WHITE + amount);
else unknownAspects.add(
SpecialChars.getRenderString("waila.tcaspect", aspect) + TAB + ALIGNRIGHT + WHITE + 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));
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));
}
currenttip.addAll(unknownAspects);
@@ -99,7 +79,7 @@ public class HUDHandlerIAspectContainer implements IWailaDataProvider {
ItemStack headSlot = player.inventory.armorInventory[3];
if (headSlot == null) return tag;
boolean hasReveal = ThaumcraftModule.isGoggles.apply(headSlot);
boolean hasReveal = ThaumcraftModule.IGoggles.isInstance(headSlot.getItem());
if (!hasReveal) return tag;
Map<String, ?> knownAspects = (Map<String, ?>) ThaumcraftModule.CommonProxy_getKnownAspects
@@ -120,7 +100,7 @@ public class HUDHandlerIAspectContainer implements IWailaDataProvider {
if (tileAspects.get(o) > 0) {
if (playerAspects.containsKey(o)) {
NBTTagCompound cmptag = new NBTTagCompound();
cmptag.setString("key", (String) ThaumcraftModule.Aspect_tag.get(o));
cmptag.setString("key", (String) ThaumcraftModule.Aspect_getName.invoke(o));
cmptag.setInteger("value", tileAspects.get(o));
aspects.appendTag(cmptag);
} else {
@@ -1,13 +1,9 @@
package mcp.mobius.waila.addons.thaumcraft;
import java.awt.Color;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.function.Function;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import org.apache.logging.log4j.Level;
@@ -32,19 +28,12 @@ public class ThaumcraftModule {
public static Class<?> Aspect = null;
public static Field Aspect_tag = null;
public static Method Aspect_getName = null;
public static Method Aspect_getAspect = null;
public static Method Aspect_getImage = null;
public static Method Aspect_getColor = null;
public static Class<?> CommonProxy = null;
public static Method CommonProxy_getKnownAspects = null;
public static Class<?> IGoggles = null;
public static ResourceLocation unknownAspectTexture = null;
public static Color unknownAspectColor = null;
public static Function<ItemStack, Boolean> isGoggles = stack -> IGoggles.isInstance(stack.getItem());
public static void register() {
try {
Thaumcraft = Class.forName("thaumcraft.common.Thaumcraft");
@@ -64,18 +53,12 @@ public class ThaumcraftModule {
Aspect_tag = Aspect.getDeclaredField("tag");
Aspect_tag.setAccessible(true);
Aspect_getName = Aspect.getDeclaredMethod("getName");
Aspect_getAspect = Aspect.getMethod("getAspect", java.lang.String.class);
Aspect_getImage = Aspect.getDeclaredMethod("getImage");
Aspect_getColor = Aspect.getDeclaredMethod("getColor");
CommonProxy = Class.forName("thaumcraft.common.CommonProxy");
CommonProxy_getKnownAspects = CommonProxy.getDeclaredMethod("getKnownAspects");
IGoggles = Class.forName("thaumcraft.api.IGoggles");
unknownAspectTexture = new ResourceLocation("thaumcraft", "textures/aspects/_unknown.png");
unknownAspectColor = new Color(0x654242);
ModuleRegistrar.instance().addConfigRemote("Thaumcraft", "thaumcraft.aspects");
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIAspectContainer(), IAspectContainer);
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIAspectContainer(), TileAlchemyFurnace);
@@ -1,41 +0,0 @@
package mcp.mobius.waila.addons.thaumcraftGadomancy;
import java.lang.reflect.Field;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import org.apache.logging.log4j.Level;
import mcp.mobius.waila.Waila;
import mcp.mobius.waila.addons.thaumcraft.ThaumcraftModule;
public class GadomancyModule {
public static Class<?> RegisteredEnchantments = null;
public static Field RegisteredEnchantments_revealer = null;
public static int revealerEffectId;
public static void register() {
try {
RegisteredEnchantments = Class.forName("makeo.gadomancy.common.registration.RegisteredEnchantments");
RegisteredEnchantments_revealer = RegisteredEnchantments.getDeclaredField("revealer");
Object revealer = RegisteredEnchantments_revealer.get(null);
revealerEffectId = ((Enchantment) revealer).effectId;
ThaumcraftModule.isGoggles = stack -> ThaumcraftModule.IGoggles.isInstance(stack.getItem())
|| EnchantmentHelper.getEnchantmentLevel(revealerEffectId, stack) > 0;
} catch (ClassNotFoundException e) {
Waila.log.log(Level.INFO, "[Thaumcraft Gadomancy] Gadomancy mod not found.");
return;
} catch (Exception e) {
Waila.log.log(Level.WARN, "[Thaumcraft Gadomancy] Unhandled exception. {}", e);
return;
}
Waila.log.log(Level.INFO, "Gadomancy mod found.");
}
}
@@ -62,35 +62,6 @@ public interface IWailaDataProvider {
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
IWailaConfigHandler config);
/**
* Callback used to determine if there is extended information to display for the Body section. If this returns
* true, Waila will either display the "Hold <KEY> for more info" prompt or call getWailaAdvancedBody if the key is
* being held.
*
* @param itemStack Current block scanned, in ItemStack form.
* @param accessor Contains most of the relevant information about the current environment.
* @param config Current configuration of Waila.
* @return True if advanced body information is available, false otherwise.
*/
default boolean hasAdvancedBody(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return false; // Default to false for backward compatibility
}
/**
* Callback used to add the extended lines to the Body section of the tooltip. This method is ONLY called if
* hasAdvancedBody returns true AND the player is holding the configured key for advanced tooltips.
*
* @param itemStack Current block scanned, in ItemStack form.
* @param currenttip The current list of tooltip lines, including the normal body.
* @param accessor Contains most of the relevant information about the current environment.
* @param config Current configuration of Waila.
* @return Modified input currenttip with advanced information appended.
*/
default List<String> getWailaAdvancedBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
return currenttip; // Default to returning the unmodified list
}
/**
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider}
@@ -134,10 +134,6 @@ public class ConfigHandler implements IWailaConfigHandler {
return getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
}
public boolean showIcon() {
return getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOWICON, true);
}
/* Default config loading */
public void loadDefaultConfig(FMLPreInitializationEvent event) {
@@ -149,7 +145,6 @@ public class ConfigHandler implements IWailaConfigHandler {
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_METADATA, false);
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);
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();
@@ -6,7 +6,6 @@ import java.util.Map;
import java.util.TreeMap;
import net.minecraft.block.Block;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -18,9 +17,7 @@ import mcp.mobius.waila.Waila;
import mcp.mobius.waila.api.IWailaBlock;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.IWailaEntityProvider;
import mcp.mobius.waila.cbcore.LangUtil;
import mcp.mobius.waila.cbcore.Layout;
import mcp.mobius.waila.client.KeyEvent;
import mcp.mobius.waila.network.Message0x01TERequest;
import mcp.mobius.waila.network.Message0x03EntRequest;
import mcp.mobius.waila.network.WailaPacketHandler;
@@ -149,29 +146,11 @@ public class MetaDataProvider {
}
if (layout == Layout.BODY) for (List<IWailaDataProvider> providersList : bodyBlockProviders.values()) {
boolean hasAdvancedBodyAvailable = false;
final boolean isAdvancedKeyDown = KeyEvent.key_show_advanced.getIsKeyPressed();
for (IWailaDataProvider dataProvider : providersList) try {
currenttip = dataProvider.getWailaBody(itemStack, currenttip, accessor, ConfigHandler.instance());
if (dataProvider.hasAdvancedBody(itemStack, accessor, ConfigHandler.instance())) {
hasAdvancedBodyAvailable = true;
if (isAdvancedKeyDown) {
currenttip = dataProvider
.getWailaAdvancedBody(itemStack, currenttip, accessor, ConfigHandler.instance());
}
}
} catch (Throwable e) {
currenttip = WailaExceptionHandler.handleErr(e, dataProvider.getClass().toString(), currenttip);
}
if (hasAdvancedBodyAvailable && !isAdvancedKeyDown) {
String keyName = GameSettings.getKeyDisplayString(KeyEvent.key_show_advanced.getKeyCode());
currenttip.add(LangUtil.translateG("hud.msg.holdkeymoreinfo", keyName));
}
}
if (layout == Layout.FOOTER) for (List<IWailaDataProvider> providersList : tailBlockProviders.values()) {
for (IWailaDataProvider dataProvider : providersList) try {
@@ -10,7 +10,6 @@ import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import mcp.mobius.waila.api.impl.ConfigHandler;
import mcp.mobius.waila.gui.screens.config.ScreenConfig;
import mcp.mobius.waila.handlers.nei.NEIHandler;
@@ -23,7 +22,6 @@ public class KeyEvent {
public static KeyBinding key_liquid;
public static KeyBinding key_recipe;
public static KeyBinding key_usage;
public static KeyBinding key_show_advanced;
public KeyEvent() {
ClientRegistry
@@ -36,8 +34,6 @@ public class KeyEvent {
key_recipe = new KeyBinding(Constants.BIND_WAILA_RECIPE, Keyboard.KEY_NUMPAD3, "Waila"));
ClientRegistry.registerKeyBinding(
key_usage = new KeyBinding(Constants.BIND_WAILA_USAGE, Keyboard.KEY_NUMPAD4, "Waila"));
ClientRegistry.registerKeyBinding(
key_show_advanced = new KeyBinding(Constants.BIND_WAILA_SHOW_ADVANCED, Keyboard.KEY_LSHIFT, "Waila"));
}
@SubscribeEvent
@@ -74,15 +70,4 @@ public class KeyEvent {
}
}
@SubscribeEvent
public void tickClient(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.START) return;
if (!KeyEvent.key_show.getIsKeyPressed()
&& !ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)
&& ConfigHandler.instance()
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false)) {
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false);
}
}
}
@@ -17,7 +17,6 @@ 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.TTRenderAspectString;
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderHealth;
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderProgressBar;
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderStack;
@@ -55,8 +54,6 @@ public class ProxyClient extends ProxyServer {
ModuleRegistrar.instance().registerTooltipRenderer("waila.stack", new TTRenderStack());
ModuleRegistrar.instance().registerTooltipRenderer("waila.progress", new TTRenderProgressBar());
ModuleRegistrar.instance().registerTooltipRenderer("waila.tcaspect", new TTRenderAspectString());
MinecraftForge.EVENT_BUS.register(new WorldUnloadEventHandler());
}
@@ -71,9 +68,7 @@ public class ProxyClient extends ProxyServer {
@SubscribeEvent
public void onWorldUnload(WorldEvent.Unload event) {
if (event.world.isRemote) {
DataAccessorCommon.instance = new DataAccessorCommon();
}
DataAccessorCommon.instance = new DataAccessorCommon();
}
}
}
@@ -84,16 +84,6 @@ public class ScreenWailaConfig extends ScreenBase {
"screen.button.no",
"screen.button.yes"),
"choice.shifttoggledents");
buttonContainer.addButton(
new ButtonBooleanConfig(
this.getRoot(),
Configuration.CATEGORY_GENERAL,
Constants.CFG_WAILA_SHOWICON,
true,
false,
"screen.button.no",
"screen.button.yes"),
"choice.showicon");
this.getRoot().addWidget("LayoutConfigPos", new LayoutBase(this.getRoot()));
this.getRoot().getWidget("LayoutConfigPos")
@@ -16,13 +16,17 @@ public class OverlayConfig {
public static int fontcolor;
public static float scale;
// spotless:off
public static void updateColors() {
alpha = (int) (ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA, 0) / 100.0f * 255f) << 24;
bgcolor = alpha + ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BGCOLOR, 0);
gradient1 = alpha + ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT1, 0);
gradient2 = alpha + ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT2, 0);
fontcolor = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_FONTCOLOR, 0);
OverlayConfig.alpha = (int) (ConfigHandler.instance()
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA, 0) / 100.0f
* 256) << 24;
OverlayConfig.bgcolor = OverlayConfig.alpha
+ ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BGCOLOR, 0);
OverlayConfig.gradient1 = OverlayConfig.alpha
+ ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT1, 0);
OverlayConfig.gradient2 = OverlayConfig.alpha
+ ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT2, 0);
OverlayConfig.fontcolor = OverlayConfig.alpha
+ ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_FONTCOLOR, 0);
}
// spotless:on
}
@@ -11,11 +11,16 @@ import mcp.mobius.waila.api.impl.ConfigHandler;
public class OverlayRenderer {
private static boolean hasBlending;
private static boolean hasDepthTest;
private static int boundTexIndex;
protected static boolean hasBlending;
protected static boolean hasLight;
protected static boolean hasDepthTest;
protected static boolean hasLight0;
protected static boolean hasLight1;
protected static boolean hasRescaleNormal;
protected static boolean hasColorMaterial;
protected static int boundTexIndex;
public static void renderOverlay(Tooltip tooltip) {
public static void renderOverlay() {
Minecraft mc = Minecraft.getMinecraft();
if (!(mc.currentScreen == null && mc.theWorld != null
&& Minecraft.isGuiEnabled()
@@ -26,16 +31,16 @@ public class OverlayRenderer {
if (RayTracing.instance().getTarget().typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
&& RayTracing.instance().getTargetStack() != null) {
doRenderOverlay(tooltip);
renderOverlay(WailaTickHandler.instance().tooltip);
}
if (RayTracing.instance().getTarget().typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY
&& ConfigHandler.instance().getConfig("general.showents")) {
doRenderOverlay(tooltip);
renderOverlay(WailaTickHandler.instance().tooltip);
}
}
private static void doRenderOverlay(Tooltip tooltip) {
public static void renderOverlay(Tooltip tooltip) {
GL11.glPushMatrix();
saveGLState();
@@ -75,23 +80,26 @@ public class OverlayRenderer {
}
private static void saveGLState() {
public static void saveGLState() {
hasBlending = GL11.glGetBoolean(GL11.GL_BLEND);
hasLight = GL11.glGetBoolean(GL11.GL_LIGHTING);
hasDepthTest = GL11.glGetBoolean(GL11.GL_DEPTH_TEST);
boundTexIndex = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
GL11.glPushAttrib(GL11.GL_CURRENT_BIT);
}
private static void loadGLState() {
public static void loadGLState() {
if (hasBlending) GL11.glEnable(GL11.GL_BLEND);
else GL11.glDisable(GL11.GL_BLEND);
if (hasLight1) GL11.glEnable(GL11.GL_LIGHT1);
else GL11.glDisable(GL11.GL_LIGHT1);
if (hasDepthTest) GL11.glEnable(GL11.GL_DEPTH_TEST);
else GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, boundTexIndex);
GL11.glPopAttrib();
}
private static void drawTooltipBox(int x, int y, int w, int h, int bg, int grad1, int grad2) {
public static void drawTooltipBox(int x, int y, int w, int h, int bg, int grad1, int grad2) {
DisplayUtil.drawGradientRect(x + 1, y, w - 1, 1, bg, bg);
DisplayUtil.drawGradientRect(x + 1, y + h, w - 1, 1, bg, bg);
DisplayUtil.drawGradientRect(x + 1, y + 1, w - 1, h - 1, bg, bg);// center
@@ -99,6 +107,7 @@ public class OverlayRenderer {
DisplayUtil.drawGradientRect(x + w, y + 1, 1, h - 1, bg, bg);
DisplayUtil.drawGradientRect(x + 1, y + 2, 1, h - 3, grad1, grad2);
DisplayUtil.drawGradientRect(x + w - 1, y + 2, 1, h - 3, grad1, grad2);
DisplayUtil.drawGradientRect(x + 1, y + 1, w - 1, 1, grad1, grad1);
DisplayUtil.drawGradientRect(x + 1, y + h - 1, w - 1, 1, grad2, grad2);
}
@@ -26,7 +26,6 @@ import mcp.mobius.waila.utils.Constants;
public class RayTracing {
private MovingObjectPosition target = null;
private static RayTracing _instance;
private RayTracing() {}
@@ -36,20 +35,20 @@ public class RayTracing {
return _instance;
}
private MovingObjectPosition target = null;
private final Minecraft mc = Minecraft.getMinecraft();
public void fire() {
final Minecraft mc = Minecraft.getMinecraft();
if (mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY
&& !shouldHidePlayer(mc.objectMouseOver.entityHit)) {
this.target = mc.objectMouseOver;
return;
}
EntityLivingBase viewpoint = mc.renderViewEntity;
if (viewpoint == null) return;
this.target = this.rayTrace(viewpoint, mc.playerController.getBlockReachDistance(), 0);
}
public void clear() {
target = null;
this.target = this.rayTrace(viewpoint, mc.playerController.getBlockReachDistance(), 0);
}
private static boolean shouldHidePlayer(Entity targetEnt) {
@@ -117,7 +116,7 @@ public class RayTracing {
if (this.target == null) return items;
World world = Minecraft.getMinecraft().theWorld;
World world = mc.theWorld;
int x = this.target.blockX;
int y = this.target.blockY;
@@ -106,8 +106,6 @@ public class Tooltip {
public Tooltip(List<String> textData, boolean hasIcon) {
if (hasIcon) hasIcon = ConfigHandler.instance().showIcon();
columnsWidth.add(0); // Small init of the arrays to have at least one element
columnsPos.add(0);
@@ -136,20 +134,9 @@ public class Tooltip {
// We correct if we only have one column
if (columnsWidth.size() == 1) columnsWidth.set(0, maxStringW);
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);
// 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);
this.computeRenderables();
this.computePositionAndSize(hasIcon);
@@ -12,138 +12,165 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.config.Configuration;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mcp.mobius.waila.api.impl.ConfigHandler;
import mcp.mobius.waila.api.impl.DataAccessorCommon;
import mcp.mobius.waila.api.impl.MetaDataProvider;
import mcp.mobius.waila.api.impl.TipList;
import mcp.mobius.waila.cbcore.Layout;
import mcp.mobius.waila.client.KeyEvent;
import mcp.mobius.waila.utils.Constants;
public class WailaTickHandler {
private Tooltip tooltip = null;
private final MetaDataProvider handler = new MetaDataProvider();
public Tooltip tooltip = null;
public MetaDataProvider handler = new MetaDataProvider();
private final Minecraft mc = Minecraft.getMinecraft();
@SubscribeEvent
public void tickRender(TickEvent.RenderTickEvent event) {
if (event.phase == TickEvent.Phase.END) {
OverlayRenderer.renderOverlay(tooltip);
}
private static WailaTickHandler _instance;
private WailaTickHandler() {}
public static WailaTickHandler instance() {
if (_instance == null) _instance = new WailaTickHandler();
return _instance;
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void tickRender(TickEvent.RenderTickEvent event) {
OverlayRenderer.renderOverlay();
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
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) {
this.tooltip = null;
RayTracing.instance().clear();
return;
if (!Keyboard.isKeyDown(KeyEvent.key_show.getKeyCode())
&& !ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)
&& ConfigHandler.instance()
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false)) {
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false);
}
RayTracing.instance().fire();
MovingObjectPosition target = RayTracing.instance().getTarget();
World world = mc.theWorld;
EntityPlayer player = mc.thePlayer;
if (world != null && player != null) {
RayTracing.instance().fire();
MovingObjectPosition target = RayTracing.instance().getTarget();
List<String> currenttip;
List<String> currenttipHead;
List<String> currenttipBody;
List<String> currenttipTail;
if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
DataAccessorCommon accessor = DataAccessorCommon.instance;
accessor.set(world, player, target);
ItemStack targetStack = RayTracing.instance().getTargetStack(); // Here we get either the proper stack
// or the override
List<String> currenttip;
List<String> currenttipHead;
List<String> currenttipBody;
List<String> currenttipTail;
if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
DataAccessorCommon accessor = DataAccessorCommon.instance;
accessor.set(world, player, target);
ItemStack targetStack = RayTracing.instance().getTargetStack(); // Here we get either the proper stack
// or the override
if (targetStack != null) {
currenttip = new TipList<String, String>();
currenttipHead = new TipList<String, String>();
currenttipBody = new TipList<String, String>();
currenttipTail = new TipList<String, String>();
if (targetStack != null) {
currenttip = new TipList<String, String>();
currenttipHead = new TipList<String, String>();
currenttipBody = new TipList<String, String>();
currenttipTail = new TipList<String, String>();
currenttipHead = handler.handleBlockTextData(
targetStack,
world,
player,
target,
accessor,
currenttipHead,
Layout.HEADER);
currenttipBody = handler
.handleBlockTextData(targetStack, world, player, target, accessor, currenttipBody, Layout.BODY);
currenttipTail = handler.handleBlockTextData(
targetStack,
world,
player,
target,
accessor,
currenttipTail,
Layout.FOOTER);
currenttipHead = handler.handleBlockTextData(
targetStack,
world,
player,
target,
accessor,
currenttipHead,
Layout.HEADER);
currenttipBody = handler.handleBlockTextData(
targetStack,
world,
player,
target,
accessor,
currenttipBody,
Layout.BODY);
currenttipTail = handler.handleBlockTextData(
targetStack,
world,
player,
target,
accessor,
currenttipTail,
Layout.FOOTER);
if (ConfigHandler.instance()
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTBLOCK, false)
&& !currenttipBody.isEmpty()
&& !accessor.getPlayer().isSneaking()) {
currenttipBody.clear();
currenttipBody.add(ITALIC + "Press shift for more data");
if (ConfigHandler.instance()
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTBLOCK, false)
&& !currenttipBody.isEmpty()
&& !accessor.getPlayer().isSneaking()) {
currenttipBody.clear();
currenttipBody.add(ITALIC + "Press shift for more data");
}
currenttip.addAll(currenttipHead);
currenttip.addAll(currenttipBody);
currenttip.addAll(currenttipTail);
this.tooltip = new Tooltip(currenttip, targetStack);
}
} else if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
DataAccessorCommon accessor = DataAccessorCommon.instance;
accessor.set(world, player, target);
currenttip.addAll(currenttipHead);
currenttip.addAll(currenttipBody);
currenttip.addAll(currenttipTail);
Entity targetEnt = RayTracing.instance().getTargetEntity(); // This need to be replaced by the override
// check.
this.tooltip = new Tooltip(currenttip, targetStack);
}
} else if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
DataAccessorCommon accessor = DataAccessorCommon.instance;
accessor.set(world, player, target);
if (targetEnt != null) {
currenttip = new TipList<String, String>();
currenttipHead = new TipList<String, String>();
currenttipBody = new TipList<String, String>();
currenttipTail = new TipList<String, String>();
Entity targetEnt = RayTracing.instance().getTargetEntity(); // This need to be replaced by the override
// check.
currenttipHead = handler.handleEntityTextData(
targetEnt,
world,
player,
target,
accessor,
currenttipHead,
Layout.HEADER);
currenttipBody = handler.handleEntityTextData(
targetEnt,
world,
player,
target,
accessor,
currenttipBody,
Layout.BODY);
currenttipTail = handler.handleEntityTextData(
targetEnt,
world,
player,
target,
accessor,
currenttipTail,
Layout.FOOTER);
if (targetEnt != null) {
currenttip = new TipList<String, String>();
currenttipHead = new TipList<String, String>();
currenttipBody = new TipList<String, String>();
currenttipTail = new TipList<String, String>();
if (ConfigHandler.instance()
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTENTS, false)
&& !currenttipBody.isEmpty()
&& !accessor.getPlayer().isSneaking()) {
currenttipBody.clear();
currenttipBody.add(ITALIC + "Press shift for more data");
}
currenttipHead = handler.handleEntityTextData(
targetEnt,
world,
player,
target,
accessor,
currenttipHead,
Layout.HEADER);
currenttipBody = handler
.handleEntityTextData(targetEnt, world, player, target, accessor, currenttipBody, Layout.BODY);
currenttipTail = handler.handleEntityTextData(
targetEnt,
world,
player,
target,
accessor,
currenttipTail,
Layout.FOOTER);
currenttip.addAll(currenttipHead);
currenttip.addAll(currenttipBody);
currenttip.addAll(currenttipTail);
if (ConfigHandler.instance()
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTENTS, false)
&& !currenttipBody.isEmpty()
&& !accessor.getPlayer().isSneaking()) {
currenttipBody.clear();
currenttipBody.add(ITALIC + "Press shift for more data");
this.tooltip = new Tooltip(currenttip, false);
}
currenttip.addAll(currenttipHead);
currenttip.addAll(currenttipBody);
currenttip.addAll(currenttipTail);
this.tooltip = new Tooltip(currenttip, false);
}
}
@@ -1,90 +0,0 @@
package mcp.mobius.waila.overlay.tooltiprenderers;
import java.awt.Color;
import java.awt.Dimension;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import mcp.mobius.waila.addons.thaumcraft.ThaumcraftModule;
import mcp.mobius.waila.api.IWailaCommonAccessor;
import mcp.mobius.waila.api.IWailaTooltipRenderer;
import mcp.mobius.waila.overlay.DisplayUtil;
import mcp.mobius.waila.overlay.OverlayConfig;
public class TTRenderAspectString implements IWailaTooltipRenderer {
@Override
public Dimension getSize(String[] params, IWailaCommonAccessor accessor) {
int width;
if (params[0].equals("???")) {
width = DisplayUtil.getDisplayWidth(params[0]);
} else {
try {
Object aspect = ThaumcraftModule.Aspect_getAspect.invoke(null, params[0]);
if (aspect == null) {
width = DisplayUtil.getDisplayWidth(params[0]);
} else width = DisplayUtil.getDisplayWidth((String) ThaumcraftModule.Aspect_getName.invoke(aspect));
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
}
}
return new Dimension(width + 10, params[0].isEmpty() ? 0 : 8);
}
@Override
public void draw(String[] params, IWailaCommonAccessor accessor) {
try {
if (params[0].equals("???")) {
drawTag(0, 0, ThaumcraftModule.unknownAspectTexture, ThaumcraftModule.unknownAspectColor, 200);
DisplayUtil.drawString(params[0], 10, 0, OverlayConfig.fontcolor, true);
return;
}
Object aspect = ThaumcraftModule.Aspect_getAspect.invoke(null, params[0]);
if (aspect == null) return;
drawTag(
0,
0,
(ResourceLocation) ThaumcraftModule.Aspect_getImage.invoke(aspect),
new Color((int) ThaumcraftModule.Aspect_getColor.invoke(aspect)),
200);
DisplayUtil.drawString(
(String) ThaumcraftModule.Aspect_getName.invoke(aspect),
10,
0,
OverlayConfig.fontcolor,
true);
} catch (ReflectiveOperationException e) {
DisplayUtil.drawString(params[0], 10, 0, OverlayConfig.fontcolor, true);
throw new RuntimeException(e);
}
}
public static void drawTag(double x, double y, ResourceLocation image, Color color, double z) {
Minecraft mc = Minecraft.getMinecraft();
mc.renderEngine.bindTexture(image);
GL11.glColor4f(
(float) color.getRed() / 255.0F,
(float) color.getGreen() / 255.0F,
(float) color.getBlue() / 255.0F,
1);
Tessellator var9 = Tessellator.instance;
var9.startDrawingQuads();
var9.setColorRGBA_F(
(float) color.getRed() / 255.0F,
(float) color.getGreen() / 255.0F,
(float) color.getBlue() / 255.0F,
1);
var9.addVertexWithUV(x + 0.0D, y + 8.0D, z, 0.0D, 1.0D);
var9.addVertexWithUV(x + 8.0D, y + 8.0D, z, 1.0D, 1.0D);
var9.addVertexWithUV(x + 8.0D, y + 0.0D, z, 1.0D, 0.0D);
var9.addVertexWithUV(x + 0.0D, y + 0.0D, z, 0.0D, 0.0D);
var9.draw();
}
}
@@ -20,7 +20,6 @@ import mcp.mobius.waila.addons.railcraft.RailcraftModule;
import mcp.mobius.waila.addons.statues.StatuesModule;
import mcp.mobius.waila.addons.stevescarts.StevesCartsModule;
import mcp.mobius.waila.addons.thaumcraft.ThaumcraftModule;
import mcp.mobius.waila.addons.thaumcraftGadomancy.GadomancyModule;
import mcp.mobius.waila.addons.thermaldynamics.ThermalDynamicsModule;
import mcp.mobius.waila.addons.thermalexpansion.ThermalExpansionModule;
import mcp.mobius.waila.addons.twilightforest.TwilightForestModule;
@@ -51,9 +50,6 @@ public class ProxyServer {
/* Thaumcraft */
ThaumcraftModule.register();
/* Gadomancy */
GadomancyModule.register();
/* EnderStorage */
EnderStorageModule.register();
@@ -118,12 +114,16 @@ public class ProxyServer {
String[] splitName = method.split("\\.");
String methodName = splitName[splitName.length - 1];
String className = method.substring(0, method.length() - methodName.length() - 1);
Waila.log.debug(String.format("Trying to reflect %s %s", className, methodName));
Waila.log.info(String.format("Trying to reflect %s %s", className, methodName));
try {
Class<?> reflectClass = Class.forName(className);
Method reflectMethod = reflectClass.getDeclaredMethod(methodName, IWailaRegistrar.class);
reflectMethod.invoke(null, ModuleRegistrar.instance());
Waila.log.info(String.format("Success in registering %s", modname));
} catch (ClassNotFoundException e) {
Waila.log.warn(String.format("Could not find class %s", className));
} catch (NoSuchMethodException e) {
@@ -6,7 +6,6 @@ public final class Constants {
public static String BIND_WAILA_CFG = "waila.keybind.wailaconfig";
public static String BIND_WAILA_SHOW = "waila.keybind.wailadisplay";
public static String BIND_WAILA_SHOW_ADVANCED = "waila.keybind.showadvanced";
public static String BIND_WAILA_LIQUID = "waila.keybind.liquid";
public static String BIND_WAILA_RECIPE = "waila.keybind.recipe";
public static String BIND_WAILA_USAGE = "waila.keybind.usage";
@@ -20,7 +19,6 @@ public final class Constants {
public static String CFG_WAILA_LIQUID = "waila.cfg.liquid";
public static String CFG_WAILA_METADATA = "waila.cfg.metadata";
public static String CFG_WAILA_KEYBIND = "waila.cfg.keybind";
public static String CFG_WAILA_SHOWICON = "waila.cfg.showicon";
public static String CFG_WAILA_POSX = "waila.cfg.posx";
public static String CFG_WAILA_POSY = "waila.cfg.posy";
public static String CFG_WAILA_SCALE = "waila.cfg.scale";
+98 -101
View File
@@ -1,151 +1,148 @@
screen.button.waila=Waila
screen.button.modules=Moduly
screen.label.scale=Mìøítko
screen.label.dragtuto=Chytni HUD pro nastavení jeho pozice.
screen.label.scale=Mìøítko
screen.label.dragtuto=Chytni HUD pro nastavení jeho pozice.
screen.button.default=Defaultní
screen.button.cancel=Zrušit
screen.button.default=Defaultní
screen.button.cancel=Zrušit
screen.button.ok=Ok
screen.button.yes=Ano
screen.button.no=Ne
screen.button.back=Zpìt
screen.button.hidden=Skrytý
screen.button.visible=Viditelný
screen.button.maintained=Spravované
screen.button.toggled=Pøepnuté
screen.button.back=Zpìt
screen.button.hidden=Skrytý
screen.button.visible=Viditelný
screen.button.maintained=Spravované
screen.button.toggled=Pøepnuté
choice.showhidewaila=Zobrazit/Skrýt Wailu
choice.showhidewaila=Zobrazit/Skrýt Wailu
choice.showhideidmeta=Zobrazit ID:Metadata
choice.toggledmaintained=Pøepnuté/Spravované
choice.toggledmaintained=Pøepnuté/Spravované
choice.showliquids=Tekutiny
choice.shifttoggledblock=Pliž se pro pøepnutí blokù
choice.shifttoggledents=Pliž se pro pøepnutí entit
screen.button.configureaspect=Nastavení vzhledu...
choice.shifttoggledblock=Pliž se pro pøepnutí blokù
choice.shifttoggledents=Pliž se pro pøepnutí entit
screen.button.configureaspect=Nastavení vzhledu...
enchant.title.name=Jméno
enchant.title.minlvl=Minimální lvl
enchant.title.maxlvl=Maximální lvl
enchant.title.name=Jméno
enchant.title.minlvl=Minimální lvl
enchant.title.maxlvl=Maximální lvl
enchant.title.weight=Hmotnost
enchant.label.enchantability=Oèarovatelnost
enchant.label.enchantability=Oèarovatelnost
waila.keybind.wailaconfig=[Waila] Nastavení obrazu
waila.keybind.wailadisplay=[Waila] Zobrazit/Skrýt
waila.keybind.showadvanced=[Waila] Rozšířit popisek
waila.keybind.wailaconfig=[Waila] Nastavení obrazu
waila.keybind.wailadisplay=[Waila] Zobrazit/Skrýt
waila.keybind.liquid=[Waila] Zobrazit tekutiny
waila.keybind.recipe=[Waila] Zobrazit recept
waila.keybind.usage=[Waila] Zobrazit použití
waila.keybind.testing=[Waila] Testování
waila.keybind.usage=[Waila] Zobrazit použití
waila.keybind.testing=[Waila] Testování
client.msg.norecipe=Nenalezen žádný recept.
client.msg.nousage=Nenalezeno žádné využití.
hud.msg.holdkeymoreinfo=Držte %s pro více informací
client.msg.norecipe=Nenalezen žádný recept.
client.msg.nousage=Nenalezeno žádné využití.
hud.msg.none=<Nic>
hud.msg.empty=<Prázdný>
hud.msg.output=Výstup
hud.msg.empty=<Prázdný>
hud.msg.output=Výstup
hud.msg.input=Vstup
hud.msg.out=Ven
hud.msg.in=Dovnitø
hud.msg.in=Dovnitø
hud.msg.power=Energie
hud.msg.storage=Úložištì
hud.msg.stored=Uloženo
hud.msg.any=Jakýkoliv
hud.msg.mode=Mód
hud.msg.maxpower=Maximální Energie
hud.msg.trigger=Spouštìè
hud.msg.maxio=Maximální propustnost
hud.msg.storage=Úložištì
hud.msg.stored=Uloženo
hud.msg.any=Jakýkoliv
hud.msg.mode=Mód
hud.msg.maxpower=Maximální Energie
hud.msg.trigger=Spouštìè
hud.msg.maxio=Maximální propustnost
hud.msg.send=Odeslat
hud.msg.recv=Obdržet
hud.msg.item=Pøedmìt
hud.msg.recv=Obdržet
hud.msg.item=Pøedmìt
hud.msg.fluid=Tekutina
hud.msg.energ=Energie
hud.msg.frequency=Frekvence
hud.msg.owner=Vlastník
hud.msg.public=Veøejné
hud.msg.restricted=Omezené
hud.msg.private=Soukromé
hud.msg.owner=Vlastník
hud.msg.public=Veøejné
hud.msg.restricted=Omezené
hud.msg.private=Soukromé
hud.msg.white=Bílá
hud.msg.orange=Oranžová
hud.msg.magenta=Purpurová
hud.msg.lblue=Svìtle modrá
hud.msg.yellow=Žlutá
hud.msg.lime=Svìtle zelená
hud.msg.pink=Rùžová
hud.msg.gray=Šedá
hud.msg.lgray=Svìtle šedá
hud.msg.cyan=Tyrkysová
hud.msg.purple=Fialová
hud.msg.blue=Modrá
hud.msg.brown=Hnìdá
hud.msg.green=Zelená
hud.msg.red=Èervená
hud.msg.black=Èerná
hud.msg.white=Bílá
hud.msg.orange=Oranžová
hud.msg.magenta=Purpurová
hud.msg.lblue=Svìtle modrá
hud.msg.yellow=Žlutá
hud.msg.lime=Svìtle zelená
hud.msg.pink=Rùžová
hud.msg.gray=Šedá
hud.msg.lgray=Svìtle šedá
hud.msg.cyan=Tyrkysová
hud.msg.purple=Fialová
hud.msg.blue=Modrá
hud.msg.brown=Hnìdá
hud.msg.green=Zelená
hud.msg.red=Èervená
hud.msg.black=Èerná
hud.msg.growth=Rùst
hud.msg.mature=Stáøí
hud.msg.growth=Rùst
hud.msg.mature=Stáøí
hud.msg.off=Vypnuto
hud.msg.on=Zapnuto
hud.msg.state=Stav
hud.msg.delay=Prodleva
hud.msg.comparator=Porovnávaè
hud.msg.comparator=Porovnávaè
hud.msg.substractor=Substraktor
hud.msg.record=Záznam
hud.msg.record=Záznam
hud.msg.offers=Poskytuje
hud.msg.demands=Požaduje
hud.msg.demands=Požaduje
option.appeng.monitorcontent=Obsah monitoru
option.bb.content=Obsah barelu
option.bc.tankamount=Množství tekutiny
option.bc.tankamount=Množství tekutiny
option.bc.tanktype=Typ tekutiny
option.enderstorage.colors=Barvy
option.ic2.inputeumach=Maximální pøíjem EU [Stroje]
option.ic2.inputeuother=Maximální pøíjem EU [Ostatní]
option.ic2.inputeu=Maximální pøijem EU
option.ic2.outputeu=Maximální výstup EU
option.ic2.storage=Uloženo energie
option.ic2.consump=Zobrazit spotøebu
option.ic2.tradeomat=Zobrazit Trade-O-Mat požadavek
option.thaumcraft.storedvis=Úložištì kondenzátoru
option.thermalexpansion.energyhandler=Zobrazit úložištì RF
option.thermalexpansion.energycell=Zobrazit ECell VSTUP/VÝSTUP
option.ic2.inputeumach=Maximální pøíjem EU [Stroje]
option.ic2.inputeuother=Maximální pøíjem EU [Ostatní]
option.ic2.inputeu=Maximální pøijem EU
option.ic2.outputeu=Maximální výstup EU
option.ic2.storage=Uloženo energie
option.ic2.consump=Zobrazit spotøebu
option.ic2.tradeomat=Zobrazit Trade-O-Mat požadavek
option.thaumcraft.storedvis=Úložištì kondenzátoru
option.thermalexpansion.energyhandler=Zobrazit úložištì RF
option.thermalexpansion.energycell=Zobrazit ECell VSTUP/VÝSTUP
option.thermalexpansion.fluidtype=Zobrazit typ tekutiny
option.thermalexpansion.fluidamount=Zobrazit množství tekutiny
option.thermalexpansion.tankmode=Zobrazit mód nádrže
option.thermalexpansion.fluidamount=Zobrazit množství tekutiny
option.thermalexpansion.tankmode=Zobrazit mód nádrže
option.thermalexpansion.tesssendrecv=Tesseract mode
option.thermalexpansion.tessfreq=Frekvence Teseraktu
option.thermalexpansion.owner=Zobrazit majitele
option.thermalexpansion.conditemmode=Zobrazit mód Itemduktu
option.thermalexpansion.conditemmode=Zobrazit mód Itemduktu
option.vanilla.spawntype=Typ spawneru
option.vanilla.growthvalue=Hodnota rùstu
option.vanilla.leverstate=Stav páky
option.vanilla.repeater=Prodleva opakovaèe
option.vanilla.comparator=Mód porovnávaèe
option.vanilla.redstone=Ruditová energie
option.vanilla.jukebox=Jukeboxový disk
option.vanilla.silverfish=Skrýt rybenku
option.vanilla.growthvalue=Hodnota rùstu
option.vanilla.leverstate=Stav páky
option.vanilla.repeater=Prodleva opakovaèe
option.vanilla.comparator=Mód porovnávaèe
option.vanilla.redstone=Ruditová energie
option.vanilla.jukebox=Jukeboxový disk
option.vanilla.silverfish=Skrýt rybenku
option.etb.displaydata=Zobrazit data slotu
option.enderio.inout=Zobrazit vstup/výstup
option.enderio.storage=Zobrazit uskladnìné MJ
option.enderio.inout=Zobrazit vstup/výstup
option.enderio.storage=Zobrazit uskladnìné MJ
option.enderio.owner=Zobrazit majitele bloku
option.enderio.channel=Zobrazit kanál nadkrychle
option.bcapi.storage=Zobrazit uskladnìné MJ
option.bcapi.consump=Zobrazit maximální energii
option.bcapi.trigger=Zobrazit spouštìjící se energii
option.pr.showio=Zobrazit IO brány
option.enderio.channel=Zobrazit kanál nadkrychle
option.bcapi.storage=Zobrazit uskladnìné MJ
option.bcapi.consump=Zobrazit maximální energii
option.bcapi.trigger=Zobrazit spouštìjící se energii
option.pr.showio=Zobrazit IO brány
option.pr.showdata=Zobrazit data bran
option.extrautilities.fluidamount=Zobrazit množství tekutin
option.openblocks.fluidamount=Zobrazit množství tekutin
option.railcraft.fluidamount=Zobrazit množství tekutin
option.secretrooms.hide=Skrýt camo bloky
option.carpenters.hide=Skrýt camo bloky
option.extrautilities.fluidamount=Zobrazit množství tekutin
option.openblocks.fluidamount=Zobrazit množství tekutin
option.railcraft.fluidamount=Zobrazit množství tekutin
option.secretrooms.hide=Skrýt camo bloky
option.carpenters.hide=Skrýt camo bloky
option.stevescarts.showall=Zobrazit data
option.stevescarts.colorblind=Barevný mód
option.stevescarts.shifttoggle=Shift pro pøepnutí
option.general.showhp=Zobrazit zdraví entit
option.general.showcrop=Zobrazit rùst plodin
option.stevescarts.colorblind=Barevný mód
option.stevescarts.shifttoggle=Shift pro pøepnutí
option.general.showhp=Zobrazit zdraví entit
option.general.showcrop=Zobrazit rùst plodin
option.thaumcraft.aspects=Zobrazit aspekty
@@ -30,7 +30,6 @@ enchant.label.enchantability=Verzauberbarkeit
waila.keybind.wailaconfig=[Waila] Config-Bildschirm
waila.keybind.wailadisplay=[Waila] Zeigen/Verstecken
waila.keybind.showadvanced=[Waila] Tooltip erweitern
waila.keybind.liquid=[Waila] Zeige Flüssigkeiten
waila.keybind.recipe=[Waila] Zeige Rezept
waila.keybind.usage=[Waila] Zeige Nutzung
@@ -39,8 +38,6 @@ waila.keybind.testing=[Waila] Testen
client.msg.norecipe=Kein Rezept gefunden.
client.msg.nousage=Keine Nutzung gefunden.
hud.msg.holdkeymoreinfo=Halte %s für mehr Infos
hud.msg.none=<Nichts>
hud.msg.empty=<Leer>
hud.msg.output=Output
@@ -20,7 +20,6 @@ choice.toggledmaintained=Toggled/Maintained
choice.showliquids=Liquids
choice.shifttoggledblock=Sneak toggle blocks
choice.shifttoggledents=Sneak toggle entities
choice.showicon=Show/Hide Icon
screen.button.configureaspect=Configure aspect...
enchant.title.name=Name
@@ -31,7 +30,6 @@ enchant.label.enchantability=Enchantability
waila.keybind.wailaconfig=[Waila] Config screen
waila.keybind.wailadisplay=[Waila] Show/Hide
waila.keybind.showadvanced=[Waila] Expand Tooltip
waila.keybind.liquid=[Waila] Show liquids
waila.keybind.recipe=[Waila] Show recipe
waila.keybind.usage=[Waila] Show usage
@@ -40,8 +38,6 @@ waila.keybind.testing=[Waila] Testing
client.msg.norecipe=No recipe found.
client.msg.nousage=No usage found.
hud.msg.holdkeymoreinfo=Hold %s for more info
hud.msg.none=<None>
hud.msg.empty=<Empty>
hud.msg.output=Output
@@ -99,8 +95,6 @@ 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
@@ -30,7 +30,6 @@ enchant.label.enchantability=Loitsitav
waila.keybind.wailaconfig=[Waila] Konfiguratsiooni ekraan
waila.keybind.wailadisplay=[Waila] Näita/Peida
waila.keybind.showadvanced=[Waila] Laienda kohtspikrit
waila.keybind.liquid=[Waila] Näita vedelikke
waila.keybind.recipe=[Waila] Näita retsepti
waila.keybind.usage=[Waila] Näita kasutamist
@@ -39,8 +38,6 @@ waila.keybind.testing=[Waila] Testimine
client.msg.norecipe=Ühtegi retsepti ei leitud.
client.msg.nousage=Ühtegi kasutust ei leitud.
hud.msg.holdkeymoreinfo=Hoia %s lisainfo saamiseks
hud.msg.none=<Mitte Ükski>
hud.msg.empty=<Tühi>
hud.msg.output=Väljund
@@ -28,7 +28,6 @@ enchant.label.enchantability=Enchantabilitée
waila.keybind.wailaconfig=[Waila] Ecran de config
waila.keybind.wailadisplay=[Waila] Afficher/Masquer
waila.keybind.showadvanced=[Waila] Développer l'info-bulle
waila.keybind.liquid=[Waila] Afficher les liquides
waila.keybind.recipe=[Waila] Afficher les recettes
waila.keybind.usage=[Waila] Afficher l'utilisation
@@ -37,8 +36,6 @@ waila.keybind.testing=[Waila] Test
client.msg.norecipe=Pas de recette trouvée.
client.msg.nousage=Pas d'utilisation trouvée.
hud.msg.holdkeymoreinfo=Maintenez %s pour plus d'infos
hud.msg.none=<Aucun>
hud.msg.empty=<Vide>
hud.msg.output=Sortie
@@ -30,7 +30,6 @@ enchant.label.enchantability=Incantabilità
waila.keybind.wailaconfig=[Waila] Config menù
waila.keybind.wailadisplay=[Waila] Mostra/Nascondi
waila.keybind.showadvanced=[Waila] Espandi tooltip
waila.keybind.liquid=[Waila] Mostra liquidi
waila.keybind.recipe=[Waila] Mostra ricetta
waila.keybind.usage=[Waila] Mostra uso
@@ -39,8 +38,6 @@ waila.keybind.testing=[Waila] Provare
client.msg.norecipe=Nessuna ricetta trovata.
client.msg.nousage=Nessun uso trovato.
hud.msg.holdkeymoreinfo=Tieni premuto %s per più info
hud.msg.none=<Niente>
hud.msg.empty=<Vuoto>
hud.msg.output=Uscita
@@ -28,7 +28,6 @@ enchant.label.enchantability=Enchantbaarheid
waila.keybind.wailaconfig=[Waila] Configuratiescherm
waila.keybind.wailadisplay=[Waila] Toon/Verberg
waila.keybind.showadvanced=[Waila] Tooltip uitvouwen
waila.keybind.liquid=[Waila] Toon vloeistoffen
waila.keybind.recipe=[Waila] Toon recepten
waila.keybind.usage=[Waila] Toon gebruik
@@ -37,8 +36,6 @@ waila.keybind.testing=[Waila] Testen
client.msg.norecipe=Geen recept gevonden.
client.msg.nousage=Geen gebruik gevonden.
hud.msg.holdkeymoreinfo=Houd %s ingedrukt voor meer info
hud.msg.none=<Geen>
hud.msg.empty=<Leeg>
hud.msg.output=Uitvoer
@@ -30,7 +30,6 @@ enchant.label.enchantability=Зачарование
waila.keybind.wailaconfig=[Waila] Меню настроек
waila.keybind.wailadisplay=[Waila] Показать/Скрыть
waila.keybind.showadvanced=[Waila] Развернуть подсказку
waila.keybind.liquid=[Waila] Показать жидкости
waila.keybind.recipe=[Waila] Показать рецепт
waila.keybind.usage=[Waila] Показать применение
@@ -39,8 +38,6 @@ waila.keybind.testing=[Waila] Тестировать
client.msg.norecipe=Рецептов не найдено.
client.msg.nousage=Применений не найдено.
hud.msg.holdkeymoreinfo=Удерживайте %s для подробностей
hud.msg.none=<Ничего>
hud.msg.empty=<Пусто>
hud.msg.output=Вывод
@@ -30,7 +30,6 @@ enchant.label.enchantability=附魔能力
waila.keybind.wailaconfig=[Waila]配置屏幕
waila.keybind.wailadisplay=[Waila]显示/隐藏
waila.keybind.showadvanced=[Waila]展开工具提示
waila.keybind.liquid=[Waila]显示流体
waila.keybind.recipe=[Waila]显示合成
waila.keybind.usage=[Waila]显示可参与合成
@@ -39,8 +38,6 @@ waila.keybind.testing=[Waila]测试中
client.msg.norecipe=未发现合成表.
client.msg.nousage=未发现可参与合成.
hud.msg.holdkeymoreinfo=按住 %s 查看更多信息
hud.msg.none=<无>
hud.msg.empty=<空>
hud.msg.output=输出