@Override
  public ItemStack onFocusRightClick(
      ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) {
    player.swingItem();
    if (mop != null
        && ThaumcraftApiHelper.consumeVisFromWand(itemstack, player, visCost.copy(), true, false)) {
      int x = mop.blockX;
      int y = mop.blockY;
      int z = mop.blockZ;

      switch (mop.sideHit) {
        case (0):
          {
            y--;
            break;
          }
        case (1):
          {
            y++;
            break;
          }
        case (2):
          {
            z--;
            break;
          }
        case (3):
          {
            z++;
            break;
          }
        case (4):
          {
            x--;
            break;
          }
        case (5):
          {
            x++;
            break;
          }
      }

      if (world.getBlock(x, y, z).isReplaceable(world, x, y, z) || world.isAirBlock(x, y, z)) {
        ItemStack focusStack = ((ItemWandCasting) itemstack.getItem()).getFocusItem(itemstack);

        world.setBlock(x, y, z, TCBlocks.nitorColour);
        TileColouredNitor te = (TileColouredNitor) world.getTileEntity(x, y, z);
        te.setColour(getColour(focusStack));
        world.playSoundEffect(
            mop.blockX + 0.5D, mop.blockY + 0.5D, mop.blockZ + 0.5D, "thaumcraft:zap", 0.25F, 1.0F);
      }
    }

    return itemstack;
  }
Ejemplo n.º 2
0
  private static void setupItemAspects() {
    ItemStack item;
    AspectList list;

    ThaumcraftApi.registerObjectTag(
        new ItemStack(Items.clock),
        new AspectList(new ItemStack(Items.clock)).add((Aspect) aspectTime, 4));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Items.repeater),
        new AspectList(new ItemStack(Items.repeater)).add((Aspect) aspectTime, 2));

    list = new AspectList(new ItemStack(Blocks.log));
    for (int i = 1; i <= 8; i++) {
      item = ItemInterface.getItemStack("log" + i);
      if (item != null) {
        ThaumcraftApi.registerObjectTag(item, list);
      }
    }

    list = new AspectList(new ItemStack(Blocks.planks));
    for (int i = 1; i <= 2; i++) {
      item = ItemInterface.getItemStack("planks" + i);
      if (item != null) {
        ThaumcraftApi.registerObjectTag(item, list);
      }
    }

    list = new AspectList().add(Aspect.ORDER, 5).add(Aspect.ARMOR, 2).add(Aspect.BEAST, 1);
    item = new ItemStack(Config.fHiveBlock);
    ThaumcraftApi.registerObjectTag(item, list);
    ThaumcraftApi.registerObjectTag(new ItemStack(Config.hive), list);

    list = new AspectList().add(Aspect.LIGHT, 1);
    item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "candle"));
    ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);

    list = new AspectList().add(Aspect.DARKNESS, 1);
    item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "stump"));
    ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);

    list = new AspectList(new ItemStack(Blocks.glass)).add(Aspect.SENSES, 1);
    item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "glass"));
    ThaumcraftApi.registerObjectTag(item, list);

    list = new AspectList().add(Aspect.EARTH, 2).add(Aspect.WATER, 2);
    item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "soil"));
    ThaumcraftApi.registerObjectTag(item, new int[] {1}, list);

    list = new AspectList(new ItemStack(Blocks.leaves));
    item = ItemInterface.getItemStack(ForestryHelper.Name, "candle");
    ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);

    list = new AspectList(new ItemStack(Blocks.sapling));
    item = ItemInterface.getItemStack(ForestryHelper.Name, "candle");
    ThaumcraftApi.registerObjectTag(item, list);

    list = new AspectList() /* .add(Aspect.SEED, 1) */.add(Aspect.PLANT, 1);
    item = ItemInterface.getItemStack(ForestryHelper.Name, "candle");
    ThaumcraftApi.registerObjectTag(item, list);

    list = new AspectList().add(Aspect.CRYSTAL, 1).add(Aspect.EARTH, 2);
    item = ItemInterface.getItemStack(ForestryHelper.Name, "candle");
    ThaumcraftApi.registerObjectTag(
        new ItemStack(item.getItem(), 1, ForestryHelper.BlockResource.APATITE.ordinal()),
        list.copy());
    item = ItemInterface.getItemStack(ForestryHelper.Name, "apatite");
    ThaumcraftApi.registerObjectTag(
        new ItemStack(item.getItem(), 1, item.getItemDamage()), list.copy().add(Aspect.CRYSTAL, 2));

    list = new AspectList().add(Aspect.MOTION, 2).add(Aspect.FLIGHT, 1);
    item = ItemInterface.getItemStack("beeDroneGE");
    ThaumcraftApi.registerObjectTag(item, list);
    list = list.copy().add(Aspect.GREED, 2).add(Aspect.EXCHANGE, 1);
    item = ItemInterface.getItemStack("beePrincessGE");
    ThaumcraftApi.registerObjectTag(item, list);
    item = ItemInterface.getItemStack("beeQueenGE");
    ThaumcraftApi.registerObjectTag(item, list);
    list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.EXCHANGE, 5);
    item = ItemInterface.getItemStack("beeLarvaeGE");
    ThaumcraftApi.registerObjectTag(item, list);

    item = ItemInterface.getItemStack("scoop");
    list = new AspectList(new ItemStack(item.getItem(), 1, 0)).add(Aspect.TOOL, 2);
    ThaumcraftApi.registerComplexObjectTag(item, list);

    item = ItemInterface.getItemStack("grafter");
    list =
        new AspectList(new ItemStack(item.getItem(), 1, item.getItemDamage())).add(Aspect.TOOL, 2);
    ThaumcraftApi.registerComplexObjectTag(item, list);

    item = ItemInterface.getItemStack("grafterProven");
    list = list.copy().add(Aspect.TOOL, 2).add(Aspect.EXCHANGE, 3);
    ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, item.getItemDamage()), list);

    list = new AspectList().add(Aspect.TRAP, 2);
    ThaumcraftApi.registerObjectTag("beeComb", list);

    list = new AspectList().add(Aspect.SLIME, 1);
    item = ItemInterface.getItemStack("propolis");
    ThaumcraftApi.registerObjectTag(
        new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.NORMAL.ordinal()), list);
    ThaumcraftApi.registerObjectTag(
        new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.SILKY.ordinal()),
        list.copy().add(Aspect.SLIME, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.PULSATING.ordinal()),
        list.copy().add(Aspect.ELDRITCH, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.propolis, 1, PropolisType.UNSTABLE.ordinal()),
        list.copy().add(Aspect.ENTROPY, 1).add(Aspect.EXCHANGE, 1));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.propolis, 1, PropolisType.AIR.ordinal()),
        list.copy().add(Aspect.AIR, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.propolis, 1, PropolisType.WATER.ordinal()),
        list.copy().add(Aspect.WATER, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.propolis, 1, PropolisType.FIRE.ordinal()),
        list.copy().add(Aspect.FIRE, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.propolis, 1, PropolisType.EARTH.ordinal()),
        list.copy().add(Aspect.EARTH, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.propolis, 1, PropolisType.ORDER.ordinal()),
        list.copy().add(Aspect.ORDER, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.propolis, 1, PropolisType.CHAOS.ordinal()),
        list.copy().add(Aspect.ENTROPY, 2));

    list = new AspectList().add(Aspect.PLANT, 2);
    item = ItemInterface.getItemStack("pollen");
    ThaumcraftApi.registerObjectTag(
        new ItemStack(item.getItem(), 1, ForestryHelper.Pollen.NORMAL.ordinal()), list);
    ThaumcraftApi.registerObjectTag(
        new ItemStack(item.getItem(), 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), list.copy());
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.pollen, 1, PollenType.UNUSUAL.ordinal()),
        list.copy().add(Aspect.MAGIC, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.pollen, 1, PollenType.PHASED.ordinal()),
        list.copy().add((Aspect) aspectTime, 2));

    list = new AspectList().add(Aspect.ORDER, 1);
    item = ItemInterface.getItemStack("beeswax");
    ThaumcraftApi.registerObjectTag(
        item, new int[] {item.getItemDamage()}, list.copy().add(Aspect.ORDER, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.wax, 1, WaxType.MAGIC.ordinal()), list.copy().add(Aspect.MAGIC, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.wax, 1, WaxType.SOUL.ordinal()), list.copy().add(Aspect.SOUL, 2));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Config.wax, 1, WaxType.AMNESIC.ordinal()), list.copy().add(Aspect.MIND, 2));

    list = new AspectList().add(Aspect.EXCHANGE, 2).add(Aspect.LIFE, 2);
    item = ItemInterface.getItemStack("honeyDrop");
    ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);

    list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.ENERGY, 2);
    item = ItemInterface.getItemStack("honeydew");
    ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);

    list = new AspectList().add(Aspect.GREED, 1).add(Aspect.LIFE, 4);
    item = ItemInterface.getItemStack("royalJelly");
    ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);

    list = new AspectList().add(Aspect.FIRE, 1).add(Aspect.TRAP, 2);
    item = ItemInterface.getItemStack("phosphor");
    ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list);

    item = Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE);
    ThaumcraftApi.registerObjectTag(
        item, new int[] {item.getItemDamage()}, new AspectList().add(Aspect.LIFE, 6));

    item = Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE);
    ThaumcraftApi.registerObjectTag(
        item, new int[] {item.getItemDamage()}, new AspectList().add(Aspect.DEATH, 6));

    item = Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY);
    ThaumcraftApi.registerObjectTag(
        item, new int[] {item.getItemDamage()}, new AspectList().add(Aspect.ARMOR, 6));

    item = Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME);
    ThaumcraftApi.registerObjectTag(
        item,
        new int[] {item.getItemDamage()},
        new AspectList().add(Aspect.VOID, 6).add((Aspect) aspectTime, 8));
  }
  @Override
  public AspectList getVisCost(ItemStack focusStack) {

    return visCost.copy();
  }
Ejemplo n.º 4
0
  private static void registerItemAspects() {
    AspectList oldAspects =
        ThaumcraftCraftingManager.getObjectTags(new ItemStack(RegisteredBlocks.blockStoneMachine));

    ThaumcraftApi.registerObjectTag(
        new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine)),
        new int[] {11, 15},
        new AspectList());
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine)),
        new int[] {0},
        oldAspects);

    AspectList pylon =
        new AspectList()
            .add(Aspect.WATER, 10)
            .add(Aspect.MAGIC, 12)
            .add(Aspect.VOID, 4)
            .add(Aspect.MECHANISM, 4);
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockAuraPylon)),
        new int[] {0},
        pylon);
    pylon =
        new AspectList()
            .add(Aspect.FIRE, 10)
            .add(Aspect.AURA, 12)
            .add(Aspect.MAGIC, 8)
            .add(Aspect.LIGHT, 4)
            .add(Aspect.MECHANISM, 4);
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockAuraPylon)),
        new int[] {1},
        pylon);

    AspectList packager =
        new AspectList()
            .add(Aspect.TREE, 10)
            .add(Aspect.MECHANISM, 8)
            .add(Aspect.CRAFT, 8)
            .add(Aspect.AURA, 12);
    ThaumcraftApi.registerObjectTag(
        new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine)),
        new int[] {4},
        packager);

    AspectList aspect = new AspectList();
    aspect.add(Aspect.MAGIC, 6).add(Aspect.AURA, 12).add(Aspect.ELDRITCH, 4).add(Aspect.VOID, 10);
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemAuraCore), new int[] {0}, aspect.copy());
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemAuraCore),
        new int[] {1},
        aspect.copy().add(Aspect.AIR, 26));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemAuraCore),
        new int[] {2},
        aspect.copy().add(Aspect.FIRE, 26));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemAuraCore),
        new int[] {3},
        aspect.copy().add(Aspect.WATER, 26));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemAuraCore),
        new int[] {4},
        aspect.copy().add(Aspect.EARTH, 26));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemAuraCore),
        new int[] {5},
        aspect.copy().add(Aspect.ORDER, 26));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemAuraCore),
        new int[] {6},
        aspect.copy().add(Aspect.ENTROPY, 26));

    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemPackage, 1, 0),
        new AspectList().add(Aspect.CLOTH, 2).add(Aspect.BEAST, 2).add(Aspect.ARMOR, 1));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemPackage, 1, 1), new AspectList().add(Aspect.CLOTH, 4));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemFakeLootbag, 1, 0),
        new AspectList().add(Aspect.CLOTH, 2).add(Aspect.BEAST, 2).add(Aspect.ARMOR, 1));
    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredItems.itemFakeLootbag, 1, 1),
        new AspectList().add(Aspect.CLOTH, 4));

    ThaumcraftApi.registerObjectTag(
        new ItemStack(RegisteredBlocks.blockKnowledgeBook),
        new AspectList()
            .add(Aspect.MIND, 8)
            .add(Aspect.MECHANISM, 4)
            .add(Aspect.MAGIC, 6)
            .add(Aspect.ORDER, 4));
  }