本文整理匯總了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());
}
示例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();
}
}
示例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;
}