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


Java EntityHuman类代码示例

本文整理汇总了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;未经允许,请勿转载。