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

Java EntityHuman类代码示例

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

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



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

示例1: checkEntity

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
public static boolean checkEntity(Entity entity, Plot plot) {
    if (plot == null || !plot.hasOwner() || plot.getFlags().isEmpty() && plot.getArea().DEFAULT_FLAGS.isEmpty()) {
        return false;
    }
    if (entity instanceof EntityLiving) {
        if (entity instanceof EntityCreature) {
            if (entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal) {
                return checkEntity(plot, Flags.ENTITY_CAP, Flags.MOB_CAP, Flags.ANIMAL_CAP);
            } else if (entity instanceof EntityMob) {
                return checkEntity(plot, Flags.ENTITY_CAP, Flags.MOB_CAP, Flags.HOSTILE_CAP);
            } else if (entity instanceof EntityHuman){
                return false;
            } else {
                return checkEntity(plot, Flags.ENTITY_CAP, Flags.MOB_CAP, Flags.MOB_CAP);
            }
        } else {
            return checkEntity(plot, Flags.ENTITY_CAP, Flags.MOB_CAP);
        }
    } else if (entity instanceof EntityVehicle) {
        return checkEntity(plot, Flags.ENTITY_CAP, Flags.VEHICLE_CAP);
    } else if (entity instanceof EntityHanging){
        return checkEntity(plot, Flags.ENTITY_CAP, Flags.MISC_CAP);
    } else {
        return checkEntity(plot, Flags.ENTITY_CAP);
    }
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:27,代码来源:PlayerEvents.java


示例2: onSlotChange

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
@Override
public void onSlotChange(int index, Item before, boolean send) {
    EntityHuman holder = this.getHolder();
    if (holder instanceof Player && !((Player) holder).spawned) {
        return;
    }

    if (index >= this.getSize()) {
        this.sendArmorSlot(index, this.getViewers());
        this.sendArmorSlot(index, this.getHolder().getViewers().values());
    } else {
        super.onSlotChange(index, before, send);
    }
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:15,代码来源:PlayerInventory.java


示例3: onSlotChange

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
@Override
public void onSlotChange(int index, Item before, boolean send) {
	EntityHuman holder = this.getHolder();
	if (holder instanceof Player && !((Player) holder).spawned) {
		return;
	}
	sendOffhandItem(this.getHolder().getViewers().values().stream().toArray(Player[]::new));
	super.onSlotChange(index, before, send);
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:10,代码来源:PlayerOffhandInventory.java


示例4: registerEntities

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
private void registerEntities() {
    Entity.registerEntity("Arrow", EntityArrow.class);
    Entity.registerEntity("Item", EntityItem.class);
    Entity.registerEntity("FallingSand", EntityFallingBlock.class);
    Entity.registerEntity("PrimedTnt", EntityPrimedTNT.class);
    Entity.registerEntity("Snowball", EntitySnowball.class);
    Entity.registerEntity("EnderPearl", EntityEnderPearl.class);
    Entity.registerEntity("Painting", EntityPainting.class);
    //todo mobs
    Entity.registerEntity("Creeper", EntityCreeper.class);
    Entity.registerEntity("Zombie", EntityZombie.class);
    //TODO: more mobs
    Entity.registerEntity("Chicken", EntityChicken.class);
    Entity.registerEntity("Cow", EntityCow.class);
    Entity.registerEntity("Pig", EntityPig.class);
    Entity.registerEntity("Rabbit", EntityRabbit.class);
    Entity.registerEntity("Sheep", EntitySheep.class);
    Entity.registerEntity("Wolf", EntityWolf.class);
    Entity.registerEntity("Ocelot", EntityOcelot.class);
    Entity.registerEntity("Villager", EntityVillager.class);

    Entity.registerEntity("ThrownExpBottle", EntityExpBottle.class);
    Entity.registerEntity("XpOrb", EntityXPOrb.class);
    Entity.registerEntity("ThrownPotion", EntityPotion.class);

    Entity.registerEntity("Human", EntityHuman.class, true);

    Entity.registerEntity("MinecartRideable", EntityMinecartEmpty.class);
    // TODO: 2016/1/30 all finds of minecart
    Entity.registerEntity("Boat", EntityBoat.class);

    Entity.registerEntity("Lightning", EntityLightning.class);
}
 
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:34,代码来源:Server.java


示例5: onSlotChange

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
@Override
public void onSlotChange(int index, Item before) {
    EntityHuman holder = this.getHolder();
    if (holder instanceof Player && !((Player) holder).spawned) {
        return;
    }

    super.onSlotChange(index, before);

    if (index >= this.getSize()) {
        this.sendArmorSlot(index, this.getViewers());
        this.sendArmorSlot(index, this.getHolder().getViewers().values());
    }
}
 
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:15,代码来源:PlayerInventory.java


示例6: registerEntities

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
private void registerEntities() {
    Entity.registerEntity("Arrow", EntityArrow.class);
    Entity.registerEntity("Item", EntityItem.class);
    Entity.registerEntity("FallingSand", EntityFallingBlock.class);
    Entity.registerEntity("PrimedTnt", EntityPrimedTNT.class);
    Entity.registerEntity("Snowball", EntitySnowball.class);
    Entity.registerEntity("Painting", EntityPainting.class);
    //todo mobs
    Entity.registerEntity("Creeper", EntityCreeper.class);
    //TODO: more mobs
    Entity.registerEntity("Chicken", EntityChicken.class);
    Entity.registerEntity("Cow", EntityCow.class);
    Entity.registerEntity("Pig", EntityPig.class);
    Entity.registerEntity("Rabbit", EntityRabbit.class);
    Entity.registerEntity("Sheep", EntitySheep.class);
    Entity.registerEntity("Wolf", EntityWolf.class);
    Entity.registerEntity("Ocelot", EntityOcelot.class);
    Entity.registerEntity("Villager", EntityVillager.class);

    Entity.registerEntity("ThrownExpBottle", EntityExpBottle.class);
    Entity.registerEntity("XpOrb", EntityXPOrb.class);
    Entity.registerEntity("ThrownPotion", EntityPotion.class);

    Entity.registerEntity("Human", EntityHuman.class, true);

    Entity.registerEntity("MinecartRideable", EntityMinecartEmpty.class);
    // TODO: 2016/1/30 all finds of minecart
    Entity.registerEntity("Boat", EntityBoat.class);

    Entity.registerEntity("Lightning", EntityLightning.class);
}
 
开发者ID:Creeperface01,项目名称:NukkitGT,代码行数:32,代码来源:Server.java


示例7: registerEntities

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
private void registerEntities() {
    Entity.registerEntity("Arrow", EntityArrow.class);
    Entity.registerEntity("Item", EntityItem.class);
    Entity.registerEntity("FallingSand", EntityFallingBlock.class);
    Entity.registerEntity("PrimedTnt", EntityPrimedTNT.class);
    Entity.registerEntity("Snowball", EntitySnowball.class);
    Entity.registerEntity("EnderPearl", EntityEnderPearl.class);
    Entity.registerEntity("Painting", EntityPainting.class);
    //todo mobs
    Entity.registerEntity("Creeper", EntityCreeper.class);
    //TODO: more mobs
    Entity.registerEntity("Chicken", EntityChicken.class);
    Entity.registerEntity("Cow", EntityCow.class);
    Entity.registerEntity("Pig", EntityPig.class);
    Entity.registerEntity("Rabbit", EntityRabbit.class);
    Entity.registerEntity("Sheep", EntitySheep.class);
    Entity.registerEntity("Wolf", EntityWolf.class);
    Entity.registerEntity("Ocelot", EntityOcelot.class);
    Entity.registerEntity("Villager", EntityVillager.class);

    Entity.registerEntity("ThrownExpBottle", EntityExpBottle.class);
    Entity.registerEntity("XpOrb", EntityXPOrb.class);
    Entity.registerEntity("ThrownPotion", EntityPotion.class);

    Entity.registerEntity("Human", EntityHuman.class, true);

    Entity.registerEntity("MinecartRideable", EntityMinecartEmpty.class);
    // TODO: 2016/1/30 all finds of minecart
    Entity.registerEntity("Boat", EntityBoat.class);

    Entity.registerEntity("Lightning", EntityLightning.class);
}
 
开发者ID:NycuRO,项目名称:Apollo-OLD,代码行数:33,代码来源:Server.java


示例8: registerEntities

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
private void registerEntities() {
    Entity.registerEntity("Arrow", EntityArrow.class);
    Entity.registerEntity("Item", EntityItem.class);
    Entity.registerEntity("FallingSand", EntityFallingBlock.class);
    Entity.registerEntity("PrimedTnt", EntityPrimedTNT.class);
    Entity.registerEntity("Snowball", EntitySnowball.class);
    Entity.registerEntity("EnderPearl", EntityEnderPearl.class);
    Entity.registerEntity("Painting", EntityPainting.class);
    //todo mobs
    Entity.registerEntity("Creeper", EntityCreeper.class);
    Entity.registerEntity("Zombie", EntityZombie.class);
    Entity.registerEntity("Blaze", EntityBlaze.class);
    Entity.registerEntity("CaveSpider", EntityCaveSpider.class);
    Entity.registerEntity("ElderGuardian", EntityElderGuardian.class);
    Entity.registerEntity("EnderDragon", EntityEnderDragon.class);
    Entity.registerEntity("Enderman", EntityEnderman.class);
    Entity.registerEntity("Endermite", EntityEndermite.class);
    Entity.registerEntity("Ghast", EntityGhast.class);
    Entity.registerEntity("Guardian", EntityGuardian.class);
    Entity.registerEntity("Husk", EntityHusk.class);
    Entity.registerEntity("MagmaCube", EntityMagmaCube.class);
    Entity.registerEntity("Shulker", EntityShulker.class);
    Entity.registerEntity("Silferfish", EntitySilverfish.class);
    Entity.registerEntity("Skeleton", EntitySkeleton.class);
    Entity.registerEntity("SkeletonHorse", EntitySkeletonHorse.class);
    Entity.registerEntity("Slime", EntitySlime.class);
    Entity.registerEntity("Spider", EntitySpider.class);
    Entity.registerEntity("Stray", EntityStray.class);
    Entity.registerEntity("Witch", EntityWitch.class);
    //TODO: more mobs
    Entity.registerEntity("Bat", EntityBat.class);
    Entity.registerEntity("Chicken", EntityChicken.class);
    Entity.registerEntity("Cow", EntityCow.class);
    Entity.registerEntity("Donkey", EntityDonkey.class);
    Entity.registerEntity("Horse", EntityHorse.class);
    Entity.registerEntity("Llama", EntityLlama.class);
    Entity.registerEntity("Mooshroom", EntityMooshroom.class);
    Entity.registerEntity("Mule", EntityMule.class);
    Entity.registerEntity("PolarBear", EntityPolarBear.class);
    Entity.registerEntity("Pig", EntityPig.class);
    Entity.registerEntity("Rabbit", EntityRabbit.class);
    Entity.registerEntity("Sheep", EntitySheep.class);
    Entity.registerEntity("Squid", EntitySquid.class);
    Entity.registerEntity("Wolf", EntityWolf.class);
    Entity.registerEntity("Ocelot", EntityOcelot.class);
    Entity.registerEntity("Villager", EntityVillager.class);

    Entity.registerEntity("ThrownExpBottle", EntityExpBottle.class);
    Entity.registerEntity("XpOrb", EntityXPOrb.class);
    Entity.registerEntity("ThrownPotion", EntityPotion.class);
    Entity.registerEntity("Egg", EntityEgg.class);

    Entity.registerEntity("Human", EntityHuman.class, true);

    Entity.registerEntity("MinecartRideable", EntityMinecartEmpty.class);
    // TODO: 2016/1/30 all finds of minecart
    Entity.registerEntity("Boat", EntityBoat.class);

    //Entity.registerEntity("Lightning", EntityLightning.class); lightning shouldn't be saved as entity
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:61,代码来源:Server.java


示例9: getHolder

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
@Override
public EntityHuman getHolder() {
    return (EntityHuman) super.getHolder();
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PlayerInventory.java


示例10: getHolder

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
@Override
public EntityHuman getHolder() {
    return (EntityHuman) this.holder;
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PlayerEnderChestInventory.java


示例11: isHuman

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
public boolean isHuman() {
    return this.entity instanceof EntityHuman;
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:4,代码来源:EntityDespawnEvent.java


示例12: getHolder

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
@Override
public EntityHuman getHolder() {
	return (EntityHuman) super.getHolder();
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:5,代码来源:PlayerOffhandInventory.java


示例13: PlayerInventory

import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
public PlayerInventory(EntityHuman player) {
    super(player, InventoryType.get(InventoryType.PLAYER));
    this.hotbar = new int[this.getHotbarSize()];
    Arrays.fill(this.hotbar, -1);
}
 
开发者ID:Creeperface01,项目名称:NukkitGT,代码行数:6,代码来源:PlayerInventory.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Object2IntLinkedOpenHashMap类代码示例发布时间:2022-05-22
下一篇:
Java CompactionInterruptedException类代码示例发布时间: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