本文整理了Java中net.minecraft.world.World.countEntities()
方法的一些代码示例,展示了World.countEntities()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.countEntities()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:countEntities
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public int countEntities(@Nonnull Class<?> entityType) {
return wrapped.countEntities(entityType);
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public int countEntities(@Nonnull EnumCreatureType type, boolean forSpawnCount) {
return wrapped.countEntities(type, forSpawnCount);
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public int countEntities(Class<?> entityType) {
return getActualWorld().countEntities(entityType);
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public int countEntities(EnumCreatureType type, boolean forSpawnCount) {
return getActualWorld().countEntities(type, forSpawnCount);
}
代码示例来源:origin: TeamLapen/Vampirism
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
EntityPlayer player = getCommandSenderAsPlayer(sender);
int entityMonster = player.getEntityWorld().countEntities(EnumCreatureType.MONSTER, false);
int entityMonsterSpawn = player.getEntityWorld().countEntities(EnumCreatureType.MONSTER, true);
int entityHunter = player.getEntityWorld().countEntities(VReference.HUNTER_CREATURE_TYPE, false);
int entityHunterSpawn = player.getEntityWorld().countEntities(VReference.HUNTER_CREATURE_TYPE, true);
int entityVampire = player.getEntityWorld().countEntities(VReference.VAMPIRE_CREATURE_TYPE, false);
int entityVampireSpawn = player.getEntityWorld().countEntities(VReference.VAMPIRE_CREATURE_TYPE, true);
sender.sendMessage(new TextComponentString(String.format("Monster: %s (%s), Hunter: %s (%s), Vampire: %s (%s)", entityMonster, entityMonsterSpawn, entityHunter, entityHunterSpawn, entityVampire, entityVampireSpawn)));
}
代码示例来源:origin: ForestryMC/ForestryMC
public static boolean spawnButterflyWithoutCheck(IButterfly butterfly, World world, BlockPos pos) {
if (world.countEntities(EntityButterfly.class) > ModuleLepidopterology.spawnConstraint) {
return false;
}
if (world.isAirBlock(pos)) {
return attemptButterflySpawn(world, butterfly, pos);
}
return false;
}
代码示例来源:origin: ForestryMC/ForestryMC
public static boolean spawnButterfly(IButterfly butterfly, World world, BlockPos pos) {
if (world.countEntities(EntityButterfly.class) > ModuleLepidopterology.spawnConstraint) {
return false;
}
if (!butterfly.canSpawn(world, pos.getX(), pos.getY(), pos.getZ())) {
return false;
}
if (world.isAirBlock(pos)) {
return attemptButterflySpawn(world, butterfly, pos);
}
return false;
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
protected boolean canInteract() {
if (entity.getButterfly().getMate() == null && entity.canMate()) {
return true;
}
if (entity.cooldownEgg > 0) {
return false;
}
if (entity.getButterfly().getMate() == null) {
return false;
}
if (entity.world.countEntities(EntityButterfly.class) > ModuleLepidopterology.spawnConstraint) {
return false;
}
return rest != null && GeneticsUtil.canNurse(entity.getButterfly(), entity.world, rest);
}
代码示例来源:origin: ForestryMC/ForestryMC
if (entityItem.world.countEntities(EntityButterfly.class) > ModuleLepidopterology.entityConstraint) {
return false;
代码示例来源:origin: ForestryMC/ForestryMC
if (world.countEntities(EntityButterfly.class) > ModuleLepidopterology.spawnConstraint) {
return false;
代码示例来源:origin: vadis365/TheErebus
@Override
protected void afterEaten() {
EntityGrasshopper grasshopper = (EntityGrasshopper) entity;
grasshopper.getEntityWorld().setBlockToAir(new BlockPos(cropX, cropY, cropZ));
grasshopper.setIsEating(false);
reproCap++;
if (reproCap == 6)
if (grasshopper.getEntityWorld().countEntities(EntityGrasshopper.class) < 80) {
EntityGrasshopper entityGrasshopper = new EntityGrasshopper(grasshopper.getEntityWorld());
entityGrasshopper.setPosition(cropX, cropY + 1, cropZ);
grasshopper.getEntityWorld().spawnEntity(entityGrasshopper);
grasshopper.getNavigator().clearPath();
}
if (reproCap >= 12) {
if (grasshopper.getEntityWorld().countEntities(EntityLocust.class) < 5) {
grasshopper.setDead();
EntityLocust entityLocust = new EntityLocust(grasshopper.getEntityWorld());
entityLocust.setPosition(cropX, cropY + 1, cropZ);
grasshopper.getEntityWorld().spawnEntity(entityLocust);
grasshopper.getEntityWorld().playSound((EntityPlayer)null, entityLocust.getPosition(), ModSounds.LOCUST_SPAWN, SoundCategory.HOSTILE, 1.0F, 1.0F);
}
}
}
}
代码示例来源:origin: TeamLapen/Vampirism
int total = this.getSpawnerWorld().countEntities(limitType, true);
total = total * UtilLib.countPlayerLoadedChunks(this.getSpawnerWorld()) / MOB_COUNT_DIV;
if (total > limitType.getMaxNumberOfCreature()) {
内容来源于网络,如有侵权,请联系作者删除!