本文整理汇总了Java中com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode.SURVIVAL属性的典型用法代码示例。如果您正苦于以下问题:Java NativeGameMode.SURVIVAL属性的具体用法?Java NativeGameMode.SURVIVAL怎么用?Java NativeGameMode.SURVIVAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode
的用法示例。
在下文中一共展示了NativeGameMode.SURVIVAL属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInfoWrapper
public static WrapperPlayServerPlayerInfo getInfoWrapper(UUID playeruuid, PlayerInfoAction action) {
WrapperPlayServerPlayerInfo wrapper = new WrapperPlayServerPlayerInfo();
wrapper.setAction(action);
WrappedGameProfile profile = new WrappedGameProfile(playeruuid, NameGenerator.newName());
PlayerInfoData data = new PlayerInfoData(profile, 1, NativeGameMode.SURVIVAL, WrappedChatComponent.fromText(NameGenerator.newName()));
List<PlayerInfoData> listdata = new ArrayList<>();
listdata.add(data);
wrapper.setData(listdata);
return wrapper;
}
示例2: getPlayerInfoData
private PlayerInfoData getPlayerInfoData(WrappedGameProfile profile, int ping, String displayName) {
if (displayName != null) {
// min width
while (displayName.length() < this.minColumnWidth)
displayName += " ";
// max width
if (this.maxColumnWidth > 0)
while (displayName.length() > this.maxColumnWidth)
displayName = displayName.substring(0, displayName.length() - 1);
}
return new PlayerInfoData(profile, ping, NativeGameMode.SURVIVAL, displayName == null ? null : WrappedChatComponent.fromText(displayName));
}