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


Java PacketBuffer.readBoolean方法代码示例

本文整理汇总了Java中io.gomint.jraknet.PacketBuffer.readBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java PacketBuffer.readBoolean方法的具体用法?Java PacketBuffer.readBoolean怎么用?Java PacketBuffer.readBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.gomint.jraknet.PacketBuffer的用法示例。


在下文中一共展示了PacketBuffer.readBoolean方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deserialize

import io.gomint.jraknet.PacketBuffer; //导入方法依赖的package包/类
@Override
public void deserialize( PacketBuffer buffer ) {
    this.seed = buffer.readInt();
    this.dimension = buffer.readByte();
    this.generator = buffer.readInt();
    this.gamemode = buffer.readInt();
    this.entityId = buffer.readLong();
    this.spawnX = buffer.readInt();
    this.spawnY = buffer.readInt();
    this.spawnZ = buffer.readInt();
    this.x = buffer.readFloat();
    this.y = buffer.readFloat();
    this.z = buffer.readFloat();
    this.allowCheats = buffer.readBoolean();
    buffer.skip( 2 );
}
 
开发者ID:GoMint,项目名称:GoMint,代码行数:17,代码来源:PacketWorldInitialization.java

示例2: deserialize

import io.gomint.jraknet.PacketBuffer; //导入方法依赖的package包/类
@Override
public void deserialize( PacketBuffer buffer ) {
    this.selectedHotbarSlot = buffer.readUnsignedVarInt();
    this.windowId = buffer.readByte();

    this.slots = new int[buffer.readUnsignedVarInt()];
    for ( int i = 0; i < this.slots.length; i++ ) {
        this.slots[i] = buffer.readUnsignedVarInt();
    }

    this.selectHotbarSlot = buffer.readBoolean();
}
 
开发者ID:GoMint,项目名称:GoMint,代码行数:13,代码来源:PacketHotbar.java

示例3: deserialize

import io.gomint.jraknet.PacketBuffer; //导入方法依赖的package包/类
@Override
public void deserialize( PacketBuffer buffer ) {
    this.type = Type.getById( buffer.readByte() );
    buffer.readBoolean();
    switch ( this.type ) {
        case CLIENT_MESSAGE:
        case TIP_MESSAGE:
        case SYSTEM_MESSAGE:
            this.message = buffer.readString();
            break;

        case PLAYER_CHAT:
            this.sender = buffer.readString();
            this.message = buffer.readString();
            this.xuid = buffer.readString();
            break;

        case LOCALIZABLE_MESSAGE:
            this.message = buffer.readString();
            byte count = buffer.readByte();
            this.arguments = new String[count];
            for ( byte i = 0; i < count; ++i ) {
                this.arguments[i] = buffer.readString();
            }

            break;

        case POPUP_NOTICE:
            this.message = buffer.readString();
            this.sender = buffer.readString();
            break;
    }
}
 
开发者ID:GoMint,项目名称:GoMint,代码行数:34,代码来源:PacketText.java

示例4: deserialize

import io.gomint.jraknet.PacketBuffer; //导入方法依赖的package包/类
@Override
public void deserialize( PacketBuffer buffer ) {
    this.entityId = buffer.readUnsignedVarLong();
    this.x = buffer.readLFloat();
    this.y = buffer.readLFloat();
    this.z = buffer.readLFloat();
    this.pitch = buffer.readLFloat();
    this.headYaw = buffer.readLFloat();
    this.yaw = buffer.readLFloat();
    this.mode = buffer.readByte();
    this.onGround = buffer.readBoolean();
    this.ridingEntityId = buffer.readUnsignedVarLong();
}
 
开发者ID:GoMint,项目名称:GoMint,代码行数:14,代码来源:PacketMovePlayer.java

示例5: deserialize

import io.gomint.jraknet.PacketBuffer; //导入方法依赖的package包/类
@Override
public void deserialize( PacketBuffer buffer ) {
    this.type = SoundMagicNumbers.valueOf( buffer.readByte() );
    this.position = new Vector( buffer.readLFloat(), buffer.readLFloat(), buffer.readLFloat() );
    this.extraData = buffer.readSignedVarInt();
    this.pitch = buffer.readSignedVarInt();
    this.unknownBool = buffer.readBoolean();
    this.disableRelativeVolume = buffer.readBoolean();
}
 
开发者ID:GoMint,项目名称:GoMint,代码行数:10,代码来源:PacketWorldSoundEvent.java

示例6: readGamerules

import io.gomint.jraknet.PacketBuffer; //导入方法依赖的package包/类
public Map<Gamerule, Object> readGamerules( PacketBuffer buffer ) {
	int amount = buffer.readUnsignedVarInt();
	if ( amount == 0 ) {
		return null;
	}

	Map<Gamerule, Object> gamerules = new HashMap<>();
	for ( int i = 0; i < amount; i++ ) {
		String name = buffer.readString();
		byte type = buffer.readByte();

		Object val = null;
		switch ( type ) {
			case 1:
				val = buffer.readBoolean();
				break;
			case 2:
				val = buffer.readUnsignedVarInt();
				break;
			case 3:
				val = buffer.readLFloat();
				break;
		}

		System.out.println( name + " -> " + String.valueOf( val ) );
	}

	return gamerules;
}
 
开发者ID:GoMint,项目名称:Proxy,代码行数:30,代码来源:Packet.java

示例7: deserialize

import io.gomint.jraknet.PacketBuffer; //导入方法依赖的package包/类
@Override
public void deserialize( PacketBuffer buffer ) {
    this.commandName = buffer.readString();
    this.overloadName = buffer.readString();

    this.unknown1 = buffer.readUnsignedVarInt();
    this.unknown2 = buffer.readUnsignedVarInt();

    this.hasOutput = buffer.readBoolean();

    System.out.println( this.unknown1 );
    System.out.println( this.unknown2 );
    System.out.println( this.hasOutput );

    this.clientGuid = buffer.readUnsignedVarLong();

    this.input = buffer.readString();
    this.output = buffer.readString();

    System.out.println( "GUID: " + this.clientGuid );
    System.out.println( "Commandname: " + this.commandName );
    System.out.println( "Overloadname: " + this.overloadName );
    System.out.println( "Input: " + this.input );
    System.out.println( "Output: " + this.output );

    // String next?

    this.data = new byte[buffer.getRemaining()];
    buffer.readBytes( this.data );

    System.out.println( Util.toHexString( this.data ) );
    System.out.println( new String( this.data ) );
}
 
开发者ID:GoMint,项目名称:Proxy,代码行数:34,代码来源:PacketCommandStep.java

示例8: deserialize

import io.gomint.jraknet.PacketBuffer; //导入方法依赖的package包/类
@Override
public void deserialize( PacketBuffer buffer ) {
    this.entityId = buffer.readSignedVarLong().longValue();
    this.runtimeEntityId = buffer.readUnsignedVarLong();
    this.gamemode = buffer.readSignedVarInt();

    this.spawn = new Location( buffer.readLFloat(), buffer.readLFloat(), buffer.readLFloat(), buffer.readLFloat(), buffer.readLFloat() );
    this.seed = buffer.readSignedVarInt();
    this.dimension = buffer.readSignedVarInt();
    this.generator = buffer.readSignedVarInt();
    this.worldGamemode = buffer.readSignedVarInt();
    this.difficulty = buffer.readSignedVarInt();

    buffer.readSignedVarInt();
    buffer.readSignedVarInt();
    buffer.readSignedVarInt();

    this.hasAchievementsDisabled = buffer.readBoolean();
    this.dayCycleStopTime = buffer.readSignedVarInt();
    this.eduMode = buffer.readBoolean();
    this.rainLevel = buffer.readLFloat();
    this.lightningLevel = buffer.readLFloat();
    this.isMultiplayerGame = buffer.readBoolean();
    this.hasLANBroadcast = buffer.readBoolean();
    this.hasXboxLiveBroadcast = buffer.readBoolean();
    this.commandsEnabled = buffer.readBoolean();
    this.isTexturePacksRequired = buffer.readBoolean();
    this.gamerules = readGamerules( buffer );
    this.hasBonusChestEnabled = buffer.readBoolean();
    this.hasStartWithMapEnabled = buffer.readBoolean();
    this.hasTrustPlayersEnabled = buffer.readBoolean();

    this.defaultPlayerPermission = buffer.readSignedVarInt();
    this.xboxLiveBroadcastMode = buffer.readSignedVarInt();

    this.levelId = buffer.readString();
    this.worldName = buffer.readString();
    this.templateName = buffer.readString();
    this.unknown1 = buffer.readBoolean();
    this.currentTick = buffer.readLLong();
    this.enchantmentSeed = buffer.readSignedVarInt();

    System.out.println( this );
}
 
开发者ID:GoMint,项目名称:Proxy,代码行数:45,代码来源:PacketStartGame.java

示例9: deserialize

import io.gomint.jraknet.PacketBuffer; //导入方法依赖的package包/类
@Override
public void deserialize( PacketBuffer buffer ) {
    this.hideDisconnectScreen = buffer.readBoolean();
    this.message = buffer.readString();
}
 
开发者ID:GoMint,项目名称:ProxProx,代码行数:6,代码来源:PacketDisconnect.java


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