本文整理汇总了C#中CraftyServer.Core.World.notifyBlocksOfNeighborChange方法的典型用法代码示例。如果您正苦于以下问题:C# World.notifyBlocksOfNeighborChange方法的具体用法?C# World.notifyBlocksOfNeighborChange怎么用?C# World.notifyBlocksOfNeighborChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CraftyServer.Core.World
的用法示例。
在下文中一共展示了World.notifyBlocksOfNeighborChange方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onBlockRemoval
public override void onBlockRemoval(World world, int i, int j, int k)
{
int l = world.getBlockMetadata(i, j, k);
if (l > 0)
{
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
}
base.onBlockRemoval(world, i, j, k);
}
示例2: 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;
}
示例3: updateTick
public override void updateTick(World world, int i, int j, int k, Random random)
{
int l = func_301_g(world, i, j, k);
byte byte0 = 1;
if (blockMaterial == Material.lava && !world.worldProvider.isHellWorld)
{
byte0 = 2;
}
bool flag = true;
if (l > 0)
{
int i1 = -100;
field_659_a = 0;
i1 = func_307_e(world, i - 1, j, k, i1);
i1 = func_307_e(world, i + 1, j, k, i1);
i1 = func_307_e(world, i, j, k - 1, i1);
i1 = func_307_e(world, i, j, k + 1, i1);
int j1 = i1 + byte0;
if (j1 >= 8 || i1 < 0)
{
j1 = -1;
}
if (func_301_g(world, i, j + 1, k) >= 0)
{
int l1 = func_301_g(world, i, j + 1, k);
if (l1 >= 8)
{
j1 = l1;
}
else
{
j1 = l1 + 8;
}
}
if (field_659_a >= 2 && blockMaterial == Material.water)
{
if (world.isBlockOpaqueCube(i, j - 1, k))
{
j1 = 0;
}
else if (world.getBlockMaterial(i, j - 1, k) == blockMaterial && world.getBlockMetadata(i, j, k) == 0)
{
j1 = 0;
}
}
if (blockMaterial == Material.lava && l < 8 && j1 < 8 && j1 > l && random.nextInt(4) != 0)
{
j1 = l;
flag = false;
}
if (j1 != l)
{
l = j1;
if (l < 0)
{
world.setBlockWithNotify(i, j, k, 0);
}
else
{
world.setBlockMetadataWithNotify(i, j, k, l);
world.func_22074_c(i, j, k, blockID, tickRate());
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
}
}
else if (flag)
{
func_22024_i(world, i, j, k);
}
}
else
{
func_22024_i(world, i, j, k);
}
if (func_312_l(world, i, j - 1, k))
{
if (l >= 8)
{
world.setBlockAndMetadataWithNotify(i, j - 1, k, blockID, l);
}
else
{
world.setBlockAndMetadataWithNotify(i, j - 1, k, blockID, l + 8);
}
}
else if (l >= 0 && (l == 0 || func_309_k(world, i, j - 1, k)))
{
bool[] aflag = func_4035_j(world, i, j, k);
int k1 = l + byte0;
if (l >= 8)
{
k1 = 1;
}
if (k1 >= 8)
{
return;
}
if (aflag[0])
{
func_311_f(world, i - 1, j, k, k1);
}
//.........这里部分代码省略.........
示例4: 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());
}
}
示例5: 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);
}
示例6: onBlockAdded
public override void onBlockAdded(World world, int i, int j, int k)
{
if (world.getBlockMetadata(i, j, k) == 0)
{
base.onBlockAdded(world, i, j, k);
}
if (torchActive)
{
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
world.notifyBlocksOfNeighborChange(i, j + 1, k, blockID);
world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID);
world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID);
world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID);
world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID);
}
}
示例7: onBlockRemoval
public override void onBlockRemoval(World world, int i, int j, int k)
{
int l = world.getBlockMetadata(i, j, k);
if ((l & 8) > 0)
{
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);
}
}
base.onBlockRemoval(world, i, j, k);
}
示例8: onBlockRemoval
public override void onBlockRemoval(World world, int i, int j, int k)
{
if (torchActive)
{
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
world.notifyBlocksOfNeighborChange(i, j + 1, k, blockID);
world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID);
world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID);
world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID);
world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID);
}
}
示例9: onBlockAdded
public override void onBlockAdded(World world, int i, int j, int k)
{
world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID);
world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID);
world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID);
world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID);
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
world.notifyBlocksOfNeighborChange(i, j + 1, k, blockID);
}
示例10: updateAndPropagateCurrentStrength
private void updateAndPropagateCurrentStrength(World world, int i, int j, int k)
{
func_21031_a(world, i, j, k, i, j, k);
var arraylist = new ArrayList(field_21032_b);
field_21032_b.clear();
for (int l = 0; l < arraylist.size(); l++)
{
var chunkposition = (ChunkPosition) arraylist.get(l);
world.notifyBlocksOfNeighborChange(chunkposition.x, chunkposition.y, chunkposition.z, blockID);
}
}
示例11: notifyWireNeighborsOfNeighborChange
private void notifyWireNeighborsOfNeighborChange(World world, int i, int j, int k)
{
if (world.getBlockId(i, j, k) != blockID)
{
return;
}
else
{
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID);
world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID);
world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID);
world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID);
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
world.notifyBlocksOfNeighborChange(i, j + 1, k, blockID);
return;
}
}
示例12: onBlockRemoval
public override void onBlockRemoval(World world, int i, int j, int k)
{
base.onBlockRemoval(world, i, j, k);
if (world.singleplayerWorld)
{
return;
}
world.notifyBlocksOfNeighborChange(i, j + 1, k, blockID);
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
updateAndPropagateCurrentStrength(world, i, j, k);
notifyWireNeighborsOfNeighborChange(world, i - 1, j, k);
notifyWireNeighborsOfNeighborChange(world, i + 1, j, k);
notifyWireNeighborsOfNeighborChange(world, i, j, k - 1);
notifyWireNeighborsOfNeighborChange(world, i, j, k + 1);
if (world.isBlockOpaqueCube(i - 1, j, k))
{
notifyWireNeighborsOfNeighborChange(world, i - 1, j + 1, k);
}
else
{
notifyWireNeighborsOfNeighborChange(world, i - 1, j - 1, k);
}
if (world.isBlockOpaqueCube(i + 1, j, k))
{
notifyWireNeighborsOfNeighborChange(world, i + 1, j + 1, k);
}
else
{
notifyWireNeighborsOfNeighborChange(world, i + 1, j - 1, k);
}
if (world.isBlockOpaqueCube(i, j, k - 1))
{
notifyWireNeighborsOfNeighborChange(world, i, j + 1, k - 1);
}
else
{
notifyWireNeighborsOfNeighborChange(world, i, j - 1, k - 1);
}
if (world.isBlockOpaqueCube(i, j, k + 1))
{
notifyWireNeighborsOfNeighborChange(world, i, j + 1, k + 1);
}
else
{
notifyWireNeighborsOfNeighborChange(world, i, j - 1, k + 1);
}
}