当前位置: 首页>>代码示例>>Java>>正文


Java Skin类代码示例

本文整理汇总了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);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:11,代码来源:XMLUtils.java

示例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);
    });
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:13,代码来源:ItemConfigurationParser.java

示例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;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:12,代码来源:NMSHacks.java

示例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());
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:9,代码来源:SkinCommands.java

示例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));
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:10,代码来源:SkinCommands.java

示例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);
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:13,代码来源:PlayerAppearanceChanger.java

示例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;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:6,代码来源:NMSHacks.java

示例8: getSkin

import org.bukkit.Skin; //导入依赖的package包/类
@Override
public @Nullable Skin getSkin(TabView view) {
    return DEFAULT_SKIN;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:SimpleTabEntry.java

示例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();
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:6,代码来源:PlayerTabEntry.java

示例10: onPlayerChangeSkinParts

import org.bukkit.Skin; //导入依赖的package包/类
@EventHandler
public void onPlayerChangeSkinParts(PlayerSkinPartsChangeEvent event) {
    getPlayer(event.getPlayer()).setHat(event.getPlayer().getSkinParts().contains(Skin.Part.HAT));
}
 
开发者ID:twizmwazin,项目名称:CardinalPGM,代码行数:5,代码来源:TabList.java

示例11: getSkin

import org.bukkit.Skin; //导入依赖的package包/类
/**
 * Skin for the entry's icon
 */
@Nullable Skin getSkin(TabView view);
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:TabEntry.java


注:本文中的org.bukkit.Skin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。