Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

Tooltips serverside?

 

Can you explain what you are trying to do, and what you expect to happen?

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

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?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.