本文整理汇总了Java中cn.nukkit.entity.data.Skin类的典型用法代码示例。如果您正苦于以下问题:Java Skin类的具体用法?Java Skin怎么用?Java Skin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Skin类属于cn.nukkit.entity.data包,在下文中一共展示了Skin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initEntity
import cn.nukkit.entity.data.Skin; //导入依赖的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: decodeSkinData
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
private void decodeSkinData() {
JsonObject skinToken = decodeToken(new String(this.get(this.getLInt())));
String skinId = null;
if (skinToken.has("ClientRandomId")) this.clientId = skinToken.get("ClientRandomId").getAsLong();
if (skinToken.has("SkinId")) skinId = skinToken.get("SkinId").getAsString();
if (skinToken.has("SkinData")) {
this.skin = new Skin(skinToken.get("SkinData").getAsString(), skinId);
if (skinToken.has("CapeData"))
this.skin.setCape(this.skin.new Cape(Base64.getDecoder().decode(skinToken.get("CapeData").getAsString())));
}
if (skinToken.has("SkinGeometryName")) this.skinGeometryName = skinToken.get("SkinGeometryName").getAsString();
if (skinToken.has("SkinGeometry"))
this.skinGeometry = Base64.getDecoder().decode(skinToken.get("SkinGeometry").getAsString());
}
示例3: decodeSkinData
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
private void decodeSkinData() {
JsonObject skinToken = decodeToken(new String(bs.get(bs.getLInt())));
if (skinToken == null) return;
if (skinToken.has("ClientRandomId")) this.clientId = skinToken.get("ClientRandomId").getAsLong();
if (skinToken.has("ServerAddress")) this.serverAddress = skinToken.get("ServerAddress").getAsString();
if (skinToken.has("DeviceModel")) this.deviceModel = skinToken.get("DeviceModel").getAsString();
if (skinToken.has("DeviceOS")) this.deviceOS = skinToken.get("DeviceOS").getAsInt();
if (skinToken.has("GameVersion")) this.gameVersion = skinToken.get("GameVersion").getAsString();
if (skinToken.has("GuiScale")) this.guiScale = skinToken.get("GuiScale").getAsInt();
if (skinToken.has("LanguageCode")) this.languageCode = skinToken.get("LanguageCode").getAsString();
if (skinToken.has("CurrentInputMode")) this.currentInputMode = skinToken.get("CurrentInputMode").getAsInt();
if (skinToken.has("DefaultInputMode")) this.defaultInputMode = skinToken.get("DefaultInputMode").getAsInt();
if (skinToken.has("UIProfile")) this.UIProfile = skinToken.get("UIProfile").getAsInt();
byte[] capeData = new byte[]{};
String skinId = "";
String geometryName = "";
String geometryData = "";
byte[] skinData = new byte[]{};
if (skinToken.has("CapeData")) capeData = Base64.getDecoder().decode(skinToken.get("CapeData").getAsString());
if (skinToken.has("SkinId")) skinId = skinToken.get("SkinId").getAsString();
if (skinToken.has("SkinGeometryName")) geometryName = skinToken.get("SkinGeometryName").getAsString();
if (skinToken.has("SkinGeometry")) geometryData = new String(Base64.getDecoder().decode(skinToken.get("SkinGeometry").getAsString()), StandardCharsets.UTF_8);
if (skinToken.has("SkinData")) skinData = Base64.getDecoder().decode(skinToken.get("SkinData").getAsString());
this.skin = new Skin(skinId, skinData, capeData, geometryName, geometryData);
}
示例4: decodeSkinData
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
private void decodeSkinData() {
JsonObject skinToken = decodeToken(new String(this.get(this.getLInt())));
String skinId = null;
if (skinToken.has("ClientRandomId")) this.clientId = skinToken.get("ClientRandomId").getAsLong();
if (skinToken.has("ServerAddress")) this.serverAddress = skinToken.get("ServerAddress").getAsString();
if (skinToken.has("SkinId")) skinId = skinToken.get("SkinId").getAsString();
if (skinToken.has("SkinData")) this.skin = new Skin(skinToken.get("SkinData").getAsString(), skinId);
if (skinToken.has("DeviceModel")) this.deviceModel = skinToken.get("DeviceModel").getAsString();
if (skinToken.has("DeviceOS")) ; //TODO: add variables
if (skinToken.has("GameVersion")) ;
if (skinToken.has("GuiScale")) ;
if (skinToken.has("LanguageCode")) ;
if (skinToken.has("CurrentInputMode")) ;
if (skinToken.has("DefaultInputMode")) ;
if (skinToken.has("ADRole")) ;
}
示例5: decode
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
@Override
public void decode() {
this.uuid = this.getUUID();
String skinId = this.getString();
this.skinName = this.getString();
this.serializeName = this.getString();
byte[] data = this.getByteArray();
byte[] cape = this.getByteArray();
this.skin = new Skin(data, skinId);
this.skin.setCape(this.skin.new Cape(cape));
this.geometryModel = this.getString();
this.geometryData = this.getString();
}
示例6: Entry
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
public Entry(UUID uuid, long entityId, String name, Skin skin, String xboxUserId) {
this.uuid = uuid;
this.entityId = entityId;
this.name = name;
this.skin = skin;
this.capeData = skin.getCape().getData();
this.xboxUserId = xboxUserId == null ? "" : xboxUserId;
}
示例7: initEntity
import cn.nukkit.entity.data.Skin; //导入依赖的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);
}
}
示例8: decode
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
@Override
public void decode() {
this.uuid = this.getUUID();
String skinId = this.getString();
this.newSkinName = this.getString();
this.oldSkinName = this.getString();
byte[] skinData = this.getByteArray();
byte[] capeData = this.getByteArray();
String geometryModel = this.getString();
String geometryData = this.getString();
this.skin = new Skin(skinId, skinData, capeData, geometryModel, geometryData);
}
示例9: Entry
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
public Entry(UUID uuid, long entityId, String name, Skin skin, String xboxUserId) {
this.uuid = uuid;
this.entityId = entityId;
this.name = name;
this.skin = skin;
this.xboxUserId = xboxUserId == null ? "" : xboxUserId;
}
示例10: setSkin
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
/**
* プレイヤーのスキンを設定します。
* @param skin スキンデータ
* @return void
*/
@Override
public void setSkin(Skin skin) {
super.setSkin(skin);
if (this.spawned) {
this.server.updatePlayerListData(this.getUniqueId(), this.getId(), this.getDisplayName(), skin, this.getLoginChainData().getXUID());
}
}
示例11: initEntity
import cn.nukkit.entity.data.Skin; //导入依赖的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);
}
}
示例12: decodeSkinData
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
private void decodeSkinData() {
JsonObject skinToken = decodeToken(new String(this.get(this.getLInt())));
String skinId = null;
if (skinToken.has("ClientRandomId")) this.clientId = skinToken.get("ClientRandomId").getAsLong();
if (skinToken.has("SkinId")) skinId = skinToken.get("SkinId").getAsString();
if (skinToken.has("SkinData")) this.skin = new Skin(skinToken.get("SkinData").getAsString(), skinId);
}
示例13: decodeSkinData
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
private void decodeSkinData() {
JsonObject skinToken = decodeToken(new String(this.get(this.getLInt())));
String skinId = null;
if (skinToken.has("ClientRandomId")) this.clientId = skinToken.get("ClientRandomId").getAsLong();
if (skinToken.has("ServerAddress")) this.serverAddress = skinToken.get("ServerAddress").getAsString();
if (skinToken.has("SkinId")) skinId = skinToken.get("SkinId").getAsString();
if (skinToken.has("SkinData")) this.skin = new Skin(skinToken.get("SkinData").getAsString(), skinId);
}
示例14: Rino
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
public Rino(Main plugin, Location pos, String levelName, String username, String message, Item item, Skin skin){
this.plugin = plugin;
this.pos = pos;
this.eid = Entity.entityCount++;
this.levelName = levelName;
this.name = username;
this.message = message;
this.uuid = UUID.randomUUID();
this.item = item;
this.skin = skin;
}
示例15: fromObject
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
public static Rino fromObject(Main plugin, Object[] data) throws IOException{
FileInputStream fis = new FileInputStream(new File(new File(plugin.getDataFolder(), "skins"), (String) data[8]));
byte[] buffer = new byte[fis.available()];
fis.read(buffer);
fis.close();
return new Rino(plugin, new Position(
getDouble(data[0]), getDouble(data[1]), getDouble(data[2]), Server.getInstance().getLevelByName((String) data[3])
), (String) data[3], (String) data[4], (String) data[5], Item.get(getInteger(data[6]), getInteger(data[7])), new Skin(buffer, (String) data[9]));
}