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


Java EnumMovingObjectType.TILE属性代码示例

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


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

示例1: func_77659_a

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,代码行数:25,代码来源:ItemEnderEye.java

示例2: func_72731_b

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,代码行数:24,代码来源:RenderGlobal.java

示例3: func_71399_a

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,代码行数:21,代码来源:Minecraft.java

示例4: onItemRightClick

/**
 * 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,代码行数:25,代码来源:ItemFertileLilypad.java

示例5: add

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,代码行数:24,代码来源:Formulas.java

示例6: onItemRightClick

@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,代码行数:39,代码来源:ItemPaper.java

示例7: getClickedBlock

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,代码行数:12,代码来源:MineFantasyHUD.java

示例8: onItemRightClick

/**
 * 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,代码行数:38,代码来源:ItemEnderEye.java

示例9: func_77659_a

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,代码行数:38,代码来源:ItemMonsterPlacer.java

示例10: MovingObjectPosition

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,代码行数:8,代码来源:MovingObjectPosition.java

示例11: onItemRightClick

@Override
    public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
    {
        MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true);

        if (movingobjectposition == null)
        {
            return itemStack;
        }
        else
        {
            if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
            {
//                if(tickTimer == 0){
                    if(ElectricItem.manager.canUse(itemStack, 10000)){
                        if(world.getBlockId(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ) == Block.waterStill.blockID || world.getBlockId(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ) == Block.waterMoving.blockID){
                            EntityItem entityItem = new EntityItem(world, movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ, new ItemStack(Item.fishCooked, new Random().nextInt(8)));
                            entityItem.motionX = movingobjectposition.blockX - player.posX*2;
                            entityItem.motionY = movingobjectposition.blockY - player.posY*2;
                            entityItem.motionZ = movingobjectposition.blockZ - player.posZ*2;
                            ElectricItem.manager.use(itemStack, 10000, player);
                            world.spawnEntityInWorld(entityItem);
//                            tickTimer = 20;
                            return itemStack;
                        }
                    }
//                }
            }
            return itemStack;
        }
    }
 
开发者ID:tprussak,项目名称:Electric-Fishing-Pole-2,代码行数:31,代码来源:ItemAdvancedElectricRod.java

示例12: onItemRightClick

@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
	if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
		MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true);
		if (movingobjectposition == null) {
			return itemStack;
		} else {
			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 (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) {
					return itemStack;
				} else {
					ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(world.getBlockId(i, j, k), 1, world.getBlockMetadata(i, j, k)));
					if (!world.isRemote && !(result == null)) {
						int id = result.itemID;
						int meta = result.getItemDamage();
						world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
						world.setBlock(i, j, k, 0);
						world.spawnEntityInWorld(new EntityItem(world, i, j, k, new ItemStack(id, 1, meta)));
						itemStack.damageItem(1, entityPlayer);
					}
				}
			}
		}
	} else {
		world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0);
		if (!world.isRemote) {
			world.spawnEntityInWorld(new EntityChargeFire(world, entityPlayer));
			itemStack.damageItem(1, entityPlayer);
		}
		return itemStack;
	}
	return itemStack;
}
 
开发者ID:oitsjustjose,项目名称:MysticMods,代码行数:39,代码来源:ItemStaffFire.java

示例13: onItemRightClick

/**
 * Called whenever this item is equipped and the right mouse button is
 * pressed. Args: itemStack, world, entityPlayer
 */
@Override
public ItemStack onItemRightClick(ItemStack ist, World world, EntityPlayer player) {
	if (this.isEmptyVial(ist)) {
		boolean var11 = isEmptyVial(ist);
		MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(world, player, var11);
		if (mop == null) return ist;
		else {
			if (mop.typeOfHit == EnumMovingObjectType.TILE) {
				int var13 = mop.blockX;
				int var14 = mop.blockY;
				int var15 = mop.blockZ;
				if (world.getBlockMaterial(var13, var14, var15) == Material.water) {
					if (--ist.stackSize <= 0) return new ItemStack(this, 1, waterVialMeta());
					if (!player.inventory.addItemStackToInventory(new ItemStack(this, 1, waterVialMeta()))) {
						player.dropPlayerItem(new ItemStack(this, 1, waterVialMeta()));
					}
				}
			}
		}
	} else if (!hasEffect(ist)) return ist;
	else if (isPotion(ist)) {
		player.setItemInUse(ist, this.getMaxItemUseDuration(ist));
	} else if (isSplash(ist)) {
		if (world.isRemote) return ist;
		Entity e = getNewPotionEntity(ist, world, player);
		if (e == null) return ist;
		if (!player.capabilities.isCreativeMode) {
			--ist.stackSize;
		}
		world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
		world.spawnEntityInWorld(e);
	}
	return ist;
}
 
开发者ID:DarthFeder,项目名称:Reliquary,代码行数:38,代码来源:ItemCondensedPotion.java

示例14: drawSelectionBox

/**
 * 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:smallcampus,项目名称:BetterNutritionMod,代码行数:30,代码来源:RenderGlobal.java

示例15: sendClickBlockToController

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:smallcampus,项目名称:BetterNutritionMod,代码行数:28,代码来源:Minecraft.java


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