本文整理汇总了C#中CraftyServer.Core.World.getEntitiesWithinAABB方法的典型用法代码示例。如果您正苦于以下问题:C# World.getEntitiesWithinAABB方法的具体用法?C# World.getEntitiesWithinAABB怎么用?C# World.getEntitiesWithinAABB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CraftyServer.Core.World
的用法示例。
在下文中一共展示了World.getEntitiesWithinAABB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setStateIfMobInteractsWithPlate
private void setStateIfMobInteractsWithPlate(World world, int i, int j, int k)
{
bool flag = world.getBlockMetadata(i, j, k) == 1;
bool flag1 = false;
float f = 0.125F;
List list = null;
if (triggerMobType == EnumMobType.everything)
{
list = world.getEntitiesWithinAABBExcludingEntity(null,
AxisAlignedBB.getBoundingBoxFromPool(i + f, j,
k + f,
(i + 1) -
f,
j +
0.25D,
(k + 1) -
f));
}
if (triggerMobType == EnumMobType.mobs)
{
list = world.getEntitiesWithinAABB(typeof (EntityLiving),
AxisAlignedBB.getBoundingBoxFromPool(i + f, j, k + f,
(i + 1) - f,
j + 0.25D,
(k + 1) - f));
}
if (triggerMobType == EnumMobType.players)
{
list = world.getEntitiesWithinAABB(typeof (EntityPlayer),
AxisAlignedBB.getBoundingBoxFromPool(i + f, j, k + f,
(i + 1) - f,
j + 0.25D,
(k + 1) - f));
}
if (list.size() > 0)
{
flag1 = true;
}
if (flag1 && !flag)
{
world.setBlockMetadataWithNotify(i, j, k, 1);
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
world.markBlocksDirty(i, j, k, i, j, k);
world.playSoundEffect(i + 0.5D, j + 0.10000000000000001D, k + 0.5D,
"random.click", 0.3F, 0.6F);
}
if (!flag1 && flag)
{
world.setBlockMetadataWithNotify(i, j, k, 0);
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
world.markBlocksDirty(i, j, k, i, j, k);
world.playSoundEffect(i + 0.5D, j + 0.10000000000000001D, k + 0.5D,
"random.click", 0.3F, 0.5F);
}
if (flag1)
{
world.func_22074_c(i, j, k, blockID, tickRate());
}
}