本文整理汇总了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();
}
示例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);
}
}
示例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);
}
}
示例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();
}