Package thaumcraft.common.items.wands

Examples of thaumcraft.common.items.wands.ItemWandCasting


  public static List<Class<?>> DeflectBlacklist = Arrays.asList(new Class<?>[]{ EntityExpBottle.class });
  AspectList visUsage = new AspectList().add(Aspect.ORDER, 8).add(Aspect.AIR, 4);

  @Override
  public void onUsingFocusTick(ItemStack stack, EntityPlayer p, int ticks) {
    ItemWandCasting wand = (ItemWandCasting) stack.getItem();

    if (wand.consumeAllVis(stack, p, getVisCost(), true, false))
      protectFromProjectiles(p);
  }
View Full Code Here


  private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 15);

  @Override
  public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer p, MovingObjectPosition movingobjectposition) {
    ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
    if (!ConfigHandler.enableFlight) {
      return itemstack;
    }
    if (wand.consumeAllVis(itemstack, p, getVisCost(), true, false)) {
      Vec3 vec = p.getLookVec();
      double force = 1 / 1.5 * (1 + EnchantmentHelper.getEnchantmentLevel(Config.enchPotency.effectId, wand.getFocusItem(itemstack)) * 0.2);
      p.motionX = vec.xCoord * force;
      p.motionY = vec.yCoord * force;
      p.motionZ = vec.zCoord * force;
      p.fallDistance = 0F;
      if (p instanceof EntityPlayerMP) {
View Full Code Here

    return true;
  }

  @Override
  public void onUsingFocusTick(ItemStack paramItemStack, EntityPlayer paramEntityPlayer, int paramInt) {
    ItemWandCasting wand = (ItemWandCasting) paramItemStack.getItem();

    if (Integer.MAX_VALUE - paramInt > 60) {
      ItemStack stackToCount = null;
      for (int i = 0; i < 9; i++) {
        ItemStack stackInSlot = paramEntityPlayer.inventory.getStackInSlot(i);
        if (stackInSlot != null && stackInSlot.getItem() instanceof ItemSkyPearl && ItemSkyPearl.isAttuned(stackInSlot)) {
          stackToCount = stackInSlot;
          break;
        }
      }

      if (stackToCount != null) {
        int dim = ItemSkyPearl.getDim(stackToCount);
        if (dim == paramEntityPlayer.dimension) {
          int x = ItemSkyPearl.getX(stackToCount);
          int y = ItemSkyPearl.getY(stackToCount);
          int z = ItemSkyPearl.getZ(stackToCount);

          if (wand.consumeAllVis(paramItemStack, paramEntityPlayer, getVisCost(), false, false) && TileWarpGate.teleportPlayer(paramEntityPlayer, new ChunkCoordinates(x, y, z)))
            wand.consumeAllVis(paramItemStack, paramEntityPlayer, getVisCost(), true, false);
        }
      }

      paramEntityPlayer.clearItemInUse();
    }
View Full Code Here

    EntityRegistry.registerModEntity(Beam.class, "ShadowbeamStaffBeam", 0, ThaumicTinkerer.instance, 0, 0, false);
  }

  @Override
  public void onUsingFocusTick(ItemStack stack, EntityPlayer player, int count) {
    ItemWandCasting wand = (ItemWandCasting) stack.getItem();

    if (!player.worldObj.isRemote && wand.consumeAllVis(stack, player, getVisCost(), true, false)) {
      int potency = EnchantmentHelper.getEnchantmentLevel(Config.enchPotency.effectId, wand.getFocusItem(stack));

      if (player.worldObj.rand.nextInt(10) == 0)
        player.worldObj.playSoundAtEntity(player, "thaumcraft:brain", 0.5F, 1F);

      Beam beam = new Beam(player.worldObj, player, potency);
View Full Code Here

  @Override
  public void onUsingFocusTick(ItemStack paramItemStack, EntityPlayer paramEntityPlayer, int paramInt) {
    if (paramEntityPlayer.worldObj.isRemote)
      return;

    ItemWandCasting wand = (ItemWandCasting) paramItemStack.getItem();
    AspectList aspects = wand.getAllVis(paramItemStack);

    Aspect aspectToAdd = null;
    int takes = 0;

    while (aspectToAdd == null && takes < 7) {
      lastGiven = lastGiven == 5 ? 0 : lastGiven + 1;

      Aspect aspect = Aspect.getPrimalAspects().get(lastGiven);

      if (aspects.getAmount(aspect) < wand.getMaxVis(paramItemStack))
        aspectToAdd = aspect;

      ++takes;
    }

    if (aspectToAdd != null) {
      int xpUse = getXpUse(paramItemStack);
      if (paramEntityPlayer.experienceTotal >= xpUse) {
        ExperienceHelper.drainPlayerXP(paramEntityPlayer, xpUse);
        wand.storeVis(paramItemStack, aspectToAdd, Math.min(wand.getMaxVis(paramItemStack), wand.getVis(paramItemStack, aspectToAdd) + 500));
      }
    }
  }
View Full Code Here

      }

      ItemStack wand = getStackInSlot(1);

      if (wand != null && wand.getItem() instanceof ItemWandCasting && !((ItemWandCasting) wand.getItem()).isStaff(wand)) {
        ItemWandCasting wandItem = (ItemWandCasting) wand.getItem();
        AspectList wandAspects = wandItem.getAllVis(wand);

        int missing, onWand;
        List<Aspect> aspectsThatCanGet = new ArrayList();

        for (Aspect aspect : LibFeatures.PRIMAL_ASPECTS) {
          missing = totalAspects.getAmount(aspect) - currentAspects.getAmount(aspect);
          onWand = wandAspects.getAmount(aspect);

          if (missing > 0 && onWand >= 100)
            aspectsThatCanGet.add(aspect);
        }

        int i = aspectsThatCanGet.isEmpty() ? 0 : worldObj.rand.nextInt(aspectsThatCanGet.size());
        Aspect aspect = aspectsThatCanGet.isEmpty() ? null : aspectsThatCanGet.get(i);

        if (aspect != null) {
          wandItem.consumeAllVisCrafting(wand, null, new AspectList().add(aspect, 1), true);
          currentAspects.add(aspect, 1);
          Tuple4Int p = pillars.get(i);
          if (worldObj.rand.nextBoolean()) {
            Thaumcraft.proxy.blockRunes(worldObj, p.i1, p.i4 - 0.75, p.i3, 0.3F + worldObj.rand.nextFloat() * 0.7F, 0.0F, 0.3F + worldObj.rand.nextFloat() * 0.7F, 15, worldObj.rand.nextFloat() / 8F);
            Thaumcraft.proxy.blockRunes(worldObj, xCoord, yCoord + 0.25, zCoord, 0.3F + worldObj.rand.nextFloat() * 0.7F, 0.0F, 0.3F + worldObj.rand.nextFloat() * 0.7F, 15, worldObj.rand.nextFloat() / 8F);
View Full Code Here

      int xpos = 4;
      int ypos = up ? 50 : event.resolution.getScaledHeight() - 70;

      ItemStack item = ClientHelper.clientPlayer().getCurrentEquippedItem();
      if (item != null && item.getItem() instanceof ItemWandCasting) {
        ItemWandCasting wand = (ItemWandCasting) item.getItem();
        wand.getFocusItem(item);
        IWandFocus focus = wand.getFocus(item);

        if (focus != null && focus instanceof ItemFocusDislocation) {
          ItemStack pickedBlock = ((ItemFocusDislocation) focus).getPickedBlock(item);
          if (pickedBlock != null) {
            Gui.drawRect(xpos - 1, ypos - 1, xpos + 18, ypos + 18, 0x66000000);
View Full Code Here

import java.util.List;

public class EnderStorageFunctions {
  public static ItemStack onFocusRightClick(ItemStack stack, World world, EntityPlayer p, MovingObjectPosition pos) {
    ItemWandCasting wand = (ItemWandCasting) stack.getItem();
    ItemStack focus=wand.getFocusItem(stack);
    if(world.isRemote)
      return stack;
    if(!focus.hasTagCompound())
      focus.setTagCompound(new NBTTagCompound());
    if(pos!=null)
    {
      TileEntity tile = world.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);


            if (tile instanceof TileEntityEnderChest && p.isSneaking()) {
        TileEnderChest chest = (TileEnderChest)tile;

        focus.getTagCompound().setInteger("freq", chest.freq);
        focus.getTagCompound().setString("owner", chest.owner);
        focus.getTagCompound().setBoolean("ender", true);
        wand.setFocus(stack, focus);
        return stack;
      }
            if (world.getBlock(pos.blockX, pos.blockY, pos.blockZ) == Blocks.obsidian && p.isSneaking()) {

        focus.getTagCompound().setInteger("freq", -1);
                focus.getTagCompound().setString("owner", p.getGameProfile().getName());
                focus.getTagCompound().setBoolean("ender", false);
        wand.setFocus(stack, focus);
        return stack;
      }
    }
    boolean vanilla=!focus.getTagCompound().getBoolean("ender");

        if (wand.consumeAllVis(stack, p, ItemFocusEnderChest.visUsage, true, false)) {
            if(vanilla)
      {
        p.displayGUIChest(p.getInventoryEnderChest());
        world.playSoundAtEntity(p, "mob.endermen.portal", 1F, 1F);
      }
View Full Code Here

  @Override
  public boolean isItemValid(ItemStack par1ItemStack) {
    if (!(par1ItemStack.getItem() instanceof ItemWandCasting) || ((ItemWandCasting) par1ItemStack.getItem()).isStaff(par1ItemStack))
      return false;

    ItemWandCasting wand = (ItemWandCasting) par1ItemStack.getItem();
    return wand.getCap(par1ItemStack).getBaseCostModifier() <= 1F;
  }
View Full Code Here

TOP

Related Classes of thaumcraft.common.items.wands.ItemWandCasting

Copyright © 2018 www.massapicom. 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.