本文整理汇总了Java中org.bukkit.Skin类的典型用法代码示例。如果您正苦于以下问题:Java Skin类的具体用法?Java Skin怎么用?Java Skin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Skin类属于org.bukkit包,在下文中一共展示了Skin类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseUnsignedSkin
import org.bukkit.Skin; //导入依赖的package包/类
public static Skin parseUnsignedSkin(@Nullable Node node) throws InvalidXMLException {
if(node == null) return null;
String data = node.getValueNormalize();
try {
Base64.decodeBase64(data.getBytes());
} catch(IllegalArgumentException e) {
throw new InvalidXMLException("Skin data is not valid base64", node);
}
return new Skin(data, null);
}
示例2: needSkin
import org.bukkit.Skin; //导入依赖的package包/类
public Skin needSkin(String text) {
return MapUtils.computeIfAbsent(skins, text, t -> {
final ConfigurationSection skinSection = root.getConfigurationSection("skins");
if(skinSection != null) {
final String referenced = skinSection.getString(text);
if(referenced != null && !referenced.equals(text)) {
return needSkin(referenced);
}
}
return new Skin(text, null);
});
}
示例3: playerListPacketData
import org.bukkit.Skin; //导入依赖的package包/类
public static PacketPlayOutPlayerInfo.PlayerInfoData playerListPacketData(PacketPlayOutPlayerInfo packet, UUID uuid, String name, @Nullable BaseComponent displayName, GameMode gamemode, int ping, @Nullable Skin skin) {
GameProfile profile = new GameProfile(uuid, name);
if(skin != null) {
for(Map.Entry<String, Collection<Property>> entry : Skins.toProperties(skin).asMap().entrySet()) {
profile.getProperties().putAll(entry.getKey(), entry.getValue());
}
}
PacketPlayOutPlayerInfo.PlayerInfoData data = packet.new PlayerInfoData(profile, ping, gamemode == null ? null : EnumGamemode.getById(gamemode.getValue()), null);
data.displayName = displayName == null ? null : new BaseComponent[]{ displayName };
return data;
}
示例4: info
import org.bukkit.Skin; //导入依赖的package包/类
@Command(aliases = {"info"},
desc = "Dump the encoded data for a player's skin",
usage = "[player]")
public void info(CommandContext args, CommandSender sender) throws CommandException {
Skin skin = CommandUtils.getPlayerOrSelf(args, sender, 0).getSkin();
sender.sendMessage(ChatColor.BLUE + "Textures: " + ChatColor.WHITE + skin.getData());
sender.sendMessage(ChatColor.BLUE + "Signature: " + ChatColor.WHITE + skin.getSignature());
}
示例5: none
import org.bukkit.Skin; //导入依赖的package包/类
@Command(aliases = {"none"},
desc = "Clear a player's skin, making them steve/alex",
usage = "[player]")
public void none(CommandContext args, CommandSender sender) throws CommandException {
Player player = CommandUtils.getPlayerOrSelf(args, sender, 0);
player.setSkin(Skin.EMPTY);
sender.sendMessage(ChatColor.WHITE + "Cleared the skin of " + player.getDisplayName(sender));
}
示例6: refreshFakeNameAndSkin
import org.bukkit.Skin; //导入依赖的package包/类
/**
* Refresh the given player's fake appearance for the given viewer, assuming the given identity
*/
private void refreshFakeNameAndSkin(Player player, Identity identity, @Nullable String fakeDisplayName, Player viewer) {
if(identity.isRevealed(viewer)) {
player.setFakeNameAndSkin(viewer, null, null);
player.setFakeDisplayName(viewer, null);
} else {
player.setFakeNameAndSkin(viewer, identity.getNickname(), Skin.EMPTY);
player.setFakeDisplayName(viewer, fakeDisplayName);
}
}
示例7: playerListAddPacket
import org.bukkit.Skin; //导入依赖的package包/类
public static Packet playerListAddPacket(UUID uuid, String name, @Nullable BaseComponent displayName, GameMode gamemode, int ping, @Nullable Skin skin) {
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER);
packet.add(playerListPacketData(packet, uuid, name, displayName, gamemode, ping, skin));
return packet;
}
示例8: getSkin
import org.bukkit.Skin; //导入依赖的package包/类
@Override
public @Nullable Skin getSkin(TabView view) {
return DEFAULT_SKIN;
}
示例9: getSkin
import org.bukkit.Skin; //导入依赖的package包/类
@Override
public @Nullable Skin getSkin(TabView view) {
final Identity identity = identityProvider.currentIdentity(player);
return identity.isDisguised(view.getViewer()) ? null : player.getSkin();
}
示例10: onPlayerChangeSkinParts
import org.bukkit.Skin; //导入依赖的package包/类
@EventHandler
public void onPlayerChangeSkinParts(PlayerSkinPartsChangeEvent event) {
getPlayer(event.getPlayer()).setHat(event.getPlayer().getSkinParts().contains(Skin.Part.HAT));
}
示例11: getSkin
import org.bukkit.Skin; //导入依赖的package包/类
/**
* Skin for the entry's icon
*/
@Nullable Skin getSkin(TabView view);