本文整理汇总了Java中com.comphenix.protocol.wrappers.WrappedSignedProperty类的典型用法代码示例。如果您正苦于以下问题:Java WrappedSignedProperty类的具体用法?Java WrappedSignedProperty怎么用?Java WrappedSignedProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WrappedSignedProperty类属于com.comphenix.protocol.wrappers包,在下文中一共展示了WrappedSignedProperty类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: spawnPlayer
import com.comphenix.protocol.wrappers.WrappedSignedProperty; //导入依赖的package包/类
public FakeMob spawnPlayer(Location loc, String name, Multimap<String, WrappedSignedProperty> skin) {
int id = this.getNewId();
FakeMob mob = new FakeMob(id, loc, EntityType.PLAYER);
mob.setCustomName(name);
mob.setPlayerSkin(skin);
SpawnFakeMobEvent event = new SpawnFakeMobEvent(loc, EntityType.PLAYER, mob);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) return null;
for (Player player : loc.getWorld().getPlayers()) {
if (mob.isInRange(player)) {
mob.loadPlayer(player);
}
}
this.mobs.put(id, mob);
this.saveMobsFile();
return mob;
}
示例2: createSkullItemStack
import com.comphenix.protocol.wrappers.WrappedSignedProperty; //导入依赖的package包/类
public static ItemStack createSkullItemStack(String uuid, String textureValue, String textureSignature) {
WrappedGameProfile wrappedProfile = new WrappedGameProfile(UUID.fromString(uuid), null);
wrappedProfile.getProperties().put("textures", new WrappedSignedProperty("textures", textureValue, textureSignature));
ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
SkullMeta sm = (SkullMeta) skull.getItemMeta();
Field profileField = null;
try {
profileField = sm.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(sm, wrappedProfile.getHandle());
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e1) {
e1.printStackTrace();
}
skull.setItemMeta(sm);
return skull;
}
示例3: fromGameProfile
import com.comphenix.protocol.wrappers.WrappedSignedProperty; //导入依赖的package包/类
public static Skin fromGameProfile(WrappedGameProfile gameProfile) {
WrappedSignedProperty[] wrappedSignedProperties = gameProfile.getProperties().get(MULTIMAP_KEY).toArray(new WrappedSignedProperty[0]);
if (wrappedSignedProperties.length == 0) {
return Skin.EMPTY;
} else {
return fromWrappedSignedProperty(wrappedSignedProperties[0]);
}
}
示例4: getPlayer
import com.comphenix.protocol.wrappers.WrappedSignedProperty; //导入依赖的package包/类
/**
* Get a skin from an online player.
* @param player
* @return
*/
public static Skin getPlayer(Player player) {
WrappedSignedProperty property = DEFAULT_SKIN.getProperty();
Collection<WrappedSignedProperty> properties = WrappedGameProfile.fromPlayer(player).getProperties().get("textures");
if (properties != null && properties.size() > 0)
property = properties.iterator().next();
return new Skin(property);
}
示例5: toWrappedSignedProperty
import com.comphenix.protocol.wrappers.WrappedSignedProperty; //导入依赖的package包/类
public WrappedSignedProperty toWrappedSignedProperty() {
return new WrappedSignedProperty("textures", value, signature);
}
示例6: fromWrappedSignedProperty
import com.comphenix.protocol.wrappers.WrappedSignedProperty; //导入依赖的package包/类
public static Skin fromWrappedSignedProperty(WrappedSignedProperty wrappedSignedProperty) {
return new Skin(wrappedSignedProperty.getValue(), wrappedSignedProperty.getSignature());
}
示例7: Skin
import com.comphenix.protocol.wrappers.WrappedSignedProperty; //导入依赖的package包/类
public Skin(String value, String signature) {
this(new WrappedSignedProperty("textures", value, signature));
}
示例8: getPlayerSkin
import com.comphenix.protocol.wrappers.WrappedSignedProperty; //导入依赖的package包/类
public Multimap<String, WrappedSignedProperty> getPlayerSkin() {
return this.playerSkin;
}
示例9: setPlayerSkin
import com.comphenix.protocol.wrappers.WrappedSignedProperty; //导入依赖的package包/类
public void setPlayerSkin(Multimap<String, WrappedSignedProperty> skin) {
this.playerSkin = skin;
}