本文整理汇总了Java中protocolsupport.api.events.PlayerPropertiesResolveEvent.ProfileProperty.hasSignature方法的典型用法代码示例。如果您正苦于以下问题:Java ProfileProperty.hasSignature方法的具体用法?Java ProfileProperty.hasSignature怎么用?Java ProfileProperty.hasSignature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protocolsupport.api.events.PlayerPropertiesResolveEvent.ProfileProperty
的用法示例。
在下文中一共展示了ProfileProperty.hasSignature方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serialize
import protocolsupport.api.events.PlayerPropertiesResolveEvent.ProfileProperty; //导入方法依赖的package包/类
public static NBTTagCompoundWrapper serialize(GameProfile gameProfile) {
NBTTagCompoundWrapper tag = ServerPlatform.get().getWrapperFactory().createEmptyNBTCompound();
if (!StringUtils.isEmpty(gameProfile.getName())) {
tag.setString(NAME_KEY, gameProfile.getName());
}
if (gameProfile.getUUID() != null) {
tag.setString(UUID_KEY, gameProfile.getUUID().toString());
}
if (!gameProfile.getProperties().isEmpty()) {
NBTTagCompoundWrapper propertiesTag = ServerPlatform.get().getWrapperFactory().createEmptyNBTCompound();
for (Entry<String, ProfileProperty> entry : gameProfile.getProperties().entrySet()) {
NBTTagListWrapper propertiesListTag = ServerPlatform.get().getWrapperFactory().createEmptyNBTList();
ProfileProperty property = entry.getValue();
NBTTagCompoundWrapper propertyTag = ServerPlatform.get().getWrapperFactory().createEmptyNBTCompound();
propertyTag.setString(PROPERTY_VALUE_KEY, property.getValue());
if (property.hasSignature()) {
propertyTag.setString(PROPERTY_SIGNATURE_KEY, property.getSignature());
}
propertiesListTag.addCompound(propertyTag);
propertiesTag.setList(entry.getKey(), propertiesListTag);
}
tag.setCompound(PROPERTIES_KEY, propertiesTag);
}
return tag;
}
示例2: add
import protocolsupport.api.events.PlayerPropertiesResolveEvent.ProfileProperty; //导入方法依赖的package包/类
public void add(ProfileProperty property) {
if (property.hasSignature()) {
signed.put(property.getName(), property);
} else {
unsigned.put(property.getName(), property);
}
}
示例3: toData
import protocolsupport.api.events.PlayerPropertiesResolveEvent.ProfileProperty; //导入方法依赖的package包/类
@Override
public RecyclableCollection<ClientBoundPacketData> toData() {
ProtocolVersion version = connection.getVersion();
ClientBoundPacketData serializer = ClientBoundPacketData.create(ClientBoundPacket.PLAY_PLAYER_INFO_ID, version);
VarNumberSerializer.writeVarInt(serializer, action.ordinal());
VarNumberSerializer.writeVarInt(serializer, infos.length);
for (Info info : infos) {
MiscSerializer.writeUUID(serializer, info.uuid);
switch (action) {
case ADD: {
StringSerializer.writeString(serializer, version, info.username);
VarNumberSerializer.writeVarInt(serializer, info.properties.length);
for (ProfileProperty property : info.properties) {
StringSerializer.writeString(serializer, version, property.getName());
StringSerializer.writeString(serializer, version, property.getValue());
serializer.writeBoolean(property.hasSignature());
if (property.hasSignature()) {
StringSerializer.writeString(serializer, version, property.getSignature());
}
}
VarNumberSerializer.writeVarInt(serializer, info.gamemode.getId());
VarNumberSerializer.writeVarInt(serializer, info.ping);
serializer.writeBoolean(info.displayNameJson != null);
if (info.displayNameJson != null) {
StringSerializer.writeString(serializer, version, info.displayNameJson);
}
break;
}
case GAMEMODE: {
VarNumberSerializer.writeVarInt(serializer, info.gamemode.getId());
break;
}
case PING: {
VarNumberSerializer.writeVarInt(serializer, info.ping);
break;
}
case DISPLAY_NAME: {
serializer.writeBoolean(info.displayNameJson != null);
if (info.displayNameJson != null) {
StringSerializer.writeString(serializer, version, info.displayNameJson);
}
break;
}
case REMOVE: {
break;
}
}
}
return RecyclableSingletonList.create(serializer);
}