• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TFCOptions类的典型用法和代码示例

java 2次浏览

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

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

示例1: updateLampFuel

点赞 3

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
/**
 *  Updates the fuel timer of the lamp. Set burn to false to update the timer without consuming fuel, for when the lamp was off.
 * @param burn
 */
public void updateLampFuel(Boolean burn)
{
    if((int) TFC_Time.getTotalHours() - TFCOptions.oilLampFuelMult >= hourPlaced)
    {
        int diff = burn ? (int) TFC_Time.getTotalHours() - this.hourPlaced : 0; // Don't burn any fuel if set to false.
        this.hourPlaced = (int)TFC_Time.getTotalHours();

        if(fuel != null && getFuel().getFluid() != TFCFluids.LAVA && this.getFuelAmount() > 0)
        {
            fuel.amount -= diff;
            if(fuel.amount <= 0)
                fuel = null;
        }
    }
}
 

开发者ID:Bunsan,
项目名称:TerraFirmaStuff,
代码行数:20,
代码来源:TEOilLampMod.java

示例2: addFoodInformation

点赞 3

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public void addFoodInformation(ItemStack is, EntityPlayer player, List<String> arraylist)
{
	float ounces = Helper.roundNumber(Food.getWeight(is), 100);
	if (ounces > 0 && ounces <= getMaxFoodWt())
		arraylist.add(TFC_Core.translate("gui.food.amount") + " " + ounces + " oz / " + getMaxFoodWt() + " oz");

	float decay = Food.getDecay(is);
	if (decay > 0)
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + " " + Helper.roundNumber(decay / ounces * 100, 10) + "%");
	if (TFCOptions.enableDebugMode)
	{
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + ": " + decay);
		arraylist.add(EnumChatFormatting.DARK_GRAY + "Decay Rate: " + Helper.roundNumber(getDecayRate(is), 100));
	}

	if (TFC_Core.showCtrlInformation())
		ItemFoodTFC.addTasteInformation(is, player, arraylist);
	else
		arraylist.add(TFC_Core.translate("gui.showtaste"));
}
 

开发者ID:StrayWolfe,
项目名称:Cooking-with-TFC,
代码行数:22,
代码来源:ItemTFCFoodTransform.java

示例3: addFoodInformation

点赞 3

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public void addFoodInformation(ItemStack is, EntityPlayer player, List<String> arraylist)
{
	float ounces = roundNumber(Food.getWeight(is), 100);
	if (ounces > 0 && ounces <= maxFoodWt)
		arraylist.add(TFC_Core.translate("gui.food.amount") + " " + ounces + " oz / " + maxFoodWt + " oz");

	float decay = Food.getDecay(is);
	if (decay > 0)
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + " " + roundNumber(decay / ounces * 100, 10) + "%");
	if (TFCOptions.enableDebugMode)
	{
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + ": " + decay);
		arraylist.add(EnumChatFormatting.DARK_GRAY + "Decay Rate: " + roundNumber(this.getDecayRate(is), 100));
	}

	if (TFC_Core.showCtrlInformation())
		ItemFoodTFC.addTasteInformation(is, player, arraylist);
	else
		arraylist.add(TFC_Core.translate("gui.showtaste"));
}
 

开发者ID:StrayWolfe,
项目名称:Cooking-with-TFC,
代码行数:22,
代码来源:ItemTFCAdjutableFood.java

示例4: onBlockAdded

点赞 3

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public void onBlockAdded(World world, int i, int j, int k)
{
	int meta = world.getBlockMetadata(i, j, k);
	float growSpeed = 1;
	if(meta == 0)
		growSpeed = 1.4f;
	
	if (world.getTileEntity(i, j, k) instanceof TESapling)
	{
		TESapling te = (TESapling) world.getTileEntity(i, j, k);
		
		if (te != null && te.growTime == 0)
			te.growTime = (long) (TFC_Time.getTotalTicks() + (TFC_Time.DAY_LENGTH * 7 * growSpeed * TFCOptions.saplingTimerMultiplier) + (world.rand.nextFloat() * TFC_Time.DAY_LENGTH));
	}
}
 

开发者ID:StrayWolfe,
项目名称:Cooking-with-TFC,
代码行数:17,
代码来源:BlockCustomSapling.java

示例5: onBlockActivated

点赞 3

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ)
{
	if(!world.isRemote)
	{
		TileCrop te = (TileCrop)world.getTileEntity(x, y, z);
		CWTFCCropIndex crop = CropManager.getInstance().getCropFromId(te.getCropID());
		
		if(TFCOptions.enableDebugMode)
		{
			TerraFirmaCraft.LOG.info("Crop ID: " + te.getCropID());
			TerraFirmaCraft.LOG.info("Est Growth: " + te.getEstimatedGrowth(crop));
		}
	}
	
	return false;
}
 

开发者ID:StrayWolfe,
项目名称:Cooking-with-TFC,
代码行数:18,
代码来源:BlockCrop.java

示例6: killCrop

点赞 3

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
public void killCrop(CWTFCCropIndex crop)
{
	ItemStack is = crop.getSeed();
	is.stackSize = 1;
	
	if (TFC_Core.isFarmland(worldObj.getBlock(xCoord, yCoord - 1, zCoord)) && TFCOptions.enableSeedDrops)
	{
		if(worldObj.setBlock(xCoord, yCoord, zCoord, TFCBlocks.worldItem))
		{
			TEWorldItem te = (TEWorldItem) worldObj.getTileEntity(xCoord, yCoord, zCoord);
			te.storage[0] = is;
			worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
		}				
	}
	else
	{
		worldObj.setBlockToAir(xCoord, yCoord, zCoord);
	}
}
 

开发者ID:StrayWolfe,
项目名称:Cooking-with-TFC,
代码行数:20,
代码来源:TileCrop.java

示例7: processCommand

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public void processCommand(ICommandSender sender, String[] params) {
	EntityPlayerMP player = getCommandSenderAsPlayer(sender);

	if (!TFCOptions.enableDebugMode) {
		TFC_Core.sendInfoMessage(player, new ChatComponentText("Debug Mode Required"));
		return;
	}

	TFC_Core.sendInfoMessage(player, new ChatComponentText("Generating Hevea Tree"));
	WorldGenerator treeGen = new WorldGenHeveaTree();
	if (!treeGen.generate(sender.getEntityWorld(), sender.getEntityWorld().rand, (int) player.posX, (int) player.posY, (int) player.posZ))
		TFC_Core.sendInfoMessage(player, new ChatComponentText("Generation Failed"));
}
 

开发者ID:Shurgent,
项目名称:TFCTech,
代码行数:15,
代码来源:GenHeveaCommand.java

示例8: onBlockAdded

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public void onBlockAdded(World world, int i, int j, int k) {
	float growSpeed = 1.6F;

	if (world.getTileEntity(i, j, k) instanceof TESapling) {
		TESapling te = (TESapling) world.getTileEntity(i, j, k);

		// Set the growTime tick timestamp to be 7-11.2 days times config multiplier from now, plus up to an extra day.
		if (te != null && te.growTime == 0)
			te.growTime = (long) (TFC_Time.getTotalTicks() + (TFC_Time.DAY_LENGTH * 7 * growSpeed * TFCOptions.saplingTimerMultiplier) + (world.rand
					.nextFloat() * TFC_Time.DAY_LENGTH));
	}
}
 

开发者ID:Shurgent,
项目名称:TFCTech,
代码行数:14,
代码来源:BlockModHeveaSapling.java

示例9: getMetalReturnAmount

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public short getMetalReturnAmount(ItemStack is) {
	int dam = is.getItemDamage();
	switch (dam) {
	case 0:
		return (short) TFCOptions.smallOreUnits;
	}
	return 0;
}
 

开发者ID:Shurgent,
项目名称:TFCTech,
代码行数:10,
代码来源:ItemModOreSmall.java

示例10: getMetalReturnAmount

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public short getMetalReturnAmount(ItemStack is) {
	int dam = is.getItemDamage();
	switch (dam) {
	case 0:
		return (short) TFCOptions.normalOreUnits;
	case 1:
		return (short) TFCOptions.richOreUnits;
	case 2:
		return (short) TFCOptions.poorOreUnits;
	}
	return 0;
}
 

开发者ID:Shurgent,
项目名称:TFCTech,
代码行数:14,
代码来源:ItemModOre.java

示例11: getMetalReturnAmount

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public short getMetalReturnAmount(ItemStack is) 
{
	switch (is.getItemDamage()) 
	{
		case 0: return (short) TFCOptions.normalOreUnits;
		case 1: return (short) TFCOptions.richOreUnits;
		case 2: return (short) TFCOptions.poorOreUnits;
		default: return 0;
	}
}
 

开发者ID:StrayWolfe,
项目名称:TerrafirmaPunk-Tweaks,
代码行数:12,
代码来源:ItemTFPOre.java

示例12: getMetalReturnAmount

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public short getMetalReturnAmount(ItemStack is)
{
	switch (is.getItemDamage())
	{
		case 0: return (short) TFCOptions.smallOreUnits;
		default: return 0;
	}
}
 

开发者ID:StrayWolfe,
项目名称:TerrafirmaPunk-Tweaks,
代码行数:10,
代码来源:ItemTFPOreSmall.java

示例13: onBlockPlacedBy

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityliving, ItemStack is)
{
    if(TFCOptions.enableDebugMode && world.isRemote)
    {
        int metadata = world.getBlockMetadata(x, y, z);
        LogHelper.info("Meta=" + (new StringBuilder()).append(getUnlocalizedName()).append(":").append(metadata).toString());
    }
}
 

开发者ID:Bunsan,
项目名称:TerraFirmaStuff,
代码行数:10,
代码来源:BlockBase.java

示例14: onBlockActivated

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ)
{
    if(TFCOptions.enableDebugMode && world.isRemote)
    {
        int metadata = world.getBlockMetadata(x, y, z);
        LogHelper.info("Meta = " + (new StringBuilder()).append(getUnlocalizedName()).append(":").append(metadata).toString());
    }
    return false;
}
 

开发者ID:Bunsan,
项目名称:TerraFirmaStuff,
代码行数:11,
代码来源:BlockBase.java

示例15: onBlockActivated

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ)
{
    if(TFCOptions.enableDebugMode && world.isRemote)
    {
        int metadata = world.getBlockMetadata(x, y, z);
        LogHelper.info("Meta = " + (new StringBuilder()).append(getUnlocalizedName()).append(":").append(metadata).toString());

    }
    return false;
}
 

开发者ID:Bunsan,
项目名称:TerraFirmaStuff,
代码行数:12,
代码来源:BlockRotatableBase.java

示例16: getFuel

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
public FluidStack getFuel()
{
    if(fuel == null)
        return null;
    FluidStack f = fuel.copy();
    f.amount /= TFCOptions.oilLampFuelMult;
    return f;
}
 

开发者ID:Bunsan,
项目名称:TerraFirmaStuff,
代码行数:9,
代码来源:TEOilLampMod.java

示例17: oilLampBody

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
public List<String> oilLampBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
{
    NBTTagCompound tag = accessor.getNBTData();
    if (tag.hasKey("Fuel"))
    {
        FluidStack fuel = FluidStack.loadFluidStackFromNBT(tag.getCompoundTag("Fuel"));
        int hours = fuel.amount * TFCOptions.oilLampFuelMult / 8;
        if (fuel.getFluid() == TFCFluids.OLIVEOIL)
            currenttip.add(hours + " " + TFC_Core.translate("gui.hoursRemaining") + " (" + Helper.roundNumber((hours / (250f * TFCOptions.oilLampFuelMult)) * 100f, 10) + "%)");
        else if (fuel.getFluid() == TFCFluids.LAVA)
            currenttip.add(TFC_Core.translate("gui.infinite") + " " + TFC_Core.translate("gui.hoursRemaining"));
    }
    return currenttip;
}
 

开发者ID:Bunsan,
项目名称:TerraFirmaStuff,
代码行数:15,
代码来源:WAILADataMod.java

示例18: addFoodInformation

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
public void addFoodInformation(ItemStack is, EntityPlayer player, List<String> arraylist)
{
	float ounces = Helper.roundNumber(Food.getWeight(is), 100);
	if (ounces > 0)
		arraylist.add(TFC_Core.translate("gui.food.amount") + " " + ounces + " oz / " + getFoodMaxWeight(is) + " oz");
	float decay = Food.getDecay(is);
	if (decay > 0)
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + " " + Helper.roundNumber(decay / ounces * 100, 10) + "%");
	if (TFCOptions.enableDebugMode)
	{
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + ": " + decay);
		arraylist.add(EnumChatFormatting.DARK_GRAY + "Decay Rate: " + this.getDecayRate(is));
	}

	if (TFC_Core.showCtrlInformation())
		ItemFoodTFC.addTasteInformation(is, player, arraylist);
	else
		arraylist.add(TFC_Core.translate("gui.showtaste"));
	
	if(TFC_Core.showShiftInformation() && Food.getFoodGroups(is).length > 0)
	{			
		int[] fg = Food.getFoodGroups(is);
		for (int i = 0; i < fg.length; i++)
		{
			if (fg[i] != -1)
				arraylist.add(localize(fg[i]));
		}
	}
	else
		arraylist.add(TFC_Core.translate("gui.showIngreds"));
}
 

开发者ID:StrayWolfe,
项目名称:Cooking-with-TFC,
代码行数:32,
代码来源:ItemTFCMealTransform.java

示例19: addDrops

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
private void addDrops(EntityPlayer entityplayer, World world, int x,int y, int z, int meta, boolean isScythe)
{
	entityplayer.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
	entityplayer.addExhaustion(isScythe ? 0.045F : 0.025F);
	if (world.rand.nextInt(100) < (isScythe ? 28 : 11))
		dropBlockAsItem(world, x, y, z, new ItemStack(TFCItems.stick, 1));
	else if (world.rand.nextInt(100) < (isScythe ? 4 : 2) && TFCOptions.enableSaplingDrops)
		dropBlockAsItem(world, x, y, z, new ItemStack(getItemDropped(0, null, 0), 1, meta));
	
	if(world.rand.nextInt(100) < (isScythe ? 8 : 6))
	{
		Item nut = null;
		
		switch(meta)
		{
			case 0: nut = CWTFCItems.walnut;
		}
		
		if(nut != null)
			dropBlockAsItem(world, x, y, z, ItemFoodTFC.createTag(new ItemStack(nut), CropIndex.getWeight(4, world.rand)));
	}
		
	
	if(isScythe)
	{
		dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
		if(world.rand.nextInt(100) < 30)
			dropBlockAsItem(world, x, y, z, new ItemStack(TFCItems.stick, 1));
		world.setBlockToAir(x, y, z);
	}
}
 

开发者ID:StrayWolfe,
项目名称:Cooking-with-TFC,
代码行数:32,
代码来源:BlockLeaves.java

示例20: setFuelFromStack

点赞 2

import com.bioxx.tfc.api.TFCOptions; //导入依赖的package包/类
public void setFuelFromStack(FluidStack fs)
{
    fuel = fs;
    fuel.amount *= TFCOptions.oilLampFuelMult;
}
 

开发者ID:Bunsan,
项目名称:TerraFirmaStuff,
代码行数:6,
代码来源:TEOilLampMod.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)