本文整理汇总了Java中cn.nukkit.entity.data.Skin类的典型用法代码示例。如果您正苦于以下问题:Java Skin类的具体用法?Java Skin怎么用?Java Skin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Skin类属于cn.nukkit.entity.data包,在下文中一共展示了Skin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:26,代码来源:EntityHuman.java
示例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());
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:17,代码来源:LoginPacket.java
示例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);
}
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:26,代码来源:ClientChainData.java
示例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")) ;
}
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:17,代码来源:LoginPacket.java
示例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();
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:16,代码来源:PlayerSkinPacket.java
示例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;
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:9,代码来源:PlayerListPacket.java
示例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);
}
}
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:36,代码来源:EntityHuman.java
示例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);
}
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:14,代码来源:PlayerSkinPacket.java
示例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;
}
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:8,代码来源:PlayerListPacket.java
示例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());
}
}
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:13,代码来源:Player.java
示例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);
}
}
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:29,代码来源:EntityHuman.java
示例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);
}
开发者ID:CoreXDevelopment,项目名称:CoreX,代码行数:8,代码来源:LoginPacket.java
示例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);
}
开发者ID:Creeperface01,项目名称:NukkitGT,代码行数:9,代码来源:LoginPacket.java
示例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;
}
开发者ID:onebone,项目名称:Rino,代码行数:13,代码来源:Rino.java
示例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]));
}
开发者ID:onebone,项目名称:Rino,代码行数:11,代码来源:Rino.java
示例16: getSkin
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
public Skin getSkin() {
return skin;
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:4,代码来源:EntityHuman.java
示例17: setSkin
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
public void setSkin(Skin skin) {
this.skin = skin;
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:4,代码来源:EntityHuman.java
示例18: getSkin
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
@Override
public Skin getSkin() {
return this.skin;
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:LoginPacket.java
示例19: updatePlayerListData
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
public void updatePlayerListData(UUID uuid, long entityId, String name, Skin skin) {
this.updatePlayerListData(uuid, entityId, name, skin, "", this.playerList.values());
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:4,代码来源:Server.java
示例20: putSkin
import cn.nukkit.entity.data.Skin; //导入依赖的package包/类
public void putSkin(Skin skin) {
this.putString(skin.getModel());
this.putByteArray(skin.getData());
}
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:BinaryStream.java
注:本文中的cn.nukkit.entity.data.Skin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论