当前位置: 首页>>代码示例>>C#>>正文


C# World.entityJoinedWorld方法代码示例

本文整理汇总了C#中World.entityJoinedWorld方法的典型用法代码示例。如果您正苦于以下问题:C# World.entityJoinedWorld方法的具体用法?C# World.entityJoinedWorld怎么用?C# World.entityJoinedWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在World的用法示例。


在下文中一共展示了World.entityJoinedWorld方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: onItemUse

 public override bool onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k,
     int l)
 {
     if (l == 0)
     {
         return false;
     }
     if (l == 1)
     {
         return false;
     }
     byte byte0 = 0;
     if (l == 4)
     {
         byte0 = 1;
     }
     if (l == 3)
     {
         byte0 = 2;
     }
     if (l == 5)
     {
         byte0 = 3;
     }
     var entitypainting = new EntityPainting(world, i, j, k, byte0);
     if (entitypainting.onValidSurface())
     {
         if (!world.singleplayerWorld)
         {
             world.entityJoinedWorld(entitypainting);
         }
         itemstack.stackSize--;
     }
     return true;
 }
开发者ID:riverar,项目名称:Crafty,代码行数:35,代码来源:ItemPainting.cs

示例2: onItemRightClick

 public override ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
 {
     itemstack.stackSize--;
     world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F/(itemRand.nextFloat()*0.4F + 0.8F));
     if (!world.singleplayerWorld)
     {
         world.entityJoinedWorld(new EntitySnowball(world, entityplayer));
     }
     return itemstack;
 }
开发者ID:riverar,项目名称:Crafty,代码行数:10,代码来源:ItemSnowball.cs

示例3: ejectRecord

 public void ejectRecord(World world, int i, int j, int k, int l)
 {
     world.playRecord(null, i, j, k);
     world.setBlockMetadataWithNotify(i, j, k, 0);
     int i1 = (Item.record13.shiftedIndex + l) - 1;
     float f = 0.7F;
     double d = (world.rand.nextFloat()*f) + (1.0F - f)*0.5D;
     double d1 = (world.rand.nextFloat()*f) + (1.0F - f)*0.20000000000000001D +
                 0.59999999999999998D;
     double d2 = (world.rand.nextFloat()*f) + (1.0F - f)*0.5D;
     var entityitem = new EntityItem(world, i + d, j + d1, k + d2,
                                     new ItemStack(i1, 1, 0));
     entityitem.delayBeforeCanPickup = 10;
     world.entityJoinedWorld(entityitem);
 }
开发者ID:riverar,项目名称:Crafty,代码行数:15,代码来源:BlockJukeBox.cs

示例4: onItemRightClick

 public override ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
 {
     if (entityplayer.fishEntity != null)
     {
         int i = entityplayer.fishEntity.func_6143_c();
         itemstack.damageItem(i);
         entityplayer.swingItem();
     }
     else
     {
         world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F/(itemRand.nextFloat()*0.4F + 0.8F));
         if (!world.singleplayerWorld)
         {
             world.entityJoinedWorld(new EntityFish(world, entityplayer));
         }
         entityplayer.swingItem();
     }
     return itemstack;
 }
开发者ID:riverar,项目名称:Crafty,代码行数:19,代码来源:ItemFishingRod.cs

示例5: onItemUse

 public override bool onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k,
     int l)
 {
     int i1 = world.getBlockId(i, j, k);
     Material material = world.getBlockMaterial(i, j + 1, k);
     if (!material.isSolid() && i1 == Block.grass.blockID || i1 == Block.dirt.blockID)
     {
         Block block = Block.tilledField;
         world.playSoundEffect(i + 0.5F, j + 0.5F, k + 0.5F, block.stepSound.func_737_c(),
                               (block.stepSound.func_738_a() + 1.0F)/2.0F, block.stepSound.func_739_b()*0.8F);
         if (world.singleplayerWorld)
         {
             return true;
         }
         world.setBlockWithNotify(i, j, k, block.blockID);
         itemstack.damageItem(1);
         if (world.rand.nextInt(8) == 0 && i1 == Block.grass.blockID)
         {
             int j1 = 1;
             for (int k1 = 0; k1 < j1; k1++)
             {
                 float f = 0.7F;
                 float f1 = world.rand.nextFloat()*f + (1.0F - f)*0.5F;
                 float f2 = 1.2F;
                 float f3 = world.rand.nextFloat()*f + (1.0F - f)*0.5F;
                 var entityitem = new EntityItem(world, i + f1, j + f2, k + f3,
                                                 new ItemStack(seeds));
                 entityitem.delayBeforeCanPickup = 10;
                 world.entityJoinedWorld(entityitem);
             }
         }
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:38,代码来源:ItemHoe.cs

示例6: 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, true);
     if (movingobjectposition == null)
     {
         return itemstack;
     }
     if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
     {
         int i = movingobjectposition.blockX;
         int j = movingobjectposition.blockY;
         int k = movingobjectposition.blockZ;
         if (!world.singleplayerWorld)
         {
             world.entityJoinedWorld(new EntityBoat(world, i + 0.5F, j + 1.5F, k + 0.5F));
         }
         itemstack.stackSize--;
     }
     return itemstack;
 }
开发者ID:riverar,项目名称:Crafty,代码行数:37,代码来源:ItemBoat.cs


注:本文中的World.entityJoinedWorld方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。