TagAPI

30 - refreshPlayer toggles invisibility !

What steps will reproduce the problem? 1. Whenever I call TagAPI.refreshPlayer((Player) event.getWhoClicked()) in a InventoryClickEvent it will toggle the player who clicked their inventory invisibility 2. I did try to remove all of my code and it still did it, but in case you need it here is my code:

package ca.kanoa.AssassinHeads;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.plugin.java.JavaPlugin;
import org.kitteh.tag.PlayerReceiveNameTagEvent;
import org.kitteh.tag.TagAPI;

public class AssassinHeads extends JavaPlugin implements Listener{

	public void onEnable(){
		this.getServer().getPluginManager().registerEvents(this, this);
		this.getLogger().info("AssassinHeads loaded, prepare for DEATH");
	}

	@EventHandler
	public void onPlayerReceiveNameTag (PlayerReceiveNameTagEvent event){
		Player player = event.getNamedPlayer();
		if(player.getInventory().getHelmet() != null){
			ItemStack headItem = player.getInventory().getHelmet();

			if(headItem.getType() == Material.SKULL_ITEM){
				SkullMeta head = (SkullMeta) headItem.getItemMeta();
				if(head.hasOwner()){
					event.setTag(head.getOwner());
				}
			}
		}
	}

	@EventHandler
	public void onInventoryClick(InventoryClickEvent event){
		TagAPI.refreshPlayer((Player) event.getWhoClicked());
	}
}

What is the expected output? What do you see instead? I want it so that whenever a player puts on someone elses head, it changes their nametag to that of the oher players!

What version of the product are you using? The latest as of two days ago

Do you have an error log of what happened? Nope, doesn't have an error log

User When Change
mbaxter Feb 16, 2014 at 00:29 UTC Changed status from Replied to Declined
12323op Feb 03, 2013 at 14:21 UTC
mbaxter Feb 03, 2013 at 04:59 UTC
12323op Feb 02, 2013 at 22:26 UTC
mbaxter Feb 02, 2013 at 15:57 UTC
12323op Feb 02, 2013 at 15:16 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 8 comments
  • Avatar of mbaxter mbaxter Feb 16, 2014 at 00:29 UTC - 0 likes

    Cannot reproduce

    www.joe.to Gaming Community - Over a decade of fun!

    Four Minecraft servers, four TF2 servers, CSS and Garry's Mod.

    http://forums.joe.to

  • Avatar of blablubbabc blablubbabc Apr 04, 2013 at 22:26 UTC - 0 likes

    +1 I always had problems with players sometimes going invisible in one of my plugins using TagAPI, but I never was able to completly fix it or understand why this is happening. So maybe it is/was TagAPI the whole time.. which would be great, 'cause I could stop going crazy trying to find the problems source!

  • Avatar of mbaxter mbaxter Feb 13, 2013 at 05:20 UTC - 0 likes

    Yeah, I just don't have much free time at the moment to look into it.

  • Avatar of 12323op 12323op Feb 08, 2013 at 12:30 UTC - 0 likes

    Have you checked out the video yet?

    BFAK:90688621,6e6f811920e96873052d962d6ab63268bf0cb2798d160316c1659cae53cf47ee Finished my LightningRods 2 plugin, yay!

    * * * * * * * * * * * * * * * * * * * * * * * * * * *

    Gonna be completely re-coding my MultiHome plugin soon, once I finish its going to be legendary!

  • Avatar of 12323op 12323op Feb 03, 2013 at 14:21 UTC - 0 likes

    Alright, I added your code in and its just calling the event once...I made a quick video here if you want to see whats happening

  • Avatar of mbaxter mbaxter Feb 03, 2013 at 02:45 UTC - 0 likes

    Can you possibly add some code that outputs when your listener fires? I'm curious if it's double-firing in a single tick (or two in a row)

  • Avatar of 12323op 12323op Feb 02, 2013 at 22:26 UTC - 0 likes

    Its not just a bit of vanished player, it lasts until they die and/or update their inventory...I tried to comment out all my code and left only this:

    @EventHandler
    	public void onInventoryClick(InventoryClickEvent event){
    		TagAPI.refreshPlayer((Player) event.getWhoClicked());
    	}
    

    But it still does the same thing, if you want I can record it and upload it...

  • Avatar of mbaxter mbaxter Feb 02, 2013 at 15:54 UTC - 0 likes

    Refresh vanished the player, and then a few ticks (two? three? Can't remember but can look later) later reveals them again. The only possibility I can think of for it permanently hiding somebody is if you have a plugin that's cancelling all tasks on the scheduler.

    If you're unable to resolve this before I'm back later in the day, I might be able to throw this code onto my server and test.

  • 8 comments

Facts

Last updated
Feb 16, 2014
Reported
Feb 02, 2013
Status
Declined - We decided not to take action on this ticket.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.
Votes
2

Reported by

Possible assignees