Posted July 15, 201411 yr I'm trying to make it so tools you look at always show the durability when you mouse over them, (You don't need F3+H/Advanced tooltips to see them in this case) This is working fine client sided however when it comes to the server it doesn't work at all. Here are the 3 Proxies I have Common Proxy: package com.sixonethree.home.proxy; import com.sixonethree.home.utility.WarpPoint; public abstract class CommonProxy { public void init() { WarpPoint.loadAll(); } public void exit() { WarpPoint.saveAll(); } } ServerProxy: package com.sixonethree.home.proxy; public class ServerProxy extends CommonProxy { } ClientProxy: package com.sixonethree.home.proxy; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class ClientProxy extends CommonProxy { @Override public void init() { super.init(); MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onItemTooltip(ItemTooltipEvent event) { if (!event.showAdvancedItemTooltips) { if (event.itemStack != null) { ItemStack is = event.itemStack; if (is.isItemDamaged()) { event.toolTip.add(EnumChatFormatting.GRAY + "Durability: " + (is.getMaxDamage() - is.getItemDamage() + " / " + is.getMaxDamage())); } } } } } I've got no idea why it doesn't work when it comes to the server side, any help is appreciated
July 15, 201411 yr Tooltips serverside? Can you explain what you are trying to do, and what you expect to happen?
July 15, 201411 yr ServerProxy? That is a new one. Are you sure you meant to have the ! in "if (!event.showAdvancedItemTooltips) {" I would recommend putting some print statements in your event and find out where it is failing. Long time Bukkit & Forge Programmer Happy to try and help
July 15, 201411 yr You can try to make a new class and put the evemt there. Than refister it in your main mod. You probably know that Clientproxy is for client only, right?
July 16, 201411 yr Can you explain why you want to do tooltips on server side? Tooltips are related to GUI because it is about rendering something graphical. So by definition it is pretty much a client only thing. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.