mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-15 17:44:46 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bdebd737d6 | ||
|
|
9f04d3d029 | ||
|
|
ef3c4a9774 | ||
|
|
3b64d21335 | ||
|
|
72c91a3700 | ||
|
|
bf6d309038 | ||
|
|
5bb7f7221a | ||
|
|
6278e4d575 |
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.7.54-GTNH:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.7.87-GTNH:dev')
|
||||
|
||||
shadowImplementation('au.com.bytecode:opencsv:2.4')
|
||||
}
|
||||
+1
-1
@@ -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: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||
# Note: UniMixins 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
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.43'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package mcp.mobius.waila;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -8,11 +7,7 @@ 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;
|
||||
@@ -69,18 +64,10 @@ 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(WailaTickHandler.instance());
|
||||
|
||||
FMLCommonHandler.instance().bus().register(new WailaTickHandler());
|
||||
}
|
||||
FMLCommonHandler.instance().bus().register(new NetworkHandler());
|
||||
}
|
||||
@@ -91,7 +78,7 @@ public class Waila {
|
||||
ModIdentification.init();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@EventHandler
|
||||
public void loadComplete(FMLLoadCompleteEvent event) {
|
||||
proxy.registerMods();
|
||||
proxy.registerIMCs();
|
||||
|
||||
@@ -62,6 +62,35 @@ 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}
|
||||
|
||||
@@ -6,6 +6,7 @@ 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;
|
||||
@@ -17,7 +18,9 @@ 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;
|
||||
@@ -146,11 +149,29 @@ 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,6 +10,7 @@ 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;
|
||||
@@ -22,6 +23,7 @@ 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
|
||||
@@ -34,6 +36,8 @@ 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
|
||||
@@ -70,4 +74,15 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -68,7 +68,9 @@ public class ProxyClient extends ProxyServer {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
DataAccessorCommon.instance = new DataAccessorCommon();
|
||||
if (event.world.isRemote) {
|
||||
DataAccessorCommon.instance = new DataAccessorCommon();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,16 +11,11 @@ import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
|
||||
public class OverlayRenderer {
|
||||
|
||||
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;
|
||||
private static boolean hasBlending;
|
||||
private static boolean hasDepthTest;
|
||||
private static int boundTexIndex;
|
||||
|
||||
public static void renderOverlay() {
|
||||
public static void renderOverlay(Tooltip tooltip) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (!(mc.currentScreen == null && mc.theWorld != null
|
||||
&& Minecraft.isGuiEnabled()
|
||||
@@ -31,16 +26,16 @@ public class OverlayRenderer {
|
||||
|
||||
if (RayTracing.instance().getTarget().typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
|
||||
&& RayTracing.instance().getTargetStack() != null) {
|
||||
renderOverlay(WailaTickHandler.instance().tooltip);
|
||||
doRenderOverlay(tooltip);
|
||||
}
|
||||
|
||||
if (RayTracing.instance().getTarget().typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY
|
||||
&& ConfigHandler.instance().getConfig("general.showents")) {
|
||||
renderOverlay(WailaTickHandler.instance().tooltip);
|
||||
doRenderOverlay(tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
public static void renderOverlay(Tooltip tooltip) {
|
||||
private static void doRenderOverlay(Tooltip tooltip) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
saveGLState();
|
||||
@@ -80,26 +75,23 @@ public class OverlayRenderer {
|
||||
|
||||
}
|
||||
|
||||
public static void saveGLState() {
|
||||
private 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);
|
||||
}
|
||||
|
||||
public static void loadGLState() {
|
||||
private 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();
|
||||
}
|
||||
|
||||
public static void drawTooltipBox(int x, int y, int w, int h, int bg, int grad1, int grad2) {
|
||||
private 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
|
||||
@@ -107,7 +99,6 @@ 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,6 +26,7 @@ import mcp.mobius.waila.utils.Constants;
|
||||
|
||||
public class RayTracing {
|
||||
|
||||
private MovingObjectPosition target = null;
|
||||
private static RayTracing _instance;
|
||||
|
||||
private RayTracing() {}
|
||||
@@ -35,22 +36,22 @@ 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;
|
||||
}
|
||||
|
||||
private static boolean shouldHidePlayer(Entity targetEnt) {
|
||||
// Check if entity is player with invisibility effect
|
||||
if (targetEnt instanceof EntityPlayer thePlayer) {
|
||||
@@ -116,7 +117,7 @@ public class RayTracing {
|
||||
|
||||
if (this.target == null) return items;
|
||||
|
||||
World world = mc.theWorld;
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
|
||||
int x = this.target.blockX;
|
||||
int y = this.target.blockY;
|
||||
|
||||
@@ -12,169 +12,138 @@ 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 {
|
||||
|
||||
public Tooltip tooltip = null;
|
||||
public MetaDataProvider handler = new MetaDataProvider();
|
||||
private final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
private static WailaTickHandler _instance;
|
||||
|
||||
private WailaTickHandler() {}
|
||||
|
||||
public static WailaTickHandler instance() {
|
||||
if (_instance == null) _instance = new WailaTickHandler();
|
||||
return _instance;
|
||||
}
|
||||
private Tooltip tooltip = null;
|
||||
private final MetaDataProvider handler = new MetaDataProvider();
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void tickRender(TickEvent.RenderTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
OverlayRenderer.renderOverlay();
|
||||
OverlayRenderer.renderOverlay(tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
@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()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false)) {
|
||||
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false);
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
World world = mc.theWorld;
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
if (world != null && player != null) {
|
||||
RayTracing.instance().fire();
|
||||
MovingObjectPosition target = RayTracing.instance().getTarget();
|
||||
if (world == null || player == null) {
|
||||
this.tooltip = null;
|
||||
RayTracing.instance().clear();
|
||||
return;
|
||||
}
|
||||
|
||||
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
|
||||
RayTracing.instance().fire();
|
||||
MovingObjectPosition target = RayTracing.instance().getTarget();
|
||||
|
||||
if (targetStack != null) {
|
||||
currenttip = new TipList<String, String>();
|
||||
currenttipHead = new TipList<String, String>();
|
||||
currenttipBody = new TipList<String, String>();
|
||||
currenttipTail = new TipList<String, String>();
|
||||
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
|
||||
|
||||
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 (targetStack != 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_SHIFTBLOCK, false)
|
||||
&& !currenttipBody.isEmpty()
|
||||
&& !accessor.getPlayer().isSneaking()) {
|
||||
currenttipBody.clear();
|
||||
currenttipBody.add(ITALIC + "Press shift for more data");
|
||||
}
|
||||
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);
|
||||
|
||||
currenttip.addAll(currenttipHead);
|
||||
currenttip.addAll(currenttipBody);
|
||||
currenttip.addAll(currenttipTail);
|
||||
|
||||
this.tooltip = new Tooltip(currenttip, targetStack);
|
||||
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");
|
||||
}
|
||||
} else if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
|
||||
DataAccessorCommon accessor = DataAccessorCommon.instance;
|
||||
accessor.set(world, player, target);
|
||||
|
||||
Entity targetEnt = RayTracing.instance().getTargetEntity(); // This need to be replaced by the override
|
||||
// check.
|
||||
currenttip.addAll(currenttipHead);
|
||||
currenttip.addAll(currenttipBody);
|
||||
currenttip.addAll(currenttipTail);
|
||||
|
||||
if (targetEnt != null) {
|
||||
currenttip = new TipList<String, String>();
|
||||
currenttipHead = new TipList<String, String>();
|
||||
currenttipBody = new TipList<String, String>();
|
||||
currenttipTail = new TipList<String, String>();
|
||||
this.tooltip = new Tooltip(currenttip, targetStack);
|
||||
}
|
||||
} else if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
|
||||
DataAccessorCommon accessor = DataAccessorCommon.instance;
|
||||
accessor.set(world, player, target);
|
||||
|
||||
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);
|
||||
Entity targetEnt = RayTracing.instance().getTargetEntity(); // This need to be replaced by the override
|
||||
// check.
|
||||
|
||||
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");
|
||||
}
|
||||
if (targetEnt != null) {
|
||||
currenttip = new TipList<String, String>();
|
||||
currenttipHead = new TipList<String, String>();
|
||||
currenttipBody = new TipList<String, String>();
|
||||
currenttipTail = new TipList<String, String>();
|
||||
|
||||
currenttip.addAll(currenttipHead);
|
||||
currenttip.addAll(currenttipBody);
|
||||
currenttip.addAll(currenttipTail);
|
||||
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);
|
||||
|
||||
this.tooltip = new Tooltip(currenttip, false);
|
||||
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");
|
||||
}
|
||||
|
||||
currenttip.addAll(currenttipHead);
|
||||
currenttip.addAll(currenttipBody);
|
||||
currenttip.addAll(currenttipTail);
|
||||
|
||||
this.tooltip = new Tooltip(currenttip, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,16 +114,12 @@ 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.info(String.format("Trying to reflect %s %s", className, methodName));
|
||||
|
||||
Waila.log.debug(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,6 +6,7 @@ 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";
|
||||
|
||||
@@ -30,6 +30,7 @@ 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.liquid=[Waila] Zobrazit tekutiny
|
||||
waila.keybind.recipe=[Waila] Zobrazit recept
|
||||
waila.keybind.usage=[Waila] Zobrazit použití
|
||||
@@ -38,6 +39,8 @@ 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í
|
||||
|
||||
hud.msg.none=<Nic>
|
||||
hud.msg.empty=<Prázdný>
|
||||
hud.msg.output=Výstup
|
||||
|
||||
@@ -30,6 +30,7 @@ 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
|
||||
@@ -38,6 +39,8 @@ 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
|
||||
|
||||
@@ -31,6 +31,7 @@ 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
|
||||
@@ -39,6 +40,8 @@ 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
|
||||
|
||||
@@ -30,6 +30,7 @@ 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
|
||||
@@ -38,6 +39,8 @@ 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,6 +28,7 @@ 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
|
||||
@@ -36,6 +37,8 @@ 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,6 +30,7 @@ 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
|
||||
@@ -38,6 +39,8 @@ 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,6 +28,7 @@ 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
|
||||
@@ -36,6 +37,8 @@ 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,6 +30,7 @@ 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] Показать применение
|
||||
@@ -38,6 +39,8 @@ waila.keybind.testing=[Waila] Тестировать
|
||||
client.msg.norecipe=Рецептов не найдено.
|
||||
client.msg.nousage=Применений не найдено.
|
||||
|
||||
hud.msg.holdkeymoreinfo=Удерживайте %s для подробностей
|
||||
|
||||
hud.msg.none=<Ничего>
|
||||
hud.msg.empty=<Пусто>
|
||||
hud.msg.output=Вывод
|
||||
|
||||
@@ -30,6 +30,7 @@ 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]显示可参与合成
|
||||
@@ -38,6 +39,8 @@ waila.keybind.testing=[Waila]测试中
|
||||
client.msg.norecipe=未发现合成表.
|
||||
client.msg.nousage=未发现可参与合成.
|
||||
|
||||
hud.msg.holdkeymoreinfo=按住 %s 查看更多信息
|
||||
|
||||
hud.msg.none=<无>
|
||||
hud.msg.empty=<空>
|
||||
hud.msg.output=输出
|
||||
|
||||
Reference in new issue
Block a user