Java Code Examples for net.minecraft.entity.player.EntityPlayer#getDisplayName()

The following examples show how to use net.minecraft.entity.player.EntityPlayer#getDisplayName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FMEventHandler.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 6 votes vote down vote up
@SubscribeEvent
public void onEntityUpdate(LivingUpdateEvent event){
    if(Compat.bm && event.entityLiving != null && event.entityLiving instanceof EntityPlayer && !event.entityLiving.worldObj.isRemote){
        EntityPlayer player = (EntityPlayer)event.entityLiving;
        String name = player.getDisplayName();
        if(player.isPotionActive(DarkPotions.bloodSeal)){
            try {
                if (lastLP.containsKey(name)) {
                    if (SoulNetworkHandler.getCurrentEssence(name) > lastLP.get(name))
                        SoulNetworkHandler.setCurrentEssence(name, lastLP.get(name));
                    else
                        lastLP.put(name, SoulNetworkHandler.getCurrentEssence(name));
                }
                else
                    lastLP.put(name, SoulNetworkHandler.getCurrentEssence(name));
            }
            catch(Throwable e){
                Compat.bm = false;
            }
        }
        else if(lastLP.containsKey(name))
            lastLP.remove(name);
    }
}
 
Example 2
Source File: SoulNetworkHandler.java    From Framez with GNU General Public License v3.0 4 votes vote down vote up
public static String getUsername(EntityPlayer player)
{
    return player.getDisplayName();
}
 
Example 3
Source File: Resident.java    From MyTown2 with The Unlicense 4 votes vote down vote up
public void setPlayer(EntityPlayer pl) {
    this.player = pl;
    this.playerName = pl.getDisplayName();
}
 
Example 4
Source File: SoulNetworkHandler.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
public static String getUsername(EntityPlayer player)
{
	return player.getDisplayName();
}