• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EnumMovingObjectType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.util.EnumMovingObjectType的典型用法代码示例。如果您正苦于以下问题:Java EnumMovingObjectType类的具体用法?Java EnumMovingObjectType怎么用?Java EnumMovingObjectType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EnumMovingObjectType类属于net.minecraft.util包,在下文中一共展示了EnumMovingObjectType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: func_77659_a

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
   MovingObjectPosition var4 = this.func_77621_a(p_77659_2_, p_77659_3_, false);
   if(var4 != null && var4.field_72313_a == EnumMovingObjectType.TILE) {
      int var5 = p_77659_2_.func_72798_a(var4.field_72311_b, var4.field_72312_c, var4.field_72309_d);
      if(var5 == Block.field_72104_bI.field_71990_ca) {
         return p_77659_1_;
      }
   }

   if(!p_77659_2_.field_72995_K) {
      ChunkPosition var7 = p_77659_2_.func_72946_b("Stronghold", (int)p_77659_3_.field_70165_t, (int)p_77659_3_.field_70163_u, (int)p_77659_3_.field_70161_v);
      if(var7 != null) {
         EntityEnderEye var6 = new EntityEnderEye(p_77659_2_, p_77659_3_.field_70165_t, p_77659_3_.field_70163_u + 1.62D - (double)p_77659_3_.field_70129_M, p_77659_3_.field_70161_v);
         var6.func_70220_a((double)var7.field_76930_a, var7.field_76928_b, (double)var7.field_76929_c);
         p_77659_2_.func_72838_d(var6);
         p_77659_2_.func_72956_a(p_77659_3_, "random.bow", 0.5F, 0.4F / (field_77697_d.nextFloat() * 0.4F + 0.8F));
         p_77659_2_.func_72889_a((EntityPlayer)null, 1002, (int)p_77659_3_.field_70165_t, (int)p_77659_3_.field_70163_u, (int)p_77659_3_.field_70161_v, 0);
         if(!p_77659_3_.field_71075_bZ.field_75098_d) {
            --p_77659_1_.field_77994_a;
         }
      }
   }

   return p_77659_1_;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:26,代码来源:ItemEnderEye.java


示例2: func_72731_b

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public void func_72731_b(EntityPlayer p_72731_1_, MovingObjectPosition p_72731_2_, int p_72731_3_, float p_72731_4_) {
   if(p_72731_3_ == 0 && p_72731_2_.field_72313_a == EnumMovingObjectType.TILE) {
      GL11.glEnable(3042);
      GL11.glBlendFunc(770, 771);
      GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F);
      GL11.glLineWidth(2.0F);
      GL11.glDisable(3553);
      GL11.glDepthMask(false);
      float var5 = 0.002F;
      int var6 = this.field_72769_h.func_72798_a(p_72731_2_.field_72311_b, p_72731_2_.field_72312_c, p_72731_2_.field_72309_d);
      if(var6 > 0) {
         Block.field_71973_m[var6].func_71902_a(this.field_72769_h, p_72731_2_.field_72311_b, p_72731_2_.field_72312_c, p_72731_2_.field_72309_d);
         double var7 = p_72731_1_.field_70142_S + (p_72731_1_.field_70165_t - p_72731_1_.field_70142_S) * (double)p_72731_4_;
         double var9 = p_72731_1_.field_70137_T + (p_72731_1_.field_70163_u - p_72731_1_.field_70137_T) * (double)p_72731_4_;
         double var11 = p_72731_1_.field_70136_U + (p_72731_1_.field_70161_v - p_72731_1_.field_70136_U) * (double)p_72731_4_;
         this.func_72715_a(Block.field_71973_m[var6].func_71911_a_(this.field_72769_h, p_72731_2_.field_72311_b, p_72731_2_.field_72312_c, p_72731_2_.field_72309_d).func_72314_b((double)var5, (double)var5, (double)var5).func_72325_c(-var7, -var9, -var11));
      }

      GL11.glDepthMask(true);
      GL11.glEnable(3553);
      GL11.glDisable(3042);
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:25,代码来源:RenderGlobal.java


示例3: func_71399_a

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
private void func_71399_a(int p_71399_1_, boolean p_71399_2_) {
   if(!p_71399_2_) {
      this.field_71429_W = 0;
   }

   if(p_71399_1_ != 0 || this.field_71429_W <= 0) {
      if(p_71399_2_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == EnumMovingObjectType.TILE && p_71399_1_ == 0) {
         int var3 = this.field_71476_x.field_72311_b;
         int var4 = this.field_71476_x.field_72312_c;
         int var5 = this.field_71476_x.field_72309_d;
         this.field_71442_b.func_78759_c(var3, var4, var5, this.field_71476_x.field_72310_e);
         if(this.field_71439_g.func_82246_f(var3, var4, var5)) {
            this.field_71452_i.func_78867_a(var3, var4, var5, this.field_71476_x.field_72310_e);
            this.field_71439_g.func_71038_i();
         }
      } else {
         this.field_71442_b.func_78767_c();
      }

   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:22,代码来源:Minecraft.java


示例4: bucketFill

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
@ForgeSubscribe
/**
 * Called by ItemBucket when it tries to fill a bucket
 * @param evt
 */
public void bucketFill(FillBucketEvent evt) {
    if (evt.current.getItem().equals(Item.bucketEmpty) && evt.target.typeOfHit == EnumMovingObjectType.TILE) {
        if (evt.world.canMineBlock(evt.entityPlayer, evt.target.blockX, evt.target.blockY, evt.target.blockZ)) {
            if (evt.entityPlayer.canPlayerEdit(evt.target.blockX, evt.target.blockY, evt.target.blockZ, evt.target.sideHit, evt.current)) {
                if (evt.world.getBlockId(evt.target.blockX, evt.target.blockY, evt.target.blockZ) == blockID) {
                    evt.world.setBlockToAir(evt.target.blockX, evt.target.blockY, evt.target.blockZ);
                    evt.result = new ItemStack(Magitech.instance.magibucket);
                    evt.setResult(Result.ALLOW);
                }
            }
        }
    }
}
 
开发者ID:froschi3b,项目名称:Magitech,代码行数:19,代码来源:BlockMagi.java


示例5: onItemRightClick

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
/**
 * Called whenever this item is equipped and the right mouse button is
 * pressed. Args: itemStack, world, entityPlayer
 */
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
	MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
	if (var4 == null) return par1ItemStack;
	else {
		if (var4.typeOfHit == EnumMovingObjectType.TILE) {
			int var5 = var4.blockX;
			int var6 = var4.blockY;
			int var7 = var4.blockZ;
			if (!par2World.canMineBlock(par3EntityPlayer, var5, var6, var7)) return par1ItemStack;
			if (!par3EntityPlayer.canPlayerEdit(var5, var6, var7, var4.sideHit, par1ItemStack)) return par1ItemStack;
			if (par2World.getBlockMaterial(var5, var6, var7) == Material.water && par2World.getBlockMetadata(var5, var6, var7) == 0 && par2World.isAirBlock(var5, var6 + 1, var7)) {
				par2World.setBlock(var5, var6 + 1, var7, XRBlocks.lilypad.blockID);
				if (!par3EntityPlayer.capabilities.isCreativeMode) {
					--par1ItemStack.stackSize;
				}
			}
		}
		return par1ItemStack;
	}
}
 
开发者ID:DarthFeder,项目名称:Reliquary,代码行数:26,代码来源:ItemFertileLilypad.java


示例6: add

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack add(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
      
  	MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
  	
      if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
      {
          int i = movingobjectposition.blockX;
          int j = movingobjectposition.blockY;
          int k = movingobjectposition.blockZ;

      	par2World.setBlockToAir(i, j, k);
          
          if (--par1ItemStack.stackSize <= 0)
          {
          	return new ItemStack(Item.bucketWater);
          }

          if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketWater)))
          {
          	par3EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketWater.itemID, 1, 0));
          }
      }
return par1ItemStack;
  }
 
开发者ID:theflogat,项目名称:Theflogats-Mods,代码行数:25,代码来源:Formulas.java


示例7: onItemRightClick

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
@Override
public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player)
{
	Random rand = new Random();
    MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true);

    if (movingobjectposition == null)
    {
        return item;
    }
    else
    {
        if (!world.isRemote && movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
        {
            int i = movingobjectposition.blockX;
            int j = movingobjectposition.blockY;
            int k = movingobjectposition.blockZ;

            if (!world.canMineBlock(player, i, j, k))
            {
                return item;
            }

            if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, item))
            {
                return item;
            }

            if (isSaltWaterSource(world, i, j, k))
            {
            	world.playSoundAtEntity(player, "random.splash", 0.125F + rand.nextFloat()/4, 0.5F + rand.nextFloat());
                item.stackSize --;
                EntityItem result = new EntityItem(world, player.posX, player.posY, player.posZ, new ItemStack(ItemListMF.misc, 1, ItemListMF.saltPaper));
                world.spawnEntityInWorld(result);
            }
        }
    }
    return item;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:40,代码来源:ItemPaper.java


示例8: getClickedBlock

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public int[] getClickedBlock(float ticks, int mouseX, int mouseY)
{
	if (mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE)
       {
           int j = mc.objectMouseOver.blockX;
           int k = mc.objectMouseOver.blockY;
           int l = mc.objectMouseOver.blockZ;
           
           return new int[]{j, k, l};
       }
	return null;
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:13,代码来源:MineFantasyHUD.java


示例9: tickEnd

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData)
{
    if (!type.contains(TickType.PLAYER)) return;
    
    EntityPlayer entityPlayer = (EntityPlayer) tickData[0];
    
    if (entityPlayer != null)
    {
    	//If we JUST swung an Item
        if (entityPlayer.swingProgressInt == 1) 
        {
            ItemStack mainhand = entityPlayer.getCurrentEquippedItem();
            if (mainhand != null && mainhand.getItem() instanceof IExtendedReachItem) 
            {
                float extendedReach = ((IExtendedReachItem) mainhand.getItem()).getReachModifierInBlocks(mainhand);
                if(extendedReach > 0)
                {
                    MovingObjectPosition mouseOver = ExtendedReachHelper.getMouseOver(0, extendedReach + 4);
                    if (mouseOver != null && mouseOver.typeOfHit == EnumMovingObjectType.ENTITY) 
                    {
                        Entity target = mouseOver.entityHit;
                        if (target instanceof EntityLiving && target != entityPlayer)
                        {
                            if (target.hurtResistantTime != ((EntityLiving) target).maxHurtResistantTime) 
                            {
                                FMLClientHandler.instance().getClient().playerController.attackEntity(entityPlayer, target);
                            }
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:36,代码来源:WeaponHandlerClient.java


示例10: func_77659_a

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
   MovingObjectPosition var4 = this.func_77621_a(p_77659_2_, p_77659_3_, true);
   if(var4 == null) {
      return p_77659_1_;
   } else {
      if(var4.field_72313_a == EnumMovingObjectType.TILE) {
         int var5 = var4.field_72311_b;
         int var6 = var4.field_72312_c;
         int var7 = var4.field_72309_d;
         if(!p_77659_2_.func_72962_a(p_77659_3_, var5, var6, var7)) {
            return p_77659_1_;
         }

         if(!p_77659_3_.func_82247_a(var5, var6, var7, var4.field_72310_e, p_77659_1_)) {
            return p_77659_1_;
         }

         if(p_77659_2_.func_72803_f(var5, var6, var7) == Material.field_76244_g) {
            --p_77659_1_.field_77994_a;
            if(p_77659_1_.field_77994_a <= 0) {
               return new ItemStack(Item.field_77726_bs);
            }

            if(!p_77659_3_.field_71071_by.func_70441_a(new ItemStack(Item.field_77726_bs))) {
               p_77659_3_.func_71021_b(new ItemStack(Item.field_77726_bs.field_77779_bT, 1, 0));
            }
         }
      }

      return p_77659_1_;
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:33,代码来源:ItemGlassBottle.java


示例11: func_77659_a

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
   if(p_77659_2_.field_72995_K) {
      return p_77659_1_;
   } else {
      MovingObjectPosition var4 = this.func_77621_a(p_77659_2_, p_77659_3_, true);
      if(var4 == null) {
         return p_77659_1_;
      } else {
         if(var4.field_72313_a == EnumMovingObjectType.TILE) {
            int var5 = var4.field_72311_b;
            int var6 = var4.field_72312_c;
            int var7 = var4.field_72309_d;
            if(!p_77659_2_.func_72962_a(p_77659_3_, var5, var6, var7)) {
               return p_77659_1_;
            }

            if(!p_77659_3_.func_82247_a(var5, var6, var7, var4.field_72310_e, p_77659_1_)) {
               return p_77659_1_;
            }

            if(p_77659_2_.func_72803_f(var5, var6, var7) == Material.field_76244_g) {
               Entity var8 = func_77840_a(p_77659_2_, p_77659_1_.func_77960_j(), (double)var5, (double)var6, (double)var7);
               if(var8 != null) {
                  if(var8 instanceof EntityLivingBase && p_77659_1_.func_82837_s()) {
                     ((EntityLiving)var8).func_94058_c(p_77659_1_.func_82833_r());
                  }

                  if(!p_77659_3_.field_71075_bZ.field_75098_d) {
                     --p_77659_1_.field_77994_a;
                  }
               }
            }
         }

         return p_77659_1_;
      }
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:39,代码来源:ItemMonsterPlacer.java


示例12: func_77659_a

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
   MovingObjectPosition var4 = this.func_77621_a(p_77659_2_, p_77659_3_, true);
   if(var4 == null) {
      return p_77659_1_;
   } else {
      if(var4.field_72313_a == EnumMovingObjectType.TILE) {
         int var5 = var4.field_72311_b;
         int var6 = var4.field_72312_c;
         int var7 = var4.field_72309_d;
         if(!p_77659_2_.func_72962_a(p_77659_3_, var5, var6, var7)) {
            return p_77659_1_;
         }

         if(!p_77659_3_.func_82247_a(var5, var6, var7, var4.field_72310_e, p_77659_1_)) {
            return p_77659_1_;
         }

         if(p_77659_2_.func_72803_f(var5, var6, var7) == Material.field_76244_g && p_77659_2_.func_72805_g(var5, var6, var7) == 0 && p_77659_2_.func_72799_c(var5, var6 + 1, var7)) {
            p_77659_2_.func_94575_c(var5, var6 + 1, var7, Block.field_71991_bz.field_71990_ca);
            if(!p_77659_3_.field_71075_bZ.field_75098_d) {
               --p_77659_1_.field_77994_a;
            }
         }
      }

      return p_77659_1_;
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:29,代码来源:ItemLilyPad.java


示例13: MovingObjectPosition

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public MovingObjectPosition(int p_i2303_1_, int p_i2303_2_, int p_i2303_3_, int p_i2303_4_, Vec3 p_i2303_5_) {
   this.field_72313_a = EnumMovingObjectType.TILE;
   this.field_72311_b = p_i2303_1_;
   this.field_72312_c = p_i2303_2_;
   this.field_72309_d = p_i2303_3_;
   this.field_72310_e = p_i2303_4_;
   this.field_72307_f = p_i2303_5_.field_72447_d.func_72345_a(p_i2303_5_.field_72450_a, p_i2303_5_.field_72448_b, p_i2303_5_.field_72449_c);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:MovingObjectPosition.java


示例14: addMovingObjectType

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public static EnumMovingObjectType addMovingObjectType(String name)
{
    if (!isSetup)
    {
        setup();
    }

    return addEnum(EnumMovingObjectType.class, name);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:10,代码来源:EnumHelper.java


示例15: onItemRightClick

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
/**
 * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
 */
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
    MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false);

    if (movingobjectposition != null && movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
    {
        int i = par2World.getBlockId(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);

        if (i == Block.endPortalFrame.blockID)
        {
            return par1ItemStack;
        }
    }

    if (!par2World.isRemote)
    {
        ChunkPosition chunkposition = par2World.findClosestStructure("Stronghold", (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ);

        if (chunkposition != null)
        {
            EntityEnderEye entityendereye = new EntityEnderEye(par2World, par3EntityPlayer.posX, par3EntityPlayer.posY + 1.62D - (double)par3EntityPlayer.yOffset, par3EntityPlayer.posZ);
            entityendereye.moveTowards((double)chunkposition.x, chunkposition.y, (double)chunkposition.z);
            par2World.spawnEntityInWorld(entityendereye);
            par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
            par2World.playAuxSFXAtEntity((EntityPlayer)null, 1002, (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ, 0);

            if (!par3EntityPlayer.capabilities.isCreativeMode)
            {
                --par1ItemStack.stackSize;
            }
        }
    }

    return par1ItemStack;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:39,代码来源:ItemEnderEye.java


示例16: drawSelectionBox

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
/**
 * Draws the selection box for the player. Args: entityPlayer, rayTraceHit, i, itemStack, partialTickTime
 */
public void drawSelectionBox(EntityPlayer par1EntityPlayer, MovingObjectPosition par2MovingObjectPosition, int par3, float par4)
{
    if (par3 == 0 && par2MovingObjectPosition.typeOfHit == EnumMovingObjectType.TILE)
    {
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F);
        GL11.glLineWidth(2.0F);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDepthMask(false);
        float f1 = 0.002F;
        int j = this.theWorld.getBlockId(par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ);

        if (j > 0)
        {
            Block.blocksList[j].setBlockBoundsBasedOnState(this.theWorld, par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ);
            double d0 = par1EntityPlayer.lastTickPosX + (par1EntityPlayer.posX - par1EntityPlayer.lastTickPosX) * (double)par4;
            double d1 = par1EntityPlayer.lastTickPosY + (par1EntityPlayer.posY - par1EntityPlayer.lastTickPosY) * (double)par4;
            double d2 = par1EntityPlayer.lastTickPosZ + (par1EntityPlayer.posZ - par1EntityPlayer.lastTickPosZ) * (double)par4;
            this.drawOutlinedBoundingBox(Block.blocksList[j].getSelectedBoundingBoxFromPool(this.theWorld, par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ).expand((double)f1, (double)f1, (double)f1).getOffsetBoundingBox(-d0, -d1, -d2));
        }

        GL11.glDepthMask(true);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_BLEND);
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:31,代码来源:RenderGlobal.java


示例17: sendClickBlockToController

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
private void sendClickBlockToController(int par1, boolean par2)
{
    if (!par2)
    {
        this.leftClickCounter = 0;
    }

    if (par1 != 0 || this.leftClickCounter <= 0)
    {
        if (par2 && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE && par1 == 0)
        {
            int j = this.objectMouseOver.blockX;
            int k = this.objectMouseOver.blockY;
            int l = this.objectMouseOver.blockZ;
            this.playerController.onPlayerDamageBlock(j, k, l, this.objectMouseOver.sideHit);

            if (this.thePlayer.isCurrentToolAdventureModeExempt(j, k, l))
            {
                this.effectRenderer.addBlockHitEffects(j, k, l, this.objectMouseOver);
                this.thePlayer.swingItem();
            }
        }
        else
        {
            this.playerController.resetBlockRemoving();
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:29,代码来源:Minecraft.java


示例18: getInventoryHit

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
private IInventory getInventoryHit(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z) {
	
	IInventory inventory = null;
	
	MovingObjectPosition movingobjectposition = getPlayerTarget(player);
	
	if (movingobjectposition != null && movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) {
		int i = movingobjectposition.blockX;
		int j = movingobjectposition.blockY;
		int k = movingobjectposition.blockZ;
		TileEntity targeted = world.getBlockTileEntity(i, j, k);

		if (targeted instanceof TileEntityChest) {
			inventory = Utils.getChest((IInventory) targeted);
		} else if (targeted instanceof MachineApiaristChest) {
			if (((ItemBackpack) ForestryItem.apiaristBackpack).isBackpack(itemstack)) {
				inventory = (IInventory) targeted;
			}
		} else if (targeted instanceof IInventory) {
			IInventory test = (IInventory) targeted;
			if (test.getSizeInventory() > 26) {
				inventory = test;
			}
		}
	}

	return inventory;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:29,代码来源:ItemBackpack.java


示例19: onImpact

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
private void onImpact(MovingObjectPosition mop) {
	if (mop.typeOfHit == EnumMovingObjectType.ENTITY && mop.entityHit != null) {
		if (mop.entityHit == shootingEntity) return;
		this.onImpact(mop.entityHit);
	} else if (mop.typeOfHit == EnumMovingObjectType.TILE) {
		this.groundImpact(mop.sideHit);
	}
}
 
开发者ID:DarthFeder,项目名称:Reliquary,代码行数:9,代码来源:EntitySeekerShot.java


示例20: onItemRightClick

import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
@Override
public ItemStack onItemRightClick(ItemStack ist, World world, EntityPlayer player) {
	if (this.isOnCooldown(ist)) return ist;
	MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(world, player, true);
	if (mop != null && mop.typeOfHit == EnumMovingObjectType.TILE) {
		float xOff = (float)(mop.blockX - player.posX);
		float yOff = (float)(mop.blockY - player.posY);
		float zOff = (float)(mop.blockZ - player.posZ);
		this.onItemUse(ist, player, world, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, xOff, yOff, zOff);
	}
	return ist;
}
 
开发者ID:DarthFeder,项目名称:Reliquary,代码行数:13,代码来源:ItemSojournerStaff.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TimeCacheMap类代码示例发布时间:2022-05-21
下一篇:
Java BlockDoublePlant类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap