當前位置: 首頁>>代碼示例>>Java>>正文


Java Property.hasSignature方法代碼示例

本文整理匯總了Java中com.mojang.authlib.properties.Property.hasSignature方法的典型用法代碼示例。如果您正苦於以下問題:Java Property.hasSignature方法的具體用法?Java Property.hasSignature怎麽用?Java Property.hasSignature使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.mojang.authlib.properties.Property的用法示例。


在下文中一共展示了Property.hasSignature方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeSpawnData

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
@Override
public void writeSpawnData(ByteBuf buffer) {
	
	
	if(!this.first) {
		PacketBuffer buff = new PacketBuffer(buffer);
		buffer.writeBoolean(this.player);
		if (this.profile != null) {
			buff.writeUniqueId(this.profile.getId());
               buff.writeString(this.profile.getName());
               buff.writeVarInt(this.profile.getProperties().size());

               for (Property property : this.profile.getProperties().values())
               {
                   buff.writeString(property.getName());
                   buff.writeString(property.getValue());

                   if (property.hasSignature())
                   {
                       buff.writeBoolean(true);
                       buff.writeString(property.getSignature());
                   }
                   else
                   {
                       buff.writeBoolean(false);
                   }
               }
		}
		buff.writeCompoundTag(data);
		buff.writeBoolean(useHand);
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:33,代碼來源:EntityStatue.java

示例2: serialize

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
public static NBTTagCompound serialize(NBTTagCompound nbttagcompound, GameProfile gameprofile) {
    if (!UtilColor.b(gameprofile.getName())) {
        nbttagcompound.setString("Name", gameprofile.getName());
    }

    if (gameprofile.getId() != null) {
        nbttagcompound.setString("Id", gameprofile.getId().toString());
    }

    if (!gameprofile.getProperties().isEmpty()) {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        Iterator iterator = gameprofile.getProperties().keySet().iterator();

        while (iterator.hasNext()) {
            String s = (String) iterator.next();
            NBTTagList nbttaglist = new NBTTagList();

            NBTTagCompound nbttagcompound2;

            for (Iterator iterator1 = gameprofile.getProperties().get(s).iterator(); iterator1.hasNext(); nbttaglist.add(nbttagcompound2)) {
                Property property = (Property) iterator1.next();

                nbttagcompound2 = new NBTTagCompound();
                nbttagcompound2.setString("Value", property.getValue());
                if (property.hasSignature()) {
                    nbttagcompound2.setString("Signature", property.getSignature());
                }
            }

            nbttagcompound1.set(s, nbttaglist);
        }

        nbttagcompound.set("Properties", nbttagcompound1);
    }

    return nbttagcompound;
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:38,代碼來源:GameProfileSerializer.java

示例3: writeGameProfile

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
/**
 * Writes a GameProfile to an NBTTagCompound.
 */
public static NBTTagCompound writeGameProfile(NBTTagCompound tagCompound, GameProfile profile)
{
    if (!StringUtils.isNullOrEmpty(profile.getName()))
    {
        tagCompound.setString("Name", profile.getName());
    }

    if (profile.getId() != null)
    {
        tagCompound.setString("Id", profile.getId().toString());
    }

    if (!profile.getProperties().isEmpty())
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();

        for (String s : profile.getProperties().keySet())
        {
            NBTTagList nbttaglist = new NBTTagList();

            for (Property property : profile.getProperties().get(s))
            {
                NBTTagCompound nbttagcompound1 = new NBTTagCompound();
                nbttagcompound1.setString("Value", property.getValue());

                if (property.hasSignature())
                {
                    nbttagcompound1.setString("Signature", property.getSignature());
                }

                nbttaglist.appendTag(nbttagcompound1);
            }

            nbttagcompound.setTag(s, nbttaglist);
        }

        tagCompound.setTag("Properties", nbttagcompound);
    }

    return tagCompound;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:45,代碼來源:NBTUtil.java

示例4: writePacketData

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeEnumValue(this.action);
    buf.writeVarIntToBuffer(this.players.size());

    for (S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata : this.players)
    {
        switch (this.action)
        {
            case ADD_PLAYER:
                buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());
                buf.writeString(s38packetplayerlistitem$addplayerdata.getProfile().getName());
                buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getProfile().getProperties().size());

                for (Property property : s38packetplayerlistitem$addplayerdata.getProfile().getProperties().values())
                {
                    buf.writeString(property.getName());
                    buf.writeString(property.getValue());

                    if (property.hasSignature())
                    {
                        buf.writeBoolean(true);
                        buf.writeString(property.getSignature());
                    }
                    else
                    {
                        buf.writeBoolean(false);
                    }
                }

                buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getGameMode().getID());
                buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getPing());

                if (s38packetplayerlistitem$addplayerdata.getDisplayName() == null)
                {
                    buf.writeBoolean(false);
                }
                else
                {
                    buf.writeBoolean(true);
                    buf.writeChatComponent(s38packetplayerlistitem$addplayerdata.getDisplayName());
                }

                break;

            case UPDATE_GAME_MODE:
                buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());
                buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getGameMode().getID());
                break;

            case UPDATE_LATENCY:
                buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());
                buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getPing());
                break;

            case UPDATE_DISPLAY_NAME:
                buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());

                if (s38packetplayerlistitem$addplayerdata.getDisplayName() == null)
                {
                    buf.writeBoolean(false);
                }
                else
                {
                    buf.writeBoolean(true);
                    buf.writeChatComponent(s38packetplayerlistitem$addplayerdata.getDisplayName());
                }

                break;

            case REMOVE_PLAYER:
                buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:79,代碼來源:S38PacketPlayerListItem.java

示例5: writePacketData

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeEnumValue(this.action);
    buf.writeVarIntToBuffer(this.players.size());

    for (SPacketPlayerListItem.AddPlayerData spacketplayerlistitem$addplayerdata : this.players)
    {
        switch (this.action)
        {
            case ADD_PLAYER:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
                buf.writeString(spacketplayerlistitem$addplayerdata.getProfile().getName());
                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getProfile().getProperties().size());

                for (Property property : spacketplayerlistitem$addplayerdata.getProfile().getProperties().values())
                {
                    buf.writeString(property.getName());
                    buf.writeString(property.getValue());

                    if (property.hasSignature())
                    {
                        buf.writeBoolean(true);
                        buf.writeString(property.getSignature());
                    }
                    else
                    {
                        buf.writeBoolean(false);
                    }
                }

                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getGameMode().getID());
                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getPing());

                if (spacketplayerlistitem$addplayerdata.getDisplayName() == null)
                {
                    buf.writeBoolean(false);
                }
                else
                {
                    buf.writeBoolean(true);
                    buf.writeTextComponent(spacketplayerlistitem$addplayerdata.getDisplayName());
                }

                break;

            case UPDATE_GAME_MODE:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getGameMode().getID());
                break;

            case UPDATE_LATENCY:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getPing());
                break;

            case UPDATE_DISPLAY_NAME:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());

                if (spacketplayerlistitem$addplayerdata.getDisplayName() == null)
                {
                    buf.writeBoolean(false);
                }
                else
                {
                    buf.writeBoolean(true);
                    buf.writeTextComponent(spacketplayerlistitem$addplayerdata.getDisplayName());
                }

                break;

            case REMOVE_PLAYER:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:79,代碼來源:SPacketPlayerListItem.java

示例6: writePacketData

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeEnumValue(this.action);
    buf.writeVarIntToBuffer(this.players.size());

    for (SPacketPlayerListItem.AddPlayerData spacketplayerlistitem$addplayerdata : this.players)
    {
        switch (this.action)
        {
            case ADD_PLAYER:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
                buf.writeString(spacketplayerlistitem$addplayerdata.getProfile().getName());
                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getProfile().getProperties().size());

                for (Property property : spacketplayerlistitem$addplayerdata.getProfile().getProperties().values())
                {
                    buf.writeString(property.getName());
                    buf.writeString(property.getValue());

                    if (property.hasSignature())
                    {
                        buf.writeBoolean(true);
                        buf.writeString(property.getSignature());
                    }
                    else
                    {
                        buf.writeBoolean(false);
                    }
                }

                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getGameMode().getID());
                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getPing());

                if (spacketplayerlistitem$addplayerdata.getDisplayName() == null)
                {
                    buf.writeBoolean(false);
                }
                else
                {
                    buf.writeBoolean(true);
                    buf.writeTextComponent(spacketplayerlistitem$addplayerdata.getDisplayName());
                }

                break;
            case UPDATE_GAME_MODE:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getGameMode().getID());
                break;
            case UPDATE_LATENCY:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
                buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getPing());
                break;
            case UPDATE_DISPLAY_NAME:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());

                if (spacketplayerlistitem$addplayerdata.getDisplayName() == null)
                {
                    buf.writeBoolean(false);
                }
                else
                {
                    buf.writeBoolean(true);
                    buf.writeTextComponent(spacketplayerlistitem$addplayerdata.getDisplayName());
                }

                break;
            case REMOVE_PLAYER:
                buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:75,代碼來源:SPacketPlayerListItem.java

示例7: func_152460_a

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
public static void func_152460_a(NBTTagCompound p_152460_0_, GameProfile p_152460_1_)
{
    if (!StringUtils.isNullOrEmpty(p_152460_1_.getName()))
    {
        p_152460_0_.setString("Name", p_152460_1_.getName());
    }

    if (p_152460_1_.getId() != null)
    {
        p_152460_0_.setString("Id", p_152460_1_.getId().toString());
    }

    if (!p_152460_1_.getProperties().isEmpty())
    {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        Iterator iterator = p_152460_1_.getProperties().keySet().iterator();

        while (iterator.hasNext())
        {
            String s = (String)iterator.next();
            NBTTagList nbttaglist = new NBTTagList();
            NBTTagCompound nbttagcompound2;

            for (Iterator iterator1 = p_152460_1_.getProperties().get(s).iterator(); iterator1.hasNext(); nbttaglist.appendTag(nbttagcompound2))
            {
                Property property = (Property)iterator1.next();
                nbttagcompound2 = new NBTTagCompound();
                nbttagcompound2.setString("Value", property.getValue());

                if (property.hasSignature())
                {
                    nbttagcompound2.setString("Signature", property.getSignature());
                }
            }

            nbttagcompound1.setTag(s, nbttaglist);
        }

        p_152460_0_.setTag("Properties", nbttagcompound1);
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:42,代碼來源:NBTUtil.java

示例8: b

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
public void b(PacketDataSerializer packetdataserializer) throws IOException {
    packetdataserializer.a((Enum) this.a);
    packetdataserializer.d(this.b.size());
    Iterator iterator = this.b.iterator();

    while (iterator.hasNext()) {
        PacketPlayOutPlayerInfo.PlayerInfoData packetplayoutplayerinfo_playerinfodata = (PacketPlayOutPlayerInfo.PlayerInfoData) iterator.next();

        switch (PacketPlayOutPlayerInfo.SyntheticClass_1.a[this.a.ordinal()]) {
        case 1:
            packetdataserializer.a(packetplayoutplayerinfo_playerinfodata.a().getId());
            packetdataserializer.a(packetplayoutplayerinfo_playerinfodata.a().getName());
            packetdataserializer.d(packetplayoutplayerinfo_playerinfodata.a().getProperties().size());
            Iterator iterator1 = packetplayoutplayerinfo_playerinfodata.a().getProperties().values().iterator();

            while (iterator1.hasNext()) {
                Property property = (Property) iterator1.next();

                packetdataserializer.a(property.getName());
                packetdataserializer.a(property.getValue());
                if (property.hasSignature()) {
                    packetdataserializer.writeBoolean(true);
                    packetdataserializer.a(property.getSignature());
                } else {
                    packetdataserializer.writeBoolean(false);
                }
            }

            packetdataserializer.d(packetplayoutplayerinfo_playerinfodata.c().getId());
            packetdataserializer.d(packetplayoutplayerinfo_playerinfodata.b());
            if (packetplayoutplayerinfo_playerinfodata.d() == null) {
                packetdataserializer.writeBoolean(false);
            } else {
                packetdataserializer.writeBoolean(true);
                packetdataserializer.a(packetplayoutplayerinfo_playerinfodata.d());
            }
            break;

        case 2:
            packetdataserializer.a(packetplayoutplayerinfo_playerinfodata.a().getId());
            packetdataserializer.d(packetplayoutplayerinfo_playerinfodata.c().getId());
            break;

        case 3:
            packetdataserializer.a(packetplayoutplayerinfo_playerinfodata.a().getId());
            packetdataserializer.d(packetplayoutplayerinfo_playerinfodata.b());
            break;

        case 4:
            packetdataserializer.a(packetplayoutplayerinfo_playerinfodata.a().getId());
            if (packetplayoutplayerinfo_playerinfodata.d() == null) {
                packetdataserializer.writeBoolean(false);
            } else {
                packetdataserializer.writeBoolean(true);
                packetdataserializer.a(packetplayoutplayerinfo_playerinfodata.d());
            }
            break;

        case 5:
            packetdataserializer.a(packetplayoutplayerinfo_playerinfodata.a().getId());
        }
    }

}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:65,代碼來源:PacketPlayOutPlayerInfo.java


注:本文中的com.mojang.authlib.properties.Property.hasSignature方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。