Java 类org.bukkit.inventory.MainHand 实例源码

项目:Debuggery    文件:InputFormatterTest.java   
@Test
public void testValueFromEnum() throws InputException {
    Class[] inputTypes = {
            WeatherType.class,
            EquipmentSlot.class,
            MainHand.class,
            PermissionDefault.class
    };

    String[] input = {
            "downfall",
            "HeAd",
            "lEfT",
            "NOT_OP"
    };

    Object[] output = InputFormatter.getTypesFromInput(inputTypes, Arrays.asList(input), null);

    // First let's make sure we didn't lose anything, or get anything
    assertEquals(inputTypes.length, output.length);

    // Next let's make sure everything is the right type
    assertTrue(output[0] instanceof WeatherType);
    assertTrue(output[1] instanceof EquipmentSlot);
    assertTrue(output[2] instanceof MainHand);
    assertTrue(output[3] instanceof PermissionDefault);

    // Finally, let's make sure the values are correct
    assertSame(output[0], WeatherType.DOWNFALL);
    assertSame(output[1], EquipmentSlot.HEAD);
    assertSame(output[2], MainHand.LEFT);
    assertSame(output[3], PermissionDefault.NOT_OP);
}
项目:ProtocolSupport    文件:ClientSettings.java   
@Override
public void readFromClientData(ByteBuf clientdata) {
    locale = StringSerializer.readString(clientdata, connection.getVersion(), 16);
    viewDist = clientdata.readByte();
    chatMode = MiscSerializer.readByteEnum(clientdata, ChatMode.CONSTANT_LOOKUP);
    chatColors = clientdata.readBoolean();
    skinFlags = clientdata.readUnsignedByte();
    mainHand = MainHand.RIGHT;
}
项目:ProtocolSupport    文件:ClientSettings.java   
@Override
public void readFromClientData(ByteBuf clientdata) {
    locale = StringSerializer.readString(clientdata, connection.getVersion(), 16);
    viewDist = clientdata.readByte();
    int chatState = clientdata.readByte();
    chatMode = ChatMode.CONSTANT_LOOKUP.getByOrdinal(chatState & 7);
    chatColors = (chatState & 8) == 8;
    clientdata.readByte();
    clientdata.readBoolean();
    skinFlags = 255;
    mainHand = MainHand.RIGHT;
}
项目:ProtocolSupport    文件:ClientSettings.java   
@Override
public void readFromClientData(ByteBuf clientdata) {
    locale = StringSerializer.readString(clientdata, connection.getVersion(), 16);
    viewDist = clientdata.readByte();
    chatMode = MiscSerializer.readByteEnum(clientdata, ChatMode.CONSTANT_LOOKUP);
    chatColors = clientdata.readBoolean();
    clientdata.readByte();
    clientdata.readBoolean();
    skinFlags = 255;
    mainHand = MainHand.RIGHT;
}
项目:SpigotSource    文件:EntityPlayer.java   
public void a(PacketPlayInSettings packetplayinsettings) {
    // CraftBukkit start
    if (getMainHand() != packetplayinsettings.f()) { // PAIL: rename
        PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT);
        this.server.server.getPluginManager().callEvent(event);
    }
    // CraftBukkit end
    this.locale = packetplayinsettings.a();
    this.cg = packetplayinsettings.c();
    this.ch = packetplayinsettings.d();
    this.getDataWatcher().set(EntityPlayer.bq, Byte.valueOf((byte) packetplayinsettings.e()));
    this.getDataWatcher().set(EntityPlayer.br, Byte.valueOf((byte) (packetplayinsettings.f() == EnumMainHand.LEFT ? 0 : 1)));
}
项目:MockBukkit    文件:PlayerMock.java   
@Override
public MainHand getMainHand()
{
    // TODO Auto-generated method stub
    throw new UnimplementedOperationException();
}
项目:GlowNPC    文件:GlowNPC.java   
public GlowNPC(Location location, PlayerProfile profile) {
    super(location, profile);
    this.hand = MainHand.LEFT;
}
项目:GlowNPC    文件:GlowNPC.java   
@Override
public MainHand getMainHand() {
    return hand;
}
项目:HiddenOre    文件:FakePlayer.java   
@Override
public MainHand getMainHand() {
    return null;
}
项目:Pokkit    文件:PokkitHumanEntity.java   
@Override
public MainHand getMainHand() {
    return MainHand.LEFT;
}
项目:BlockLocker    文件:TestPlayer.java   
@Override
public MainHand getMainHand() {
    throw new UnsupportedOperationException();
}
项目:SpigotSource    文件:CraftHumanEntity.java   
public MainHand getMainHand() {
    return getHandle().getMainHand()== EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT;
}