• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MainHand类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testValueFromEnum

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
@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);
}
 
开发者ID:zachbr,项目名称:Debuggery,代码行数:34,代码来源:InputFormatterTest.java


示例2: readFromClientData

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
@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;
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupport,代码行数:10,代码来源:ClientSettings.java


示例3: readFromClientData

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
@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;
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupport,代码行数:13,代码来源:ClientSettings.java


示例4: readFromClientData

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
@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;
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupport,代码行数:12,代码来源:ClientSettings.java


示例5: a

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
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)));
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:14,代码来源:EntityPlayer.java


示例6: getMainHand

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
@Override
public MainHand getMainHand()
{
	// TODO Auto-generated method stub
	throw new UnimplementedOperationException();
}
 
开发者ID:seeseemelk,项目名称:MockBukkit,代码行数:7,代码来源:PlayerMock.java


示例7: GlowNPC

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
public GlowNPC(Location location, PlayerProfile profile) {
    super(location, profile);
    this.hand = MainHand.LEFT;
}
 
开发者ID:DenAbr,项目名称:GlowNPC,代码行数:5,代码来源:GlowNPC.java


示例8: getMainHand

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
@Override
public MainHand getMainHand() {
    return hand;
}
 
开发者ID:DenAbr,项目名称:GlowNPC,代码行数:5,代码来源:GlowNPC.java


示例9: getMainHand

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
@Override
public MainHand getMainHand() {
	return null;
}
 
开发者ID:DevotedMC,项目名称:HiddenOre,代码行数:5,代码来源:FakePlayer.java


示例10: getMainHand

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
@Override
public MainHand getMainHand() {
	return MainHand.LEFT;
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:5,代码来源:PokkitHumanEntity.java


示例11: getMainHand

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
@Override
public MainHand getMainHand() {
    throw new UnsupportedOperationException();
}
 
开发者ID:rutgerkok,项目名称:BlockLocker,代码行数:5,代码来源:TestPlayer.java


示例12: getMainHand

import org.bukkit.inventory.MainHand; //导入依赖的package包/类
public MainHand getMainHand() {
    return getHandle().getMainHand()== EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT;
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:4,代码来源:CraftHumanEntity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GetApplicationsResponseProto类代码示例发布时间:2022-05-22
下一篇:
Java ContainerInitEvent类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap