本文整理汇总了C#中CraftyServer.Core.World.spawnParticle方法的典型用法代码示例。如果您正苦于以下问题:C# World.spawnParticle方法的具体用法?C# World.spawnParticle怎么用?C# World.spawnParticle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CraftyServer.Core.World
的用法示例。
在下文中一共展示了World.spawnParticle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: func_320_h
private void func_320_h(World world, int i, int j, int k)
{
Random random = world.rand;
double d = 0.0625D;
for (int l = 0; l < 6; l++)
{
double d1 = i + random.nextFloat();
double d2 = j + random.nextFloat();
double d3 = k + random.nextFloat();
if (l == 0 && !world.isBlockOpaqueCube(i, j + 1, k))
{
d2 = (j + 1) + d;
}
if (l == 1 && !world.isBlockOpaqueCube(i, j - 1, k))
{
d2 = (j + 0) - d;
}
if (l == 2 && !world.isBlockOpaqueCube(i, j, k + 1))
{
d3 = (k + 1) + d;
}
if (l == 3 && !world.isBlockOpaqueCube(i, j, k - 1))
{
d3 = (k + 0) - d;
}
if (l == 4 && !world.isBlockOpaqueCube(i + 1, j, k))
{
d1 = (i + 1) + d;
}
if (l == 5 && !world.isBlockOpaqueCube(i - 1, j, k))
{
d1 = (i + 0) - d;
}
if (d1 < i || d1 > (i + 1) || d2 < 0.0D || d2 > (j + 1) || d3 < k ||
d3 > (k + 1))
{
world.spawnParticle("reddust", d1, d2, d3, 0.0D, 0.0D, 0.0D);
}
}
}
示例2: onItemRightClick
public override ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
float f = 1.0F;
float f1 = entityplayer.prevRotationPitch + (entityplayer.rotationPitch - entityplayer.prevRotationPitch)*f;
float f2 = entityplayer.prevRotationYaw + (entityplayer.rotationYaw - entityplayer.prevRotationYaw)*f;
double d = entityplayer.prevPosX + (entityplayer.posX - entityplayer.prevPosX)*f;
double d1 = (entityplayer.prevPosY + (entityplayer.posY - entityplayer.prevPosY)*f +
1.6200000000000001D) - entityplayer.yOffset;
double d2 = entityplayer.prevPosZ + (entityplayer.posZ - entityplayer.prevPosZ)*f;
Vec3D vec3d = Vec3D.createVector(d, d1, d2);
float f3 = MathHelper.cos(-f2*0.01745329F - 3.141593F);
float f4 = MathHelper.sin(-f2*0.01745329F - 3.141593F);
float f5 = -MathHelper.cos(-f1*0.01745329F);
float f6 = MathHelper.sin(-f1*0.01745329F);
float f7 = f4*f5;
float f8 = f6;
float f9 = f3*f5;
double d3 = 5D;
Vec3D vec3d1 = vec3d.addVector(f7*d3, f8*d3, f9*d3);
MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do(vec3d, vec3d1, isFull == 0);
if (movingobjectposition == null)
{
return itemstack;
}
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(entityplayer, i, j, k))
{
return itemstack;
}
if (isFull == 0)
{
if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0)
{
world.setBlockWithNotify(i, j, k, 0);
return new ItemStack(bucketWater);
}
if (world.getBlockMaterial(i, j, k) == Material.lava && world.getBlockMetadata(i, j, k) == 0)
{
world.setBlockWithNotify(i, j, k, 0);
return new ItemStack(bucketLava);
}
}
else
{
if (isFull < 0)
{
return new ItemStack(bucketEmpty);
}
if (movingobjectposition.sideHit == 0)
{
j--;
}
if (movingobjectposition.sideHit == 1)
{
j++;
}
if (movingobjectposition.sideHit == 2)
{
k--;
}
if (movingobjectposition.sideHit == 3)
{
k++;
}
if (movingobjectposition.sideHit == 4)
{
i--;
}
if (movingobjectposition.sideHit == 5)
{
i++;
}
if (world.isAirBlock(i, j, k) || !world.getBlockMaterial(i, j, k).isSolid())
{
if (world.worldProvider.isHellWorld && isFull == Block.waterStill.blockID)
{
world.playSoundEffect(d + 0.5D, d1 + 0.5D, d2 + 0.5D, "random.fizz", 0.5F,
2.6F + (world.rand.nextFloat() - world.rand.nextFloat())*0.8F);
for (int l = 0; l < 8; l++)
{
world.spawnParticle("largesmoke", i + Math.random(), j + Math.random(),
k + Math.random(), 0.0D, 0.0D, 0.0D);
}
}
else
{
world.setBlockAndMetadataWithNotify(i, j, k, isFull, 0);
}
return new ItemStack(bucketEmpty);
}
}
}
else if (isFull == 0 && (movingobjectposition.entityHit is EntityCow))
{
return new ItemStack(bucketMilk);
}
//.........这里部分代码省略.........
示例3: playBlock
public override void playBlock(World world, int i, int j, int k, int l, int i1)
{
var f = (float) Math.pow(2D, (i1 - 12)/12D);
string s = "harp";
if (l == 1)
{
s = "bd";
}
if (l == 2)
{
s = "snare";
}
if (l == 3)
{
s = "hat";
}
if (l == 4)
{
s = "bassattack";
}
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D,
(new StringBuilder()).append("note.").append(s).toString(), 3F, f);
world.spawnParticle("note", i + 0.5D, j + 1.2D, k + 0.5D, i1/24D, 0.0D,
0.0D);
}
示例4: updateTick
public override void updateTick(World world, int i, int j, int k, Random random)
{
bool flag = func_22016_g(world, i, j, k);
for (;
torchUpdates.size() > 0 &&
world.getWorldTime() - ((RedstoneUpdateInfo) torchUpdates.get(0)).updateTime > 100L;
torchUpdates.remove(0))
{
}
if (torchActive)
{
if (flag)
{
world.setBlockAndMetadataWithNotify(i, j, k, torchRedstoneIdle.blockID,
world.getBlockMetadata(i, j, k));
if (checkForBurnout(world, i, j, k, true))
{
world.playSoundEffect(i + 0.5F, j + 0.5F, k + 0.5F, "random.fizz", 0.5F,
2.6F + (world.rand.nextFloat() - world.rand.nextFloat())*0.8F);
for (int l = 0; l < 5; l++)
{
double d = i + random.nextDouble()*0.59999999999999998D + 0.20000000000000001D;
double d1 = j + random.nextDouble()*0.59999999999999998D + 0.20000000000000001D;
double d2 = k + random.nextDouble()*0.59999999999999998D + 0.20000000000000001D;
world.spawnParticle("smoke", d, d1, d2, 0.0D, 0.0D, 0.0D);
}
}
}
}
else if (!flag && !checkForBurnout(world, i, j, k, false))
{
world.setBlockAndMetadataWithNotify(i, j, k, torchRedstoneActive.blockID,
world.getBlockMetadata(i, j, k));
}
}