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


Java PropertyWrapper類代碼示例

本文整理匯總了Java中org.inventivetalent.mcwrapper.auth.properties.PropertyWrapper的典型用法代碼示例。如果您正苦於以下問題:Java PropertyWrapper類的具體用法?Java PropertyWrapper怎麽用?Java PropertyWrapper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PropertyWrapper類屬於org.inventivetalent.mcwrapper.auth.properties包,在下文中一共展示了PropertyWrapper類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setSkin

import org.inventivetalent.mcwrapper.auth.properties.PropertyWrapper; //導入依賴的package包/類
public void setSkin(final String skinOwner) {
	if (Bukkit.getPluginManager().isPluginEnabled("NickNamer")) {
		if (getPlugin() != null && getPlugin().isEnabled()) {
			Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), new Runnable() {
				@Override
				public void run() {
					GameProfileWrapper profile = SkinLoader.loadSkin(skinOwner);
					Collection<PropertyWrapper> values = profile.getProperties().values();
					if (values.isEmpty()) { return; }
					PropertyWrapper property = values.iterator().next();
					setSkinTexture(property.getValue(), property.getSignature());
				}
			});
		}
	}
}
 
開發者ID:InventivetalentDev,項目名稱:CompactNPCLib,代碼行數:17,代碼來源:NPCPlayer.java

示例2: createProfile

import org.inventivetalent.mcwrapper.auth.properties.PropertyWrapper; //導入依賴的package包/類
public static Object createProfile(String data) {
    try {
        GameProfileWrapper profileWrapper = new GameProfileWrapper(UUID.randomUUID(), "CustomBlock");
        PropertyWrapper propertyWrapper = new PropertyWrapper("textures", data);
        profileWrapper.getProperties().put("textures", propertyWrapper);

        return profileWrapper.getHandle();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
 
開發者ID:VoxelGamesLib,項目名稱:VoxelGamesLibv2,代碼行數:13,代碼來源:HeadTextureChanger.java

示例3: createProfile

import org.inventivetalent.mcwrapper.auth.properties.PropertyWrapper; //導入依賴的package包/類
public static Object createProfile(String data) {
	try {
		GameProfileWrapper profileWrapper = new GameProfileWrapper(UUID.randomUUID(), "CustomBlock");
		PropertyWrapper propertyWrapper = new PropertyWrapper("textures", data);
		profileWrapper.getProperties().put("textures", propertyWrapper);

		return profileWrapper.getHandle();
	} catch (Exception e) {
		e.printStackTrace();
	}
	return null;
}
 
開發者ID:InventivetalentDev,項目名稱:SoundMuffler,代碼行數:13,代碼來源:HeadTextureChanger.java

示例4: setSkinTexture

import org.inventivetalent.mcwrapper.auth.properties.PropertyWrapper; //導入依賴的package包/類
@NBT({
			 "npclib.options",
			 "player",
			 "skinTexture" })
@Override
public void setSkinTexture(@NBT(value = "value",
								type = TagID.TAG_STRING) String value, @NBT(value = "signature",
																			type = TagID.TAG_STRING) String signature) {
	this.skinTextureValue = value;
	this.skinTextureSignature = signature;

	GameProfileWrapper profile = getProfile();
	profile.getProperties().clear();
	profile.getProperties().put("textures", new PropertyWrapper("textures", value, signature));
	setProfile(profile);

	updateNearby();
	if (getPlugin() != null && getPlugin().isEnabled()) {
		// Give it some time to load the profile
		Bukkit.getScheduler().runTaskLater(getPlugin(), new Runnable() {
			@Override
			public void run() {
				updateNearby(32, new Predicate<Player>() {
					@Override
					public boolean apply(@Nullable Player player) {
						respawnTo(player);
						return true;
					}
				});
			}
		}, 20);
	}
}
 
開發者ID:InventivetalentDev,項目名稱:CompactNPCLib,代碼行數:34,代碼來源:NPCPlayer.java


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