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


Java TFCBlocks类代码示例

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


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

示例1: onBlockBreak

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
@SubscribeEvent
public void onBlockBreak(BreakEvent event)
{
	Random rand = event.world.rand;
	
	//Drop nuts from leaves
	if(event.block == TFCBlocks.leaves && rand.nextInt(100) < 10)
	{
		Item nut = null;
		
		switch(event.blockMetadata)
		{
			case 0: nut = CWTFCItems.acorn; break;
			case 3: nut = CWTFCItems.chestnut; break;
			case 5: nut = CWTFCItems.pecan; break;
			case 8: nut = CWTFCItems.pineNut; break;
		}
		
		if(nut != null)
		{
			ItemStack is = ItemFoodTFC.createTag(new ItemStack(nut), CropIndex.getWeight(4, rand));
			event.world.spawnEntityInWorld(new EntityItem(event.world, event.x + 0.5, event.y + 0.5, event.z + 0.5, is));
		}
	}
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:26,代码来源:PlayerHandler.java

示例2: generateRocks

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
private boolean generateRocks(World world, Random random, int i, int j, int k) {
	if ((world.isAirBlock(i, j + 1, k) || world.getBlock(i, j + 1, k) == Blocks.snow || world.getBlock(i, j + 1, k) == TFCBlocks.tallGrass)
			&& (world.getBlock(i, j, k).getMaterial() == Material.grass || world.getBlock(i, j, k).getMaterial() == Material.rock)
			&& world.getBlock(i, j, k).isOpaqueCube()) {
		if (world.rand.nextInt(3) == 0) {
			ItemStack is = getCoreSample(world, i, j, k);
			if (is != null) {
				if (world.setBlock(i, j + 1, k, TFCBlocks.worldItem, 0, 2)) {
					TEWorldItem te = (TEWorldItem) world.getTileEntity(i, j + 1, k);
					te.storage[0] = is;
				}
			}
		}
	}
	return true;
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:17,代码来源:WorldGenBauxiteRocks.java

示例3: onUsedHandler

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
@Override
public boolean onUsedHandler(World world, EntityPlayer player, int x, int y, int z, Block id, int meta, int side, float hitX, float hitY, float hitZ){

    if(TFC_Core.isNaturalStone(world.getBlock(x, y + 1, z)) && TFC_Core.isNaturalStone(world.getBlock(x, y+2, z))) {
        return false;
    }

    int hasChisel = hasChisel(player);
    if( hasChisel >= 0 ){
        if(id == TFCBlocks.stoneIgIn || id == TFCBlocks.stoneIgInSmooth || id == Blocks.StoneIGINDent) {
            world.setBlock(x, y, z, Blocks.StoneIGINDentSmall, meta, 0x2);
        } else if(id == TFCBlocks.stoneIgEx || id == TFCBlocks.stoneIgExSmooth  || id == Blocks.StoneIGEXDent) {
            world.setBlock(x, y, z, Blocks.StoneIGEXDentSmall, meta, 0x2);
        } else if(id == TFCBlocks.stoneSed || id == TFCBlocks.stoneSedSmooth || id == Blocks.StoneSEDDent) {
            world.setBlock(x, y, z, Blocks.StoneSEDDentSmall, meta, 0x2);
        } else if(id == TFCBlocks.stoneMM || id == TFCBlocks.stoneMMSmooth || id == Blocks.StoneMMDent) {
            world.setBlock(x, y, z, Blocks.StoneMMDentSmall, meta, 0x2);
        }

        player.inventory.mainInventory[hasChisel].damageItem(1, player);
    }

    return true;
}
 
开发者ID:raymondbh,项目名称:TFC-Additions,代码行数:25,代码来源:ChiselMode_DentSmall.java

示例4: onPlayerInteract

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerInteract(PlayerInteractEvent event)
{
	if (event.entityPlayer.worldObj.isRemote)
		return;
	
	ItemStack itemInHand = event.entityPlayer.getCurrentEquippedItem();
	if (itemInHand == null) {
		return;
	}
	//Disable interaction between Mek and OpenBlock tanks and TFC Barrels or Vessels **Dupe bug***
	boolean validAction = event.action == Action.RIGHT_CLICK_BLOCK;
			
	if(validAction) {
		Block target = event.world.getBlock(event.x, event.y, event.z);
		if (target == TFCBlocks.barrel || target == TFCBlocks.vessel) {
			String name = itemInHand.getUnlocalizedName();
			if (name.contains("tile.openblocks.tank") || name.contains("tile.MachineBlock2.PortableTank") ||
					name.contains("ImmersiveEngineering.drill") || name.contains("ImmersiveEngineering.chemthrower")
					|| name.contains("ImmersiveEngineering.jerrycan") || name.contains("MachineBlock2")){
				event.setCanceled(true);
				return;
			}
		}
	}
}
 
开发者ID:AnodeCathode,项目名称:TechNodefirmacraftMod,代码行数:27,代码来源:PlayerInteractHandler.java

示例5: registerMudBrickRecipes

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
private static void registerMudBrickRecipes()
{
    for(int i = 0; i < 16; i++)
    {
        GameRegistry.addShapelessRecipe(new ItemStack(BlockList.MudBrickRaws[i], 1, 0), new Object[] { new ItemStack(TFCBlocks.dirt, 1, i), new ItemStack(TFCItems.clayBall, 1, 0), new ItemStack(TFCItems.straw) });
        GameRegistry.addShapelessRecipe(new ItemStack(BlockList.MudBrickRaws[i], 1, 0), new Object[] { new ItemStack(TFCBlocks.sand, 1, i), new ItemStack(TFCItems.clayBall, 1, 0), new ItemStack(TFCItems.straw) });
    }
        
    for(int i = 0; i < Global.STONE_ALL.length - 16; i++)
    {
        GameRegistry.addShapelessRecipe(new ItemStack(BlockList.MudBrickRaws[16 + i], 1, 0), new Object[] { new ItemStack(TFCBlocks.dirt2, 1, i), new ItemStack(TFCItems.clayBall, 1, 0), new ItemStack(TFCItems.straw) });
        GameRegistry.addShapelessRecipe(new ItemStack(BlockList.MudBrickRaws[16 + i], 1, 0), new Object[] { new ItemStack(TFCBlocks.sand2, 1, i), new ItemStack(TFCItems.clayBall, 1, 0), new ItemStack(TFCItems.straw) });
    }

    for(int i = 0; i < 16; i++)
        GameRegistry.addRecipe(new ItemStack(BlockList.MudBricks, 4, i), new Object[] { "mm", "mm", Character.valueOf('m'), new ItemStack(BlockList.MudBrickRaws[i], 1, 1) });
        
    for(int i = 0; i < Global.STONE_ALL.length - 16; i++)
        GameRegistry.addRecipe(new ItemStack(BlockList.MudBricks2, 4, i), new Object[] { "mm", "mm", Character.valueOf('m'), new ItemStack(BlockList.MudBrickRaws[16 + i], 1, 1) });
}
 
开发者ID:Aleksey-Terzi,项目名称:DecorationsTFC,代码行数:21,代码来源:Recipes.java

示例6: getBlockType

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
private int getBlockType(int x, int y, int z) {
	Block block = getWorldObj().getBlock(xCoord + x, yCoord + y, zCoord + z);
	if(block == ModManager.CellarWallBlock) {
		return 0;
	} else if(block == ModManager.CellarDoorBlock) {
		return 1;
	} else if(block == ModManager.CellarShelfBlock || block == TFCBlocks.barrel || block == Blocks.wall_sign || block == Blocks.standing_sign ||
			block.isAir(worldObj, x, y, z)) {
		return 2;
	}
	
	if(ModConfig.isDebugging) {
		System.out.println("Incorrect cellar block at " + x + " " + y + " " + z + " " + block.getUnlocalizedName());
	}
	
	return -1;
}
 
开发者ID:Sladki,项目名称:TFC-Cellars-Addon,代码行数:18,代码来源:TEIceBunker.java

示例7: onBlockDestroyed

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
@Override
public boolean onBlockDestroyed(ItemStack itemStack, World world, Block block, int x, int y, int z, EntityLivingBase player) {
	super.onBlockDestroyed(itemStack, world, block, x, y, z, player);
	
	if(world.isRemote) {
		return false;
	}
	
	if(block == TFCBlocks.ice || block == ModManager.IceBlock) {
		EntityItem entityItem = new EntityItem(world,
				x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModManager.IceBlock, 1));
		world.spawnEntityInWorld(entityItem);
		world.setBlockToAir(x, y, z);
	}
       return true;
   }
 
开发者ID:Sladki,项目名称:TFC-Cellars-Addon,代码行数:17,代码来源:ItemIceSaw.java

示例8: renderInventoryBlock

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) 
{
	Block Firepit = TFCBlocks.firepit;
	Block Pot = CWTFCBlocks.cookingPot;
	
	renderer.setRenderBounds(0, 0, 0, 1, 0.1f, 1);
	renderInvBlock(Firepit, 0, renderer);
	
	renderer.setRenderBounds(0.3125f, 0, 0.3125f, 0.6875f, 0.1f, 0.6875f);
	renderInvBlock(Pot, 0, renderer);
	
	renderer.setRenderBounds(0.25f, 0.1f, 0.25f, 0.75f, 0.3f, 0.75f);
	renderInvBlock(Pot, 0, renderer);
	
	renderer.setRenderBounds(0.3125f, 0.3f, 0.3125f, 0.6875f, 0.4f, 0.6875f);
	renderInvBlock(Pot, 0, renderer);
	
	renderer.setRenderBounds(0.4375f, 0.4f, 0.4375f, 0.5625f, 0.5f, 0.5625f);
	renderInvBlock(Pot, 0, renderer);
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:22,代码来源:RenderCookingPot.java

示例9: killCrop

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的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

示例10: confirmTradeGoods

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
@Override
public void confirmTradeGoods(
        World world,
        ItemTileEntity goodTileEntity,
        ItemStack goodItemStack
        )
{
    TEIngotPile ingotPile = (TEIngotPile)goodTileEntity.TileEntity;
    IInventory inventory = (IInventory)ingotPile;
    int quantity = ItemHelper.getItemStackQuantity(goodItemStack);
    
    if (inventory.getStackInSlot(0).stackSize < quantity)
        return;
    
    ingotPile.injectContents(0, -quantity);

    world.notifyBlockOfNeighborChange(ingotPile.xCoord, ingotPile.yCoord + 1, ingotPile.zCoord, TFCBlocks.ingotPile);

    if (inventory.getStackInSlot(0).stackSize < 1)
        world.setBlockToAir(ingotPile.xCoord, ingotPile.yCoord, ingotPile.zCoord);
}
 
开发者ID:Aleksey-Terzi,项目名称:MerchantsTFC,代码行数:22,代码来源:IngotPileContainer.java

示例11: registerFurnaceRecipes

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
private static void registerFurnaceRecipes() {
	
	if (ModOptions.cfgEnableFurnaceClayFiring) {
		addSmelting(TFCItems.ceramicMold);
		addSmelting(TFCItems.spindleHead);
		addSmelting(TFCItems.potteryJug);
		addSmelting(TFCItems.potterySmallVessel);
		addSmelting(TFCItems.potteryBowl);
		addSmelting(TFCBlocks.vessel);
		addSmelting(TFCItems.fireBrick);
		
		addSmelting(TFCItems.clayMoldAxe);
		addSmelting(TFCItems.clayMoldAxe);
		addSmelting(TFCItems.clayMoldChisel);
		addSmelting(TFCItems.clayMoldHammer);
		addSmelting(TFCItems.clayMoldHoe);
		addSmelting(TFCItems.clayMoldKnife);
		addSmelting(TFCItems.clayMoldMace);
		addSmelting(TFCItems.clayMoldPick);
		addSmelting(TFCItems.clayMoldProPick);
		addSmelting(TFCItems.clayMoldSaw);
		addSmelting(TFCItems.clayMoldScythe);
		addSmelting(TFCItems.clayMoldShovel);
		addSmelting(TFCItems.clayMoldSword);
		addSmelting(TFCItems.clayMoldJavelin);
		
		addSmelting(ModItems.latexBowl);
		addSmelting(ModItems.clayMoldGearPiece);
		addSmelting(ModItems.clayMoldSleeve);
	}
	
	if (ModOptions.cfgEnableFurnaceRubberFiring)
		addSmelting(ModItems.rubberMix, ModItems.rubber, 1);
	
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:36,代码来源:ModRecipes.java

示例12: preInitialize

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
@EventHandler
public void preInitialize(FMLPreInitializationEvent e)
{
	instance = this;		
	
	// Load our settings
	proxy.loadOptions();
	
	proxy.registerTickHandler();
	
	TFCPPFluids.register();	

	TFCPPBlocks.initialise();	

	// Register Key Bindings(Client only)
	proxy.registerKeys();
	// Register KeyBinding Handler (Client only)
	proxy.registerKeyBindingHandler();
	// Register Handler (Client only)
	proxy.registerHandlers();
	// Register Tile Entities
	proxy.registerTileEntities(true);
	// Register Sound Handler (Client only)
	proxy.registerSoundHandler();
	
	TFCPPItems.initialise();
	
	TFCPPFluids.registerFluidContainers();	
	
	// Register Gui Handler
	proxy.registerGuiHandler();	
	// register worldgens
	GameRegistry.registerWorldGenerator(new WorldGenAbyssalFissure(TFCBlocks.lava, 2, true, TFCPPOptions.abyssalFissureRarity).setUnderground(false, 20).setSeed(1), 0);	
	GameRegistry.registerWorldGenerator(new WorldGenAbyssalFissure(TFCBlocks.hotWater, 2, false, TFCPPOptions.abyssalFissureRarity).setUnderground(false, 20).setSeed(2), 0);	
}
 
开发者ID:Wahazar,项目名称:TerraFirmaProgressivePack,代码行数:36,代码来源:TFCPPHelper.java

示例13: initialise

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
public static void initialise()
	{
		System.out.println("[" + TFCPPDetails.ModName + "] Registering Blocks");

		blockSlag = new BlockSlag("blockSlag");
		metalBlock_WeakBlackSteel = new MetalBlock_WeakBlackSteel("metalBlock_WeakBlackSteel");		
		metalBlock_CarbonBlackSteel = new MetalBlock_CarbonBlackSteel("metalBlock_CarbonBlackSteel");
		metalBlock_BlackSteel = new MetalBlock_CarbonBlackSteel("metalBlock_BlackSteel");		
		metalBlock_PigIron = new MetalBlock_PigIron("metalBlock_PigIron");
		moltenWeakBlackSteel = new BlockMoltenWeakBlackSteel();
		moltenCarbonBlackSteel = new BlockMoltenCarbonBlackSteel();
		moltenBlackSteel = new BlockMoltenBlackSteel();		
//		moltenSteel = new BlockMoltenSteel();	
		moltenPigIron = new BlockMoltenPigIron();
		blockTransferLadle_Empty = new TransferLadle_Empty();
		blockTransferLadle_OreBatch = new TransferLadle_OreBatch();
		blockTransferLadle_WeakBlackSteel = new TransferLadle_WeakBlackSteel();
		blockTransferLadle_CarbonBlackSteel = new TransferLadle_CarbonBlackSteel();
		blockTransferLadle_BlackSteel = new TransferLadle_BlackSteel();
		blockTransferLadle_PigIron = new TransferLadle_PigIron();
		blockTransferLadle_Steel = new TransferLadle_Steel();
		blockFluidLeachedUrainite = new BlockFluidLeachedUranite();
		blockFluidHydrochloricAcid = new BlockFluidHydrochloricAcid();
		blockFluidSulfurisedSpodumene = new BlockFluidSulfurisedSpodumene();
		luckyBlock_RadioactiveWaste = new LuckyBlock_RadioactiveWaste("luckyBlock_RadioactiveWaste");
		blockGaseousCarbonOxide = new BlockGaseousCarbonOxide();
		blockGaseousHydroFluoride = new BlockGaseousHydroFluoride();
		blockGaseousEthylene = new BlockGaseousEthylene();
		
		registerBlocks();
		
		System.out.println("[" + TFCPPDetails.ModName + "] Done Registering Blocks");
		
		//change existing blocks
		TFCBlocks.litPumpkin.setLightLevel(10.0f);
		TFCBlocks.stoneIgIn.setHardness(12.0F);
		TFCBlocks.stoneIgEx.setHardness(12.0F);
		TFCBlocks.stoneMM.setHardness(10.0F);

	}
 
开发者ID:Wahazar,项目名称:TerraFirmaProgressivePack,代码行数:41,代码来源:TFCPPBlocks.java

示例14: renderWorldBlock

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
		RenderBlocks renderer) 
{
	int ovenType = 0;
	
	if(block instanceof TFPBrickOven)
		ovenType = ((TFPBrickOven)block).getOvenType();
	
	IIcon cobbleIcon = TFCBlocks.stoneIgExCobble.getIcon(0, ovenType);
	
	if(ovenType > 3)
		cobbleIcon = TFCBlocks.stoneIgInCobble.getIcon(0, ovenType - 4);
			
	renderer.renderAllFaces = true;
	
	renderer.setRenderBounds(0, 0, 0, 1, 1, 1);

	renderer.overrideBlockTexture = cobbleIcon;
	renderer.renderStandardBlock(block, x, y, z);
	renderer.clearOverrideBlockTexture();
	
	renderer.renderStandardBlock(block, x, y, z);
	
	renderer.uvRotateTop = 0;
	renderer.uvRotateBottom = 0;
	renderer.uvRotateWest = 0;
	renderer.uvRotateEast = 0;
	renderer.uvRotateNorth = 0;
	renderer.uvRotateSouth = 0;
	
	renderer.renderAllFaces = false;
	return true;
}
 
开发者ID:StrayWolfe,项目名称:TerrafirmaPunk-Tweaks,代码行数:35,代码来源:TFPBrickOvenRenderer.java

示例15: renderInventoryBlock

import com.bioxx.tfc.api.TFCBlocks; //导入依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) 
{
	int ovenType = 0;
	
	if(block instanceof TFPBrickOven)
		ovenType = ((TFPBrickOven)block).getOvenType();
	
	IIcon cobbleIcon = TFCBlocks.stoneIgExCobble.getIcon(0, ovenType);
	
	if(ovenType > 3)
		cobbleIcon = TFCBlocks.stoneIgInCobble.getIcon(0, ovenType - 4);
	
	renderInvBlock(block, renderer, cobbleIcon);
}
 
开发者ID:StrayWolfe,项目名称:TerrafirmaPunk-Tweaks,代码行数:16,代码来源:TFPBrickOvenRenderer.java


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