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


Java ThaumcraftApiHelper类代码示例

本文整理汇总了Java中thaumcraft.api.ThaumcraftApiHelper的典型用法代码示例。如果您正苦于以下问题:Java ThaumcraftApiHelper类的具体用法?Java ThaumcraftApiHelper怎么用?Java ThaumcraftApiHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player) {
	if ( (research.length() > 0) && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
	for (int x = 0; x <= (MAX_CRAFT_GRID_WIDTH - width); x++ ) {
		for (int y = 0; y <= (MAX_CRAFT_GRID_HEIGHT - height); ++y) {
			if (checkMatch(inv, x, y, false)) {
				return true;
			}
			if (mirrored && checkMatch(inv, x, y, true)) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:18,代码来源:ShapedArcaneRecipe.java

示例2: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
public boolean matches(AspectList itags, ItemStack cat) {
	if ( (catalyst instanceof ItemStack) && !ThaumcraftApiHelper.itemMatches((ItemStack) catalyst, cat, false)) {
		return false;
	}
	else if ( (catalyst instanceof ArrayList) && ( ((ArrayList<ItemStack>) catalyst).size() > 0)) {
		ItemStack[] ores = ((ArrayList<ItemStack>) catalyst).toArray(new ItemStack[] {});
		if (!ThaumcraftApiHelper.containsMatch(false, new ItemStack[] {
			cat
		}, ores)) {
			return false;
		}
	}
	if (itags == null) {
		return false;
	}
	for (Aspect tag : aspects.getAspects()) {
		if (itags.getAmount(tag) < aspects.getAmount(tag)) {
			return false;
		}
	}
	return true;
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:23,代码来源:CrucibleRecipe.java

示例3: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
	if (research.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research)) {
		return false;
	}
    for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
    {
        for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
        {
            if (checkMatch(inv, x, y, false))
            {
                return true;
            }

            if (mirrored && checkMatch(inv, x, y, true))
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:Brandomine,项目名称:Augury,代码行数:25,代码来源:ShapedArcaneRecipe.java

示例4: areItemStacksEqual

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
public static boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy)
  {
if (stack0==null && stack1!=null) return false;
if (stack0!=null && stack1==null) return false;
if (stack0==null && stack1==null) return true;

//nbt
boolean t1=ThaumcraftApiHelper.areItemStackTagsEqualForCrafting(stack0, stack1);		
if (!t1) return false;

if (fuzzy) {
	Integer od = OreDictionary.getOreID(stack0);
	if (od!=-1) {
		ItemStack[] ores = OreDictionary.getOres(od).toArray(new ItemStack[]{});
		if (ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{stack1}, ores))
			return true;
	}
}

//damage
boolean damage = stack0.getItemDamage() == stack1.getItemDamage() ||
		stack1.getItemDamage() == OreDictionary.WILDCARD_VALUE;		

      return stack0.getItem() != stack1.getItem() ? false : (!damage ? false : stack0.stackSize <= stack0.getMaxStackSize() );
  }
 
开发者ID:Brandomine,项目名称:Augury,代码行数:26,代码来源:InfusionRecipe.java

示例5: areItemStacksEqual

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
protected boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy)
  {
if (stack0==null && stack1!=null) return false;
if (stack0!=null && stack1==null) return false;
if (stack0==null && stack1==null) return true;
boolean t1=ThaumcraftApiHelper.areItemStackTagsEqualForCrafting(stack0, stack1);
if (!t1) return false;
if (fuzzy) {
	Integer od = OreDictionary.getOreID(stack0);
	if (od!=-1) {
		ItemStack[] ores = OreDictionary.getOres(od).toArray(new ItemStack[]{});
		if (ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{stack1}, ores))
			return true;
	}
}
      return stack0.getItem() != stack1.getItem() ? false : (stack0.getItemDamage() != stack1.getItemDamage() ? false : stack0.stackSize <= stack0.getMaxStackSize() );
  }
 
开发者ID:Brandomine,项目名称:Augury,代码行数:18,代码来源:InfusionEnchantmentRecipe.java

示例6: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
@Override
public boolean matches(IInventory inv, World world, EntityPlayer player)
{
    if(research.length() > 0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), research))
    {
        return false;
    }
    for(int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
    {
        for(int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
        {
            if(checkMatch(inv, x, y, false))
            {
                return true;
            }

            if(mirrored && checkMatch(inv, x, y, true))
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:J3FF97,项目名称:Steel-Industries,代码行数:26,代码来源:ShapedArcaneRecipe.java

示例7: matches

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
public boolean matches(AspectList itags, ItemStack cat)
{
    if(catalyst instanceof ItemStack && !ThaumcraftApiHelper.itemMatches((ItemStack) catalyst, cat, false))
    {
        return false;
    }
    else if(catalyst instanceof ArrayList && ((ArrayList<ItemStack>) catalyst).size() > 0)
    {
        ItemStack[] ores = ((ArrayList<ItemStack>) catalyst).toArray(new ItemStack[]{});
        if(!ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{cat}, ores)) return false;
    }
    if(itags == null) return false;
    for(Aspect tag : aspects.getAspects())
    {
        if(itags.getAmount(tag) < aspects.getAmount(tag)) return false;
    }
    return true;
}
 
开发者ID:J3FF97,项目名称:Steel-Industries,代码行数:19,代码来源:CrucibleRecipe.java

示例8: areItemStacksEqual

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
public static boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy)
{
    if(stack0 == null && stack1 != null) return false;
    if(stack0 != null && stack1 == null) return false;
    if(stack0 == null && stack1 == null) return true;

    //nbt
    boolean t1 = ThaumcraftApiHelper.areItemStackTagsEqualForCrafting(stack0, stack1);
    if(!t1) return false;

    if(fuzzy)
    {
        Integer od = OreDictionary.getOreID(stack0);
        if(od != -1)
        {
            ItemStack[] ores = OreDictionary.getOres(od).toArray(new ItemStack[]{});
            if(ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{stack1}, ores)) return true;
        }
    }

    //damage
    boolean damage = stack0.getItemDamage() == stack1.getItemDamage() || stack1.getItemDamage() == OreDictionary.WILDCARD_VALUE;

    return stack0.getItem() != stack1.getItem() ? false : (!damage ? false : stack0.stackSize <= stack0.getMaxStackSize());
}
 
开发者ID:J3FF97,项目名称:Steel-Industries,代码行数:26,代码来源:InfusionRecipe.java

示例9: areItemStacksEqual

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
protected boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy)
{
    if(stack0 == null && stack1 != null) return false;
    if(stack0 != null && stack1 == null) return false;
    if(stack0 == null && stack1 == null) return true;
    boolean t1 = ThaumcraftApiHelper.areItemStackTagsEqualForCrafting(stack0, stack1);
    if(!t1) return false;
    if(fuzzy)
    {
        Integer od = OreDictionary.getOreID(stack0);
        if(od != -1)
        {
            ItemStack[] ores = OreDictionary.getOres(od).toArray(new ItemStack[]{});
            if(ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{stack1}, ores)) return true;
        }
    }
    return stack0.getItem() != stack1.getItem() ? false : (stack0.getItemDamage() != stack1.getItemDamage() ? false : stack0.stackSize <= stack0.getMaxStackSize());
}
 
开发者ID:J3FF97,项目名称:Steel-Industries,代码行数:19,代码来源:InfusionEnchantmentRecipe.java

示例10: areItemStacksEqual

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
public static boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy)
  {
if (stack0==null && stack1!=null) return false;
if (stack0!=null && stack1==null) return false;
if (stack0==null && stack1==null) return true;

//nbt
boolean t1=ThaumcraftApiHelper.areItemStackTagsEqualForCrafting(stack0, stack1);		
if (!t1) return false;

if (fuzzy) {
	int od = OreDictionary.getOreID(stack0);
	if (od!=-1) {
		ItemStack[] ores = OreDictionary.getOres(od).toArray(new ItemStack[]{});
		if (ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{stack1}, ores))
			return true;
	}
}

//damage
boolean damage = stack0.getItemDamage() == stack1.getItemDamage() ||
		stack1.getItemDamage() == OreDictionary.WILDCARD_VALUE;		

      return stack0.getItem() != stack1.getItem() ? false : (!damage ? false : stack0.stackSize <= stack0.getMaxStackSize() );
  }
 
开发者ID:SpitefulFox,项目名称:Unthaumic,代码行数:26,代码来源:InfusionRecipe.java

示例11: areItemStacksEqual

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
protected boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy)
  {
if (stack0==null && stack1!=null) return false;
if (stack0!=null && stack1==null) return false;
if (stack0==null && stack1==null) return true;
boolean t1=ThaumcraftApiHelper.areItemStackTagsEqualForCrafting(stack0, stack1);
if (!t1) return false;
if (fuzzy) {
	int od = OreDictionary.getOreID(stack0);
	if (od!=-1) {
		ItemStack[] ores = OreDictionary.getOres(od).toArray(new ItemStack[]{});
		if (ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{stack1}, ores))
			return true;
	}
}
      return stack0.getItem() != stack1.getItem() ? false : (stack0.getItemDamage() != stack1.getItemDamage() ? false : stack0.stackSize <= stack0.getMaxStackSize() );
  }
 
开发者ID:SpitefulFox,项目名称:Unthaumic,代码行数:18,代码来源:InfusionEnchantmentRecipe.java

示例12: onBlockActivated

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) {
    TileNodeManipulator tile = (TileNodeManipulator) world.getTileEntity(x, y, z);
    ItemStack heldItem = player.getHeldItem();
    if(tile.isInMultiblock()) {
        super.onBlockActivated(world, x, y, z, player, side, par7, par8, par9);
    } else if(!world.isRemote && heldItem != null && heldItem.getItem() instanceof ItemWandCasting) {
        tile.checkMultiblock();
        if (tile.isMultiblockStructurePresent()) {
            String research = tile.getMultiblockType().getResearchNeeded();
            if(!ResearchManager.isResearchComplete(player.getCommandSenderName(), research)) return false;
            if (ThaumcraftApiHelper.consumeVisFromWandCrafting(player.getCurrentEquippedItem(), player, tile.getMultiblockType().getMultiblockCosts(), true)) {
                tile.formMultiblock();
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:20,代码来源:BlockNodeManipulator.java

示例13: fillJar

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
private void fillJar() {
    TileEntity te = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.DOWN);
    if (te != null) {
        IEssentiaTransport ic = (IEssentiaTransport) te;
        if (!ic.canOutputTo(ForgeDirection.UP)) {
            return;
        }
        Aspect ta = null;
        if (this.aspectFilter != null) {
            ta = this.aspectFilter;
        } else if ((this.aspect != null) && (this.amount > 0)) {
            ta = this.aspect;
        } else if ((ic.getEssentiaAmount(ForgeDirection.UP) > 0) &&
                (ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN)) && (getSuctionAmount(ForgeDirection.DOWN) >= ic.getMinimumSuction())) {
            ta = ic.getEssentiaType(ForgeDirection.UP);
        }
        if ((ta != null) && (ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN))) {
            addToContainer(ta, ic.takeEssentia(ta, 1, ForgeDirection.UP));
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:22,代码来源:TileBlockProtector.java

示例14: fillJar

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
private void fillJar() {
    ForgeDirection inputDir = placedOn.getOpposite();

    TileEntity te = ThaumcraftApiHelper.getConnectableTile(parent.getWorldObj(), parent.xCoord, parent.yCoord, parent.zCoord, inputDir);
    if (te != null)
    {
        IEssentiaTransport ic = (IEssentiaTransport)te;
        if (!ic.canOutputTo(ForgeDirection.DOWN)) {
            return;
        }
        Aspect ta = null;
        if (parent.aspectFilter != null) {
            ta = parent.aspectFilter;
        } else if ((parent.aspect != null) && (parent.amount > 0)) {
            ta = parent.aspect;
        } else if ((ic.getEssentiaAmount(inputDir.getOpposite()) > 0) &&
                (ic.getSuctionAmount(inputDir.getOpposite()) < getSuctionAmount(ForgeDirection.UP)) && (getSuctionAmount(ForgeDirection.UP) >= ic.getMinimumSuction())) {
            ta = ic.getEssentiaType(inputDir.getOpposite());
        }
        if ((ta != null) && (ic.getSuctionAmount(inputDir.getOpposite()) < getSuctionAmount(ForgeDirection.UP))) {
            addToContainer(ta, ic.takeEssentia(ta, 1, inputDir.getOpposite()));
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:25,代码来源:TileStickyJar.java

示例15: playVortexEffects

import thaumcraft.api.ThaumcraftApiHelper; //导入依赖的package包/类
private void playVortexEffects() {
    for (int a = 0; a < Thaumcraft.proxy.particleCount(1); a++) {
        int tx = this.xCoord + this.worldObj.rand.nextInt(4) - this.worldObj.rand.nextInt(4);
        int ty = this.yCoord + 1 + this.worldObj.rand.nextInt(4) - this.worldObj.rand.nextInt(4);
        int tz = this.zCoord + this.worldObj.rand.nextInt(4) - this.worldObj.rand.nextInt(4);
        if (ty > this.worldObj.getHeightValue(tx, tz)) {
            ty = this.worldObj.getHeightValue(tx, tz);
        }
        Vec3 v1 = Vec3.createVectorHelper(this.xCoord + 0.5D, this.yCoord + 1.5D, this.zCoord + 0.5D);
        Vec3 v2 = Vec3.createVectorHelper(tx + 0.5D, ty + 0.5D, tz + 0.5D);

        MovingObjectPosition mop = ThaumcraftApiHelper.rayTraceIgnoringSource(this.worldObj, v1, v2, true, false, false);
        if ((mop != null) && (getDistanceFrom(mop.blockX, mop.blockY, mop.blockZ) < 16.0D)) {
            tx = mop.blockX;
            ty = mop.blockY;
            tz = mop.blockZ;
            Block bi = this.worldObj.getBlock(tx, ty, tz);
            int md = this.worldObj.getBlockMetadata(tx, ty, tz);
            if (!bi.isAir(this.worldObj, tx, ty, tz)) {
                Thaumcraft.proxy.hungryNodeFX(this.worldObj, tx, ty, tz, this.xCoord, this.yCoord + 1, this.zCoord, bi, md);
            }
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:25,代码来源:TileEssentiaCompressor.java


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