當前位置: 首頁>>代碼示例>>Java>>正文


Java BlockPlanks類代碼示例

本文整理匯總了Java中net.minecraft.block.BlockPlanks的典型用法代碼示例。如果您正苦於以下問題:Java BlockPlanks類的具體用法?Java BlockPlanks怎麽用?Java BlockPlanks使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BlockPlanks類屬於net.minecraft.block包,在下文中一共展示了BlockPlanks類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readCustomNBT

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
@Override
public void readCustomNBT(NBTTagCompound nbt){
	super.readCustomNBT(nbt);
	for(EnumFacing facing : EnumFacing.HORIZONTALS){
		if(nbt.hasKey(facing.getName().toLowerCase())){
			NBTTagCompound nbtFace = nbt.getCompoundTag(facing.getName().toLowerCase());
			if(nbtFace.hasKey("BaseType")){
				int type = nbtFace.getInteger("BaseType");
				BlockPlanks.EnumType base = BlockPlanks.EnumType.byMetadata(type);
				setBase(facing, base);
			}
			else if(nbtFace.hasKey("HasBase")){
				setBase(facing, BlockPlanks.EnumType.OAK);
			}
			else {
				setBase(facing, null);
			}
			//setBase(facing, nbtFace.getBoolean("HasBase"));
			setPost(facing, 0, nbtFace.getBoolean("HasLeftPost"));
			setPost(facing, 1, nbtFace.getBoolean("HasRightPost"));
			setPost(facing, 2, nbtFace.getBoolean("HasTopPost"));
		}
	}
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:25,代碼來源:TileBridge.java

示例2: runTest

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
@Override
protected void runTest() {
    final ItemStack oakLog = new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.OAK.getMetadata());
    assertRegistered(oakLog, "logWood");
    assertNotRegistered(oakLog, "blahblahblah");

    final ItemStack jungleLog = new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.JUNGLE.getMetadata());
    assertRegistered(jungleLog, "logWood");

    final ItemStack ironIngot = new ItemStack(Items.IRON_INGOT);
    assertRegistered(ironIngot, "ingotIron");

    final ItemStack stone = new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.STONE.getMetadata());
    assertRegistered(stone, "stone");

    final ItemStack andesite = new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.ANDESITE.getMetadata());
    assertNotRegistered(andesite, "stone");

    final ItemStack record13 = new ItemStack(Items.RECORD_13);
    assertRegistered(record13, "record");
}
 
開發者ID:droidicus,項目名稱:AquaRegia,代碼行數:22,代碼來源:OreDictUtilTests.java

示例3: addWinnowingRecipes

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
private static void addWinnowingRecipes() {
    IWinnowingMachineHandler winnowing = CulinaryCultivationAPI.winnowing;

    ItemStack tallGrass = new ItemStack(Blocks.TALLGRASS, 1, BlockTallGrass.EnumType.GRASS.getMeta());
    ItemStack doubleTallGrass = new ItemStack(Blocks.DOUBLE_PLANT, 1, BlockDoublePlant.EnumPlantType.GRASS.getMeta());

    //Culinary Cultivation outputs
    winnowing.addOutput(tallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.CUCUMBER.getMetadata()), 10);
    winnowing.addOutput(tallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.TOMATO.getMetadata()), 8);
    winnowing.addJunk(tallGrass, new ItemStack(GENERAL, 1, ItemGeneral.Type.CHAFF_PILE.getMetadata()), 10);
    winnowing.addRecipe(doubleTallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.BLACK_PEPPER_DRUPE.getMetadata()), 18);
    winnowing.addRecipe(doubleTallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.CORN.getMetadata()), 8);

    //Vanilla outputs
    winnowing.addOutput(tallGrass, new ItemStack(Items.WHEAT_SEEDS), 10);
    winnowing.addOutput(tallGrass, new ItemStack(Items.BEETROOT_SEEDS), 2);
    winnowing.addOutput(tallGrass, new ItemStack(Items.PUMPKIN_SEEDS), 1);
    winnowing.addRecipe(new ItemStack(Blocks.SAPLING, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()), new ItemStack(Items.MELON_SEEDS), 1, new ItemStack(Blocks.DEADBUSH), 10);
    winnowing.addRecipe(new ItemStack(Items.WHEAT), new ItemStack(Items.WHEAT_SEEDS), 15, new ItemStack(GENERAL, 1, ItemGeneral.Type.CHAFF_PILE.getMetadata()), 90);
}
 
開發者ID:GirafiStudios,項目名稱:Culinary-Cultivation,代碼行數:21,代碼來源:Recipes.java

示例4: onSaplingGrow

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
@SubscribeEvent
public void onSaplingGrow(SaplingGrowTreeEvent ev)
{
    IBlockState state = ev.getWorld().getBlockState(ev.getPos());
    Block block = state.getBlock();
    if (block == Blocks.sapling)
    {
        BlockPlanks.EnumType type = state.getValue(BlockSapling.TYPE);

        switch (type)
        {
            case OAK:
                ev.setResult(Event.Result.DENY);
                new BirchTreeGenerator().generateTreeAt(ev.getWorld(), ev.getPos(), ev.getRand());
                break;
        }
    }
}
 
開發者ID:gigaherz,項目名稱:NaturalTrees,代碼行數:19,代碼來源:NaturalTrees.java

示例5: getStateFromMeta

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
/**
 * Convert the given metadata into a BlockState for this Block
 */
@Override
public IBlockState getStateFromMeta(int meta)
{
	IBlockState iblockstate = getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.byMetadata((meta & 3) + 4));

	switch (meta & 12)
	{
		case 0:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
			break;
		case 4:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
			break;
		case 8:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
			break;
		default:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
	}

	return iblockstate;
}
 
開發者ID:Geforce132,項目名稱:SecurityCraft,代碼行數:26,代碼來源:BlockReinforcedNewLog.java

示例6: getMetaFromState

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
/**
 * Convert the BlockState into the correct metadata value
 */
@Override
public int getMetaFromState(IBlockState state)
{
	byte b0 = 0;
	int i = b0 | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4;

	switch (BlockReinforcedNewLog.SwitchEnumAxis.AXIS_LOOKUP[((BlockLog.EnumAxis)state.getValue(LOG_AXIS)).ordinal()])
	{
		case 1:
			i |= 4;
			break;
		case 2:
			i |= 8;
			break;
		case 3:
			i |= 12;
	}

	return i;
}
 
開發者ID:Geforce132,項目名稱:SecurityCraft,代碼行數:24,代碼來源:BlockReinforcedNewLog.java

示例7: getStateFromMeta

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
/**
 * Convert the given metadata into a BlockState for this Block
 */
@Override
public IBlockState getStateFromMeta(int meta)
{
	IBlockState iblockstate = getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.byMetadata((meta & 3) % 4));

	switch (meta & 12)
	{
		case 0:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
			break;
		case 4:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
			break;
		case 8:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
			break;
		default:
			iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
	}

	return iblockstate;
}
 
開發者ID:Geforce132,項目名稱:SecurityCraft,代碼行數:26,代碼來源:BlockReinforcedOldLog.java

示例8: getMetaFromState

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
/**
 * Convert the BlockState into the correct metadata value
 */
@Override
public int getMetaFromState(IBlockState state)
{
	byte b0 = 0;
	int i = b0 | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata();

	switch (BlockReinforcedOldLog.SwitchEnumAxis.AXIS_LOOKUP[((BlockLog.EnumAxis)state.getValue(LOG_AXIS)).ordinal()])
	{
		case 1:
			i |= 4;
			break;
		case 2:
			i |= 8;
			break;
		case 3:
			i |= 12;
	}

	return i;
}
 
開發者ID:Geforce132,項目名稱:SecurityCraft,代碼行數:24,代碼來源:BlockReinforcedOldLog.java

示例9: BlockBambooFence

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
public BlockBambooFence(WoodMaterial wood) {
	//TODO maptypes
	super(Material.WOOD,BlockPlanks.EnumType.OAK.getMapColor());
	this.setSoundType(SoundType.WOOD);
	this.wood = wood;
	this.blockHardness = wood.getPlankBlockHardness();
	this.blockResistance = wood.getBlastResistance();
	this.setHarvestLevel("axe", wood.getRequiredHarvestLevel());
	Blocks.FIRE.setFireInfo(this, 5, 20);
	this.setRegistryName(wood.getName()+"_fence");
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:12,代碼來源:BlockBambooFence.java

示例10: BlockWoodFence

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
public BlockWoodFence(WoodMaterial wood) {
	//TODO maptypes
	super(Material.WOOD,BlockPlanks.EnumType.OAK.getMapColor());
	this.setSoundType(SoundType.WOOD);
	this.wood = wood;
	this.blockHardness = wood.getPlankBlockHardness();
	this.blockResistance = wood.getBlastResistance();
	this.setHarvestLevel("axe", wood.getRequiredHarvestLevel());
	Blocks.FIRE.setFireInfo(this, 5, 20);
	this.setRegistryName(wood.getName()+"_fence");
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:12,代碼來源:BlockWoodFence.java

示例11: BlockBambooFence

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
public BlockBambooFence(WoodMaterial wood) {
	super(Material.WOOD, BlockPlanks.EnumType.OAK.getMapColor());
	this.setSoundType(SoundType.WOOD);
	this.wood = wood;
	this.blockHardness = wood.getPlankBlockHardness();
	this.blockResistance = wood.getBlastResistance();
	this.setHarvestLevel("axe", wood.getRequiredHarvestLevel());
	Blocks.FIRE.setFireInfo(this, 5, 20);
	this.setRegistryName(wood.getName() + "_fence");
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:11,代碼來源:BlockBambooFence.java

示例12: BlockWoodFence

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
public BlockWoodFence(WoodMaterial wood) {
	super(Material.WOOD, BlockPlanks.EnumType.OAK.getMapColor());
	this.setSoundType(SoundType.WOOD);
	this.wood = wood;
	this.blockHardness = wood.getPlankBlockHardness();
	this.blockResistance = wood.getBlastResistance();
	this.setHarvestLevel("axe", wood.getRequiredHarvestLevel());
	Blocks.FIRE.setFireInfo(this, 5, 20);
	this.setRegistryName(wood.getName() + "_fence");
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:11,代碼來源:BlockWoodFence.java

示例13: BlockWoodFenceGate

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
public BlockWoodFenceGate(WoodMaterial wood) {
	super(BlockPlanks.EnumType.OAK);
	this.setSoundType(SoundType.WOOD);
	this.wood = wood;
	this.blockHardness = wood.getPlankBlockHardness();
	this.blockResistance = wood.getBlastResistance();
	this.setHarvestLevel("axe", wood.getRequiredHarvestLevel());
	Blocks.FIRE.setFireInfo(this, 5, 20);
	this.setRegistryName(wood.getName() + "_fence_gate");
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:11,代碼來源:BlockWoodFenceGate.java

示例14: gatherDrop

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
@SubscribeEvent
public static void gatherDrop(BlockEvent.HarvestDropsEvent event) {
    if (event.getHarvester() != null
            && event.getHarvester().getRNG().nextInt(100) < 15) {
        //Drop lotus seeds
        if (event.getState().getBlock() == Blocks.WATERLILY)
            event.getDrops().add(new ItemStack(MooncakeConstants.LOTUS_SEED, 1));

        //Drop jujubes
        if (event.getState().getBlock() == Blocks.LEAVES && event.getState().getProperties().containsValue(BlockPlanks.EnumType.SPRUCE))
            event.getDrops().add(new ItemStack(MooncakeConstants.JUJUBE, 1));
    }
}
 
開發者ID:TeamCovertDragon,項目名稱:MooncakeCraft,代碼行數:14,代碼來源:MooncakeEventHandlers.java

示例15: test_deserialization_propertiesAsObject

import net.minecraft.block.BlockPlanks; //導入依賴的package包/類
@Test
public void test_deserialization_propertiesAsObject()
{
    WrappedBlockState state = gson.fromJson("{ \"block\": \"minecraft:log\", \"properties\" : { \"variant\" : \"spruce\"} }", WrappedBlockState.class);
    IBlockState blockState = state.createState();

    assertNotNull(state);
    assertNotNull(blockState);
    assertSame(Blocks.LOG, blockState.getBlock());
    assertSame(BlockPlanks.EnumType.SPRUCE, blockState.getValue(BlockOldLog.VARIANT));
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:12,代碼來源:WrappedBlockStateTests.java


注:本文中的net.minecraft.block.BlockPlanks類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。