Package thaumcraft.api.aspects

Examples of thaumcraft.api.aspects.Aspect


        GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        ItemInfusedSeeds item = (ItemInfusedSeeds) itemstack.getItem();
        IIcon icon = item.getIconIndex(itemstack);
        Aspect aspect = item.getAspect(itemstack);
        if (type == ItemRenderType.INVENTORY) {
            renderItemInInventory(itemstack, aspect, icon);
        } else if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
            renderItemInEquipped(itemstack, aspect, icon);
        } else {
View Full Code Here


    return new Object[]{ returnStuff };
  }

  public static Object[] getAspectCount(IAspectContainer container, String aspectName) {

    Aspect aspect = Aspect.getAspect(aspectName);

    if (container.getAspects() == null)
      return new Object[]{ 0 };

    return new Object[]{ container.getAspects().getAmount(aspect) };
View Full Code Here

    }

    @Override
    public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
        GL11.glPushMatrix();
        Aspect aspect = BlockInfusedGrain.getAspect(world, x, y, z);

        GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
        if (aspect != null && !aspect.isPrimal()) {
            //Hex to RGB code from vanilla tesselator
            float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F;
            float g = (aspect.getColor() >> 8 & 0xFF) / 255.0F;
            float b = (aspect.getColor() & 0xFF) / 255.0F;

            GL11.glColor4f(r, g, b, 1F);
            Tessellator.instance.setColorRGBA_I(aspect.getColor(), 255);
        }

        renderer.setOverrideBlockTexture(block.getIcon(world, x, y, z, world.getBlockMetadata(x, y, z)));
        Tessellator tessellator = Tessellator.instance;
        tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
View Full Code Here

      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;
View Full Code Here

          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);
View Full Code Here

        }
        if (sum > MAX_ASPECTS) {
            int toRemove = sum - 20;
            while (toRemove > 0) {
                Random rand = new Random();
                Aspect target = aspectList.getAspects()[rand.nextInt(aspectList.getAspects().length)];
                aspectList.remove(target, 1);
                toRemove--;
            }
        }
    }
View Full Code Here

            for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
                TileEntity entity = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
                if (entity instanceof TileInfusedGrain) {
                    //Exchange aspects
                    TileInfusedGrain tileInfusedGrain = (TileInfusedGrain) entity;
                    Aspect aspect = tileInfusedGrain.aspect;
                    if (aspect.isPrimal()) {
                        if (primalTendencies.getAmount(aspect) < 5) {
                            primalTendencies.add(aspect, 1);
                            reduceSaturatedAspects();

                            worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
                            if (worldObj.isRemote) {
                                for (int i = 0; i < 50; i++) {
                                    ThaumicTinkerer.tcProxy.essentiaTrailFx(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, xCoord, yCoord, zCoord, 50, aspect.getColor(), 1F);
                                }
                            }
                            return;
                        }
                    } else {
                        AspectList targetList = tileInfusedGrain.primalTendencies;
                        if (targetList.getAspects().length == 0 || targetList.getAspects()[0] == null) {
                            return;
                        }

                        aspect = targetList.getAspects()[worldObj.rand.nextInt(targetList.getAspects().length)];
                        if (targetList.getAmount(aspect) >= primalTendencies.getAmount(aspect)) {
                            primalTendencies.add(aspect, 1);
                            targetList.reduce(aspect, 1);
                            reduceSaturatedAspects();
                            if (worldObj.isRemote) {
                                for (int i = 0; i < 50; i++) {
                                    ThaumicTinkerer.tcProxy.essentiaTrailFx(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, xCoord, yCoord, zCoord, 50, aspect.getColor(), 1F);
                                }
                            }

                            worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
                        }
View Full Code Here

        }
        if (sum > 50) {
            int toRemove = sum - 50;
            while (toRemove > 0) {
                Random rand = new Random();
                Aspect target = primalTendencies.getAspects()[rand.nextInt(primalTendencies.getAspects().length)];
                primalTendencies.remove(target, 1);
                toRemove--;
            }
        }
    }
View Full Code Here

      if (!worldObj.isRemote) {
        ItemJarFilled item = (ItemJarFilled) jar.getItem();

        AspectList aspectList = item.getAspects(jar);
        if (aspectList != null && aspectList.size() == 1) {
          Aspect aspect = aspectList.getAspects()[0];

          TileEntity tile = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
          if (tile != null && tile instanceof TileEntityHopper) {
            TileEntity tile1 = getHopperFacing(tile.xCoord, tile.yCoord, tile.zCoord, tile.getBlockMetadata());
            if (tile1 instanceof TileJarFillable) {
View Full Code Here

    private void fertilizeSoil(World world, int x, int y, int z, int metadata) {
        if (metadata >= 7) {
            do {
                if (world.getTileEntity(x, y - 1, z) instanceof TileInfusedFarmland) {
                    Aspect currentAspect = getAspect(world, x, y, z);
                    ((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).aspectList.add(currentAspect, 1);
                    ((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).reduceSaturatedAspects();
                    world.markBlockForUpdate(x, y - 1, z);
                }
            } while (world.rand.nextInt(55) < getPrimalTendencyCount(world, x, y, z, Aspect.EARTH));
View Full Code Here

TOP

Related Classes of thaumcraft.api.aspects.Aspect

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.