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


Java NativeGameMode类代码示例

本文整理汇总了Java中com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode的典型用法代码示例。如果您正苦于以下问题:Java NativeGameMode类的具体用法?Java NativeGameMode怎么用?Java NativeGameMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NativeGameMode类属于com.comphenix.protocol.wrappers.EnumWrappers包,在下文中一共展示了NativeGameMode类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInfoWrapper

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
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;
}
 
开发者ID:TechzoneMC,项目名称:SimpleAntiAura,代码行数:11,代码来源:AuraCheck.java

示例2: createRespawnPacket

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
public static Object createRespawnPacket(int dimId, Difficulty difficulty, WorldType worldType, NativeGameMode gamemode) {
	PacketContainer container = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.RESPAWN);
	container.getIntegers().write(0, dimId);
	container.getDifficulties().write(0, difficulty);
	container.getWorldTypeModifier().write(0, worldType);
	container.getGameModes().write(0, gamemode);
	return container.getHandle();
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportAntiBot,代码行数:9,代码来源:Packets.java

示例3: createJoinGamePacket

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
public static Object createJoinGamePacket(int playerId, int maxPlayers) {
	PacketContainer container = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.LOGIN);
	container.getIntegers().write(0, playerId);
	container.getIntegers().write(2, maxPlayers);
	container.getGameModes().write(0, NativeGameMode.SURVIVAL);
	container.getWorldTypeModifier().write(0, WorldType.NORMAL);
	container.getDifficulties().write(0, Difficulty.EASY);
	return container.getHandle();
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportAntiBot,代码行数:10,代码来源:Packets.java

示例4: getPlayerInfoData

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
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));
}
 
开发者ID:thekeenant,项目名称:tabbed,代码行数:15,代码来源:SimpleTabList.java

示例5: getGameMode

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
/**
 * Retrieve the game mode of the current player.
 *
 * @return The current game mode
 */
public NativeGameMode getGameMode()
{
    return handle.getGameModes().read(0);
}
 
开发者ID:Ms-ran,项目名称:ItemPlus,代码行数:10,代码来源:WrapperPlayServerRespawn.java

示例6: setGameMode

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
/**
 * Set the game mode of the current player.
 *
 * @param mode - new value.
 */
public void setGameMode(NativeGameMode mode)
{
    handle.getGameModes().write(0, mode);
}
 
开发者ID:Ms-ran,项目名称:ItemPlus,代码行数:10,代码来源:WrapperPlayServerRespawn.java

示例7: getGamemode

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
/**
 * Retrieve the game mode of the initial world.
 *
 * @return The current gamemode.
 */
public NativeGameMode getGamemode()
{
    return handle.getGameModes().read(0);
}
 
开发者ID:Ms-ran,项目名称:ItemPlus,代码行数:10,代码来源:WrapperPlayServerLogin.java

示例8: setGamemode

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
/**
 * Set the game mode of the initial world.
 *
 * @param value - new value.
 */
public void setGamemode(NativeGameMode value)
{
    handle.getGameModes().write(0, value);
}
 
开发者ID:Ms-ran,项目名称:ItemPlus,代码行数:10,代码来源:WrapperPlayServerLogin.java

示例9: getGameMode

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
/**
 * Retrieve the game mode of the current player.
 * @return The current game mode
*/
public NativeGameMode getGameMode() {
    return handle.getGameModes().read(0);
}
 
开发者ID:aadnk,项目名称:PacketWrapper,代码行数:8,代码来源:WrapperPlayServerRespawn.java

示例10: setGameMode

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
/**
 * Set the game mode of the current player.
 * @param mode - new value.
*/
public void setGameMode(NativeGameMode mode) {
    handle.getGameModes().write(0, mode);
}
 
开发者ID:aadnk,项目名称:PacketWrapper,代码行数:8,代码来源:WrapperPlayServerRespawn.java

示例11: getGamemode

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
/**
 * Retrieve the game mode of the initial world.
 * @return The current gamemode.
*/
public NativeGameMode getGamemode() {
    return handle.getGameModes().read(0);
}
 
开发者ID:aadnk,项目名称:PacketWrapper,代码行数:8,代码来源:WrapperPlayServerLogin.java

示例12: setGamemode

import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; //导入依赖的package包/类
/**
 * Set the game mode of the initial world.
 * @param value - new value.
*/
public void setGamemode(NativeGameMode value) {
    handle.getGameModes().write(0, value);
}
 
开发者ID:aadnk,项目名称:PacketWrapper,代码行数:8,代码来源:WrapperPlayServerLogin.java


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