本文整理汇总了C#中CraftyServer.Core.World.setBlockWithNotify方法的典型用法代码示例。如果您正苦于以下问题:C# World.setBlockWithNotify方法的具体用法?C# World.setBlockWithNotify怎么用?C# World.setBlockWithNotify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CraftyServer.Core.World
的用法示例。
在下文中一共展示了World.setBlockWithNotify方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: updateTick
public override void updateTick(World world, int i, int j, int k, Random random)
{
if (world.singleplayerWorld)
{
return;
}
if (world.getBlockLightValue(i, j + 1, k) < 4 && world.getBlockMaterial(i, j + 1, k).getCanBlockGrass())
{
if (random.nextInt(4) != 0)
{
return;
}
world.setBlockWithNotify(i, j, k, dirt.blockID);
}
else if (world.getBlockLightValue(i, j + 1, k) >= 9)
{
int l = (i + random.nextInt(3)) - 1;
int i1 = (j + random.nextInt(5)) - 3;
int j1 = (k + random.nextInt(3)) - 1;
if (world.getBlockId(l, i1, j1) == dirt.blockID && world.getBlockLightValue(l, i1 + 1, j1) >= 4 &&
!world.getBlockMaterial(l, i1 + 1, j1).getCanBlockGrass())
{
world.setBlockWithNotify(l, i1, j1, grass.blockID);
}
}
}
示例2: onEntityWalking
public override void onEntityWalking(World world, int i, int j, int k, Entity entity)
{
if (world.rand.nextInt(4) == 0)
{
world.setBlockWithNotify(i, j, k, dirt.blockID);
}
}
示例3: updateTick
public override void updateTick(World world, int i, int j, int k, Random random)
{
if (blockID == oreRedstoneGlowing.blockID)
{
world.setBlockWithNotify(i, j, k, oreRedstone.blockID);
}
}
示例4: onNeighborBlockChange
public override void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
int i1 = 0;
int j1 = 1;
if (world.getBlockId(i - 1, j, k) == blockID || world.getBlockId(i + 1, j, k) == blockID)
{
i1 = 1;
j1 = 0;
}
int k1;
for (k1 = j; world.getBlockId(i, k1 - 1, k) == blockID; k1--)
{
}
if (world.getBlockId(i, k1 - 1, k) != obsidian.blockID)
{
world.setBlockWithNotify(i, j, k, 0);
return;
}
int l1;
for (l1 = 1; l1 < 4 && world.getBlockId(i, k1 + l1, k) == blockID; l1++)
{
}
if (l1 != 3 || world.getBlockId(i, k1 + l1, k) != obsidian.blockID)
{
world.setBlockWithNotify(i, j, k, 0);
return;
}
bool flag = world.getBlockId(i - 1, j, k) == blockID || world.getBlockId(i + 1, j, k) == blockID;
bool flag1 = world.getBlockId(i, j, k - 1) == blockID || world.getBlockId(i, j, k + 1) == blockID;
if (flag && flag1)
{
world.setBlockWithNotify(i, j, k, 0);
return;
}
if ((world.getBlockId(i + i1, j, k + j1) != obsidian.blockID ||
world.getBlockId(i - i1, j, k - j1) != blockID) &&
(world.getBlockId(i - i1, j, k - j1) != obsidian.blockID ||
world.getBlockId(i + i1, j, k + j1) != blockID))
{
world.setBlockWithNotify(i, j, k, 0);
return;
}
else
{
return;
}
}
示例5: updateTick
public override void updateTick(World world, int i, int j, int k, Random random)
{
if (world.getSavedLightValue(EnumSkyBlock.Block, i, j, k) > 11 - lightOpacity[blockID])
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, waterMoving.blockID);
}
}
示例6: func_276_g
protected void func_276_g(World world, int i, int j, int k)
{
if (!canBlockStay(world, i, j, k))
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, 0);
}
}
示例7: onBlockRemoval
public override void onBlockRemoval(World world, int i, int j, int k)
{
Material material = world.getBlockMaterial(i, j - 1, k);
if (material.getIsSolid() || material.getIsLiquid())
{
world.setBlockWithNotify(i, j, k, waterStill.blockID);
}
}
示例8: onNeighborBlockChange
public override void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
if (l > 0 && blocksList[l].canProvidePower() && world.isBlockIndirectlyGettingPowered(i, j, k))
{
onBlockDestroyedByPlayer(world, i, j, k, 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
示例9: onNeighborBlockChange
public override void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
base.onNeighborBlockChange(world, i, j, k, l);
Material material = world.getBlockMaterial(i, j + 1, k);
if (material.isSolid())
{
world.setBlockWithNotify(i, j, k, dirt.blockID);
}
}
示例10: generate
public override bool generate(World world, Random random, int i, int j, int k)
{
for (int l = 0; l < 64; l++)
{
int i1 = (i + random.nextInt(8)) - random.nextInt(8);
int j1 = (j + random.nextInt(4)) - random.nextInt(4);
int k1 = (k + random.nextInt(8)) - random.nextInt(8);
if (world.isAirBlock(i1, j1, k1) && world.getBlockId(i1, j1 - 1, k1) == Block.bloodStone.blockID)
{
world.setBlockWithNotify(i1, j1, k1, Block.fire.blockID);
}
}
return true;
}
示例11: onBlockAdded
public override void onBlockAdded(World world, int i, int j, int k)
{
if (this != stairSingle)
{
base.onBlockAdded(world, i, j, k);
}
int l = world.getBlockId(i, j - 1, k);
int i1 = world.getBlockMetadata(i, j, k);
int j1 = world.getBlockMetadata(i, j - 1, k);
if (i1 != j1)
{
return;
}
if (l == stairSingle.blockID)
{
world.setBlockWithNotify(i, j, k, 0);
world.setBlockAndMetadataWithNotify(i, j - 1, k, stairDouble.blockID, i1);
}
}
示例12: onNeighborBlockChange
public override void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
bool flag = false;
if (isFreestanding)
{
if (!world.getBlockMaterial(i, j - 1, k).isSolid())
{
flag = true;
}
}
else
{
int i1 = world.getBlockMetadata(i, j, k);
flag = true;
if (i1 == 2 && world.getBlockMaterial(i, j, k + 1).isSolid())
{
flag = false;
}
if (i1 == 3 && world.getBlockMaterial(i, j, k - 1).isSolid())
{
flag = false;
}
if (i1 == 4 && world.getBlockMaterial(i + 1, j, k).isSolid())
{
flag = false;
}
if (i1 == 5 && world.getBlockMaterial(i - 1, j, k).isSolid())
{
flag = false;
}
}
if (flag)
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, 0);
}
base.onNeighborBlockChange(world, i, j, k, l);
}
示例13: updateTick
public override void updateTick(World world, int i, int j, int k, Random random)
{
if (world.isAirBlock(i, j + 1, k))
{
int l;
for (l = 1; world.getBlockId(i, j - l, k) == blockID; l++)
{
}
if (l < 3)
{
int i1 = world.getBlockMetadata(i, j, k);
if (i1 == 15)
{
world.setBlockWithNotify(i, j + 1, k, blockID);
world.setBlockMetadataWithNotify(i, j, k, 0);
}
else
{
world.setBlockMetadataWithNotify(i, j, k, i1 + 1);
}
}
}
}
示例14: tryToCreatePortal
public bool tryToCreatePortal(World world, int i, int j, int k)
{
int l = 0;
int i1 = 0;
if (world.getBlockId(i - 1, j, k) == obsidian.blockID ||
world.getBlockId(i + 1, j, k) == obsidian.blockID)
{
l = 1;
}
if (world.getBlockId(i, j, k - 1) == obsidian.blockID ||
world.getBlockId(i, j, k + 1) == obsidian.blockID)
{
i1 = 1;
}
[email protected]((new StringBuilder()).append(l).append(", ").append(i1).toString());
if (l == i1)
{
return false;
}
if (world.getBlockId(i - l, j, k - i1) == 0)
{
i -= l;
k -= i1;
}
for (int j1 = -1; j1 <= 2; j1++)
{
for (int l1 = -1; l1 <= 3; l1++)
{
bool flag = j1 == -1 || j1 == 2 || l1 == -1 || l1 == 3;
if ((j1 == -1 || j1 == 2) && (l1 == -1 || l1 == 3))
{
continue;
}
int j2 = world.getBlockId(i + l*j1, j + l1, k + i1*j1);
if (flag)
{
if (j2 != obsidian.blockID)
{
return false;
}
continue;
}
if (j2 != 0 && j2 != fire.blockID)
{
return false;
}
}
}
world.editingBlocks = true;
for (int k1 = 0; k1 < 2; k1++)
{
for (int i2 = 0; i2 < 3; i2++)
{
world.setBlockWithNotify(i + l*k1, j + i2, k + i1*k1, portal.blockID);
}
}
world.editingBlocks = false;
return true;
}
示例15: func_321_g
private void func_321_g(World world, int i, int j, int k)
{
func_320_h(world, i, j, k);
if (blockID == oreRedstone.blockID)
{
world.setBlockWithNotify(i, j, k, oreRedstoneGlowing.blockID);
}
}