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


Java Property.getValue方法代碼示例

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


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

示例1: fromHandle

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
@SuppressWarnings("ConstantConditions")
public static PropertyWrapper fromHandle(Object object) {
    Validate.isTrue(object instanceof Property, "object " + object + " is not a Property");
    Property property = (Property) object;
    return new PropertyWrapper(property.getName(), property.getValue(), property.getSignature());
}
 
開發者ID:Alvin-LB,項目名稱:NameTagChanger,代碼行數:7,代碼來源:GameProfileWrapper.java

示例2: TwitchStream

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
public TwitchStream(Minecraft mcIn, final Property streamProperty)
{
    this.mc = mcIn;
    this.broadcastController = new BroadcastController();
    this.chatController = new ChatController();
    this.broadcastController.func_152841_a(this);
    this.chatController.func_152990_a(this);
    this.broadcastController.func_152842_a("nmt37qblda36pvonovdkbopzfzw3wlq");
    this.chatController.func_152984_a("nmt37qblda36pvonovdkbopzfzw3wlq");
    this.twitchComponent.getChatStyle().setColor(EnumChatFormatting.DARK_PURPLE);

    if (streamProperty != null && !Strings.isNullOrEmpty(streamProperty.getValue()) && OpenGlHelper.framebufferSupported)
    {
        Thread thread = new Thread("Twitch authenticator")
        {
            public void run()
            {
                try
                {
                    URL url = new URL("https://api.twitch.tv/kraken?oauth_token=" + URLEncoder.encode(streamProperty.getValue(), "UTF-8"));
                    String s = HttpUtil.get(url);
                    JsonObject jsonobject = JsonUtils.getJsonObject((new JsonParser()).parse(s), "Response");
                    JsonObject jsonobject1 = JsonUtils.getJsonObject(jsonobject, "token");

                    if (JsonUtils.getBoolean(jsonobject1, "valid"))
                    {
                        String s1 = JsonUtils.getString(jsonobject1, "user_name");
                        TwitchStream.LOGGER.debug(TwitchStream.STREAM_MARKER, "Authenticated with twitch; username is {}", new Object[] {s1});
                        AuthToken authtoken = new AuthToken();
                        authtoken.data = streamProperty.getValue();
                        TwitchStream.this.broadcastController.func_152818_a(s1, authtoken);
                        TwitchStream.this.chatController.func_152998_c(s1);
                        TwitchStream.this.chatController.func_152994_a(authtoken);
                        Runtime.getRuntime().addShutdownHook(new Thread("Twitch shutdown hook")
                        {
                            public void run()
                            {
                                TwitchStream.this.shutdownStream();
                            }
                        });
                        TwitchStream.this.broadcastController.func_152817_A();
                        TwitchStream.this.chatController.func_175984_n();
                    }
                    else
                    {
                        TwitchStream.this.authFailureReason = IStream.AuthFailureReason.INVALID_TOKEN;
                        TwitchStream.LOGGER.error(TwitchStream.STREAM_MARKER, "Given twitch access token is invalid");
                    }
                }
                catch (IOException ioexception)
                {
                    TwitchStream.this.authFailureReason = IStream.AuthFailureReason.ERROR;
                    TwitchStream.LOGGER.error(TwitchStream.STREAM_MARKER, (String)"Could not authenticate with twitch", (Throwable)ioexception);
                }
            }
        };
        thread.setDaemon(true);
        thread.start();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:61,代碼來源:TwitchStream.java

示例3: getPlayerSkin

import com.mojang.authlib.properties.Property; //導入方法依賴的package包/類
private static Property getPlayerSkin(GameProfile profile) {
    for (Property property : profile.getProperties().get("textures")) {
        return new Property("textures", property.getValue(), property.getSignature());
    }
    return DEFAULT_PROPERTY;
}
 
開發者ID:twizmwazin,項目名稱:CardinalPGM,代碼行數:7,代碼來源:PlayerTabEntry.java


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