本文整理汇总了C#中CraftyServer.Core.World.markBlocksDirty方法的典型用法代码示例。如果您正苦于以下问题:C# World.markBlocksDirty方法的具体用法?C# World.markBlocksDirty怎么用?C# World.markBlocksDirty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CraftyServer.Core.World
的用法示例。
在下文中一共展示了World.markBlocksDirty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: blockActivated
public override bool blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
int l = world.getBlockMetadata(i, j, k);
int i1 = l & 7;
int j1 = 8 - (l & 8);
if (j1 == 0)
{
return true;
}
world.setBlockMetadataWithNotify(i, j, k, i1 + j1);
world.markBlocksDirty(i, j, k, i, j, k);
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "random.click", 0.3F, 0.6F);
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
if (i1 == 1)
{
world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID);
}
else if (i1 == 2)
{
world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID);
}
else if (i1 == 3)
{
world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID);
}
else if (i1 == 4)
{
world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID);
}
else
{
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
}
world.func_22074_c(i, j, k, blockID, tickRate());
return true;
}
示例2: func_22024_i
private void func_22024_i(World world, int i, int j, int k)
{
int l = world.getBlockMetadata(i, j, k);
world.setBlockAndMetadata(i, j, k, blockID + 1, l);
world.markBlocksDirty(i, j, k, i, j, k);
world.markBlockNeedsUpdate(i, j, k);
}
示例3: 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());
}
}
示例4: updateTick
public override void updateTick(World world, int i, int j, int k, Random random)
{
if (world.singleplayerWorld)
{
return;
}
int l = world.getBlockMetadata(i, j, k);
if ((l & 8) == 0)
{
return;
}
world.setBlockMetadataWithNotify(i, j, k, l & 7);
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
int i1 = l & 7;
if (i1 == 1)
{
world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID);
}
else if (i1 == 2)
{
world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID);
}
else if (i1 == 3)
{
world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID);
}
else if (i1 == 4)
{
world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID);
}
else
{
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
}
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "random.click", 0.3F, 0.5F);
world.markBlocksDirty(i, j, k, i, j, k);
}
示例5: func_21031_a
private void func_21031_a(World world, int i, int j, int k, int l, int i1, int j1)
{
int k1 = world.getBlockMetadata(i, j, k);
int l1 = 0;
wiresProvidePower = false;
bool flag = world.isBlockIndirectlyGettingPowered(i, j, k);
wiresProvidePower = true;
if (flag)
{
l1 = 15;
}
else
{
for (int i2 = 0; i2 < 4; i2++)
{
int k2 = i;
int i3 = k;
if (i2 == 0)
{
k2--;
}
if (i2 == 1)
{
k2++;
}
if (i2 == 2)
{
i3--;
}
if (i2 == 3)
{
i3++;
}
if (k2 != l || j != i1 || i3 != j1)
{
l1 = getMaxCurrentStrength(world, k2, j, i3, l1);
}
if (world.isBlockOpaqueCube(k2, j, i3) && !world.isBlockOpaqueCube(i, j + 1, k))
{
if (k2 != l || j + 1 != i1 || i3 != j1)
{
l1 = getMaxCurrentStrength(world, k2, j + 1, i3, l1);
}
continue;
}
if (!world.isBlockOpaqueCube(k2, j, i3) && (k2 != l || j - 1 != i1 || i3 != j1))
{
l1 = getMaxCurrentStrength(world, k2, j - 1, i3, l1);
}
}
if (l1 > 0)
{
l1--;
}
else
{
l1 = 0;
}
}
if (k1 != l1)
{
world.editingBlocks = true;
world.setBlockMetadataWithNotify(i, j, k, l1);
world.markBlocksDirty(i, j, k, i, j, k);
world.editingBlocks = false;
for (int j2 = 0; j2 < 4; j2++)
{
int l2 = i;
int j3 = k;
int k3 = j - 1;
if (j2 == 0)
{
l2--;
}
if (j2 == 1)
{
l2++;
}
if (j2 == 2)
{
j3--;
}
if (j2 == 3)
{
j3++;
}
if (world.isBlockOpaqueCube(l2, j, j3))
{
k3 += 2;
}
int l3 = 0;
l3 = getMaxCurrentStrength(world, l2, j, j3, -1);
l1 = world.getBlockMetadata(i, j, k);
if (l1 > 0)
{
l1--;
}
if (l3 >= 0 && l3 != l1)
{
//.........这里部分代码省略.........