本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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());
}
}
示例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);
}
示例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);
}
示例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
}
示例9: getHolder
import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
@Override
public EntityHuman getHolder() {
return (EntityHuman) super.getHolder();
}
示例10: getHolder
import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
@Override
public EntityHuman getHolder() {
return (EntityHuman) this.holder;
}
示例11: isHuman
import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
public boolean isHuman() {
return this.entity instanceof EntityHuman;
}
示例12: getHolder
import cn.nukkit.entity.EntityHuman; //导入依赖的package包/类
@Override
public EntityHuman getHolder() {
return (EntityHuman) super.getHolder();
}
示例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);
}