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


Java Utils.dataToUUID方法代码示例

本文整理汇总了Java中cn.nukkit.utils.Utils.dataToUUID方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.dataToUUID方法的具体用法?Java Utils.dataToUUID怎么用?Java Utils.dataToUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cn.nukkit.utils.Utils的用法示例。


在下文中一共展示了Utils.dataToUUID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initEntity

import cn.nukkit.utils.Utils; //导入方法依赖的package包/类
@Override
protected void initEntity() {
    this.setDataFlag(DATA_PLAYER_FLAGS, DATA_PLAYER_FLAG_SLEEP, false);
    this.setDataFlag(DATA_FLAGS, DATA_FLAG_GRAVITY);

    this.setDataProperty(new IntPositionEntityData(DATA_PLAYER_BED_POSITION, 0, 0, 0), false);

    if (!(this instanceof Player)) {
        if (this.namedTag.contains("NameTag")) {
            this.setNameTag(this.namedTag.getString("NameTag"));
        }

        if (this.namedTag.contains("Skin") && this.namedTag.get("Skin") instanceof CompoundTag) {
            if (!this.namedTag.getCompound("Skin").contains("Transparent")) {
                this.namedTag.getCompound("Skin").putBoolean("Transparent", false);
            }
            this.setSkin(new Skin(this.namedTag.getCompound("Skin").getByteArray("Data"), this.namedTag.getCompound("Skin").getString("ModelId")));
        }

        this.uuid = Utils.dataToUUID(String.valueOf(this.getId()).getBytes(StandardCharsets.UTF_8), this.getSkin()
                .getData(), this.getNameTag().getBytes(StandardCharsets.UTF_8));
    }

    super.initEntity();
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:26,代码来源:EntityHuman.java

示例2: initEntity

import cn.nukkit.utils.Utils; //导入方法依赖的package包/类
@Override
protected void initEntity() {
    this.setDataFlag(DATA_PLAYER_FLAGS, DATA_PLAYER_FLAG_SLEEP, false);
    this.setDataFlag(DATA_FLAGS, DATA_FLAG_GRAVITY);

    this.setDataProperty(new IntPositionEntityData(DATA_PLAYER_BED_POSITION, 0, 0, 0), false);

    if (!(this instanceof Player)) {
        if (this.namedTag.contains("NameTag")) {
            this.setNameTag(this.namedTag.getString("NameTag"));
        }

        if (this.namedTag.contains("Skin") && this.namedTag.get("Skin") instanceof CompoundTag) {
            if (!this.namedTag.getCompound("Skin").contains("Transparent")) {
                this.namedTag.getCompound("Skin").putBoolean("Transparent", false);
            }
            this.setSkin(new Skin(
                    this.namedTag.getCompound("Skin").getString("skinId"),
                    this.namedTag.getCompound("Skin").getByteArray("skinData"),
                    this.namedTag.getCompound("Skin").getCompound("capeData").getByteArray("capeData"),
                    this.namedTag.getCompound("Skin").getString("geometryName"),
                    this.namedTag.getCompound("Skin").getCompound("geometryData").getString("geometryData")
            ));
        }

        this.uuid = Utils.dataToUUID(String.valueOf(this.getId()).getBytes(StandardCharsets.UTF_8), this.getSkin()
                .getSkinData(), this.getNameTag().getBytes(StandardCharsets.UTF_8));
    }

    super.initEntity();

    if (this instanceof Player) {
        ((Player) this).addWindow(this.inventory, 0);
    }
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:36,代码来源:EntityHuman.java

示例3: initEntity

import cn.nukkit.utils.Utils; //导入方法依赖的package包/类
@Override
protected void initEntity() {
    this.setDataFlag(DATA_PLAYER_FLAGS, DATA_PLAYER_FLAG_SLEEP, false);

    this.setDataProperty(new IntPositionEntityData(DATA_PLAYER_BED_POSITION, 0, 0, 0), false);

    if (!(this instanceof Player)) {
        if (this.namedTag.contains("NameTag")) {
            this.setNameTag(this.namedTag.getString("NameTag"));
        }

        if (this.namedTag.contains("Skin") && this.namedTag.get("Skin") instanceof CompoundTag) {
            if (!this.namedTag.getCompound("Skin").contains("Transparent")) {
                this.namedTag.getCompound("Skin").putBoolean("Transparent", false);
            }
            this.setSkin(new Skin(this.namedTag.getCompound("Skin").getByteArray("Data"), this.namedTag.getCompound("Skin").getString("ModelId")));
        }

        this.uuid = Utils.dataToUUID(String.valueOf(this.getId()).getBytes(StandardCharsets.UTF_8), this.getSkin()
                .getData(), this.getNameTag().getBytes(StandardCharsets.UTF_8));
    }

    super.initEntity();

    if (this instanceof Player) {
        ((Player) this).addWindow(this.inventory, 0);
    }
}
 
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:29,代码来源:EntityHuman.java

示例4: initEntity

import cn.nukkit.utils.Utils; //导入方法依赖的package包/类
@Override
protected void initEntity() {
    this.setDataFlag(DATA_PLAYER_FLAGS, DATA_PLAYER_FLAG_SLEEP, false);

    this.setDataProperty(new PositionEntityData(DATA_PLAYER_BED_POSITION, 0, 0, 0), false);

    this.inventory = new PlayerInventory(this);
    if (this instanceof Player) {
        ((Player) this).addWindow(this.inventory, 0);
    }

    if (!(this instanceof Player)) {
        if (this.namedTag.contains("NameTag")) {
            this.setNameTag(this.namedTag.getString("NameTag"));
        }

        if (this.namedTag.contains("Skin") && this.namedTag.get("Skin") instanceof CompoundTag) {
            if (!this.namedTag.getCompound("Skin").contains("Transparent")) {
                this.namedTag.getCompound("Skin").putBoolean("Transparent", false);
            }
            this.setSkin(new Skin(this.namedTag.getCompound("Skin").getByteArray("Data"), this.namedTag.getCompound("Skin").getString("ModelId")));
        }

        this.uuid = Utils.dataToUUID(String.valueOf(this.getId()).getBytes(StandardCharsets.UTF_8), this.getSkin()
                .getData(), this.getNameTag().getBytes(StandardCharsets.UTF_8));
    }

    if (this.namedTag.contains("Inventory") && this.namedTag.get("Inventory") instanceof ListTag) {
        ListTag<CompoundTag> inventoryList = this.namedTag.getList("Inventory", CompoundTag.class);
        for (CompoundTag item : inventoryList.getAll()) {
            int slot = item.getByte("Slot");
            if (slot >= 0 && slot < 9) {
                this.inventory.setHotbarSlotIndex(slot, item.contains("TrueSlot") ? item.getByte("TrueSlot") : -1);
            } else if (slot >= 100 && slot < 104) {
                this.inventory.setItem(this.inventory.getSize() + slot - 100, NBTIO.getItemHelper(item));
            } else {
                this.inventory.setItem(slot - 9, NBTIO.getItemHelper(item));
            }
        }
    }

    super.initEntity();
}
 
开发者ID:Creeperface01,项目名称:NukkitGT,代码行数:44,代码来源:EntityHuman.java


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