Examples of MovingObjectPosition


Examples of com.mojang.minecraft.MovingObjectPosition

      if(var11 == var5) {
        var12 = 3;
      }

      return new MovingObjectPosition(var1, var2, var3, var12, var11.add((float)var1, (float)var2, (float)var3));
    }
  }
View Full Code Here

Examples of net.minecraft.server.MovingObjectPosition

   * @param endY to stop ray tracing (outer limit)
   * @param endZ to stop ray tracing (outer limit)
   * @return the hit Block, or null if none was found (AIR)
   */
  public static Block rayTraceBlock(org.bukkit.World world, double startX, double startY, double startZ, double endX, double endY, double endZ) {
    MovingObjectPosition mop = CommonNMS.getNative(world).rayTrace(CommonNMS.newVec3D(startX, startY, startZ),
        CommonNMS.newVec3D(endX, endY, endZ), false);
    return mop == null ? null : world.getBlockAt(mop.b, mop.c, mop.d);
  }
View Full Code Here

Examples of net.minecraft.src.MovingObjectPosition

    * @param distance - The maximum distance to check
    * @return A coordinate object containing the block that was inline with
    *         the players view
    */
   public Coordinate trace(double distance) {
      MovingObjectPosition m = rayTrace(distance, 1.0F);
      if (m == null) {
         return null;
      }
      return new Coordinate(m.blockX, m.blockY, m.blockZ);
   }
View Full Code Here

Examples of net.minecraft.util.MovingObjectPosition

    public void onUsingFocusTick(ItemStack stack, EntityPlayer p, int time) {
        ItemWandCasting wand = (ItemWandCasting) stack.getItem();
        if (!wand.consumeAllVis(stack, p, visUsage, false, false))
            return;

        MovingObjectPosition pos = BlockUtils.getTargetBlock(p.worldObj, p, false);

        if (pos != null) {
            Block block = p.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
            int meta = p.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ);
View Full Code Here

Examples of net.minecraft.util.MovingObjectPosition

    @Override
    public void processCommand(ICommandSender sender, String[] args) {
        if (sender instanceof EntityPlayer) {
            EntityPlayer player = (EntityPlayer) sender;
            MovingObjectPosition pos = BlockUtils.getTargetBlock(player.worldObj, player, true);
            if (player.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ) instanceof TileInfusedGrain) {
                TileInfusedGrain tile = (TileInfusedGrain) player.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);
                for (Aspect a : Aspect.getPrimalAspects()) {
                    if (args[0].toUpperCase().equals(a.getName().toUpperCase())) {
                        try {
View Full Code Here

Examples of net.minecraft.util.MovingObjectPosition

    IAdvancedTool tool = (IAdvancedTool) currentStack.getItem();

    if (tool.getType().equals("sword"))
      return;

    MovingObjectPosition pos = ToolHandler.raytraceFromEntity(par2World, par3Entity, true, 4.5F);
    String typeToFind = "";

    if (player.isSwingInProgress && pos != null) {
      Block block = par2World.getBlock(pos.blockX, pos.blockY, pos.blockZ);
View Full Code Here

Examples of net.minecraft.util.MovingObjectPosition

    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (!ToolHandler.isRightMaterial(mat, ToolHandler.materialsAxe))
      return false;

    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;

    ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
View Full Code Here

Examples of net.minecraft.util.MovingObjectPosition

    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (!ToolHandler.isRightMaterial(mat, ToolHandler.materialsPick))
      return false;

    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;

    Block blk = world.getBlock(x, y, z);
View Full Code Here

Examples of net.minecraft.util.MovingObjectPosition

  public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (!ToolHandler.isRightMaterial(mat, ToolHandler.materialsShovel))
      return false;
    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;

    ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
View Full Code Here

Examples of net.minecraft.util.MovingObjectPosition

        int metadata = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
        String status = StatCollector.translateToLocal(te.stepUp ? "function.transformer.stepUp" : "function.transformer.stepDown");
        String name = StatCollector.translateToLocal(ElectricExpansionItems.blockTransformer.getUnlocalizedName() + "." + (int) Math.pow(2, metadata +1) + "x.name");
       
        EntityPlayer player = Minecraft.getMinecraft().thePlayer;
        MovingObjectPosition movingPosition = player.rayTrace(5, 1f);
       
       
       
        if (movingPosition != null)
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.