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


Java ProfileProperty.hasSignature方法代码示例

本文整理汇总了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;
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupport,代码行数:26,代码来源:GameProfileSerializer.java

示例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);
	}
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupport,代码行数:8,代码来源:NetworkDataCache.java

示例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);
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupport,代码行数:51,代码来源:PlayerInfo.java


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