• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BlockOldLog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: canHandlePlant

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
@Override
public boolean canHandlePlant(Collection<ItemStack> items, World world, BlockPos pos, IBlockState state) {
	if (!WorldUtil.isBlockAir(state)) {
		return false;
	}
	boolean found = false;
	for (EnumFacing dir : EnumFacing.HORIZONTALS) {
		BlockPos toCheck = pos.offset(dir);
		IBlockState other = world.getBlockState(toCheck);
		if (other.getBlock() == Blocks.LOG && other.getValue(BlockOldLog.VARIANT) == EnumType.JUNGLE) {
			found = true;
			break;
		}
	}
	return found && items.stream().anyMatch(this::canPlantStack);
}
 
开发者ID:Aroma1997,项目名称:BetterChests,代码行数:17,代码来源:CocoaHandler.java


示例2: test_deserialization_propertiesAsObject

import net.minecraft.block.BlockOldLog; //导入依赖的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


示例3: test_deserialization_propertiesAsString

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
@Test
public void test_deserialization_propertiesAsString()
{
    WrappedBlockState state = gson.fromJson("{ \"block\": \"minecraft:log\", \"properties\" : \"variant=spruce,axis=z\" }", WrappedBlockState.class);
    IBlockState blockState = state.createState();

    assertNotNull(state);
    assertNotNull(blockState);
    assertSame(Blocks.LOG, blockState.getBlock());
    assertSame(BlockPlanks.EnumType.SPRUCE, blockState.getValue(BlockOldLog.VARIANT));
    assertSame(BlockLog.EnumAxis.Z, blockState.getValue(BlockLog.LOG_AXIS));
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:13,代码来源:WrappedBlockStateTests.java


示例4: onVillageBlocks

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
@SubscribeEvent
public void onVillageBlocks(BiomeEvent.GetVillageBlockID event) {
    IBlockState original = event.getOriginal();

    if (event.getBiome() == ATGBiomes.TUNDRA) {
        if (original.getBlock() == Blocks.LOG || original.getBlock() == Blocks.LOG2) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE).withProperty(BlockLog.LOG_AXIS, original.getValue(BlockLog.LOG_AXIS)));
        } else if (original.getBlock() == Blocks.PLANKS) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.PLANKS.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.SPRUCE));
        } else if (original.getBlock() == Blocks.OAK_STAIRS) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.SPRUCE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, original.getValue(BlockStairs.FACING)));
        } else if (original.getBlock() == Blocks.OAK_FENCE) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.SPRUCE_FENCE.getDefaultState());
        }
    }
    else if (event.getBiome() == ATGBiomes.SCRUBLAND) {
        if (original.getBlock() == Blocks.LOG || original.getBlock() == Blocks.LOG2) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.LOG2.getDefaultState().withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.ACACIA).withProperty(BlockLog.LOG_AXIS, original.getValue(BlockLog.LOG_AXIS)));
        } else if (original.getBlock() == Blocks.PLANKS) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.PLANKS.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.ACACIA));
        } else if (original.getBlock() == Blocks.OAK_STAIRS) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.ACACIA_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, original.getValue(BlockStairs.FACING)));
        } else if (original.getBlock() == Blocks.OAK_FENCE) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.ACACIA_FENCE.getDefaultState());
        }
    }
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:36,代码来源:VillageBlocks.java


示例5: EnderTreeNormalGen

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
public EnderTreeNormalGen(boolean notify) {
    super(notify);
    this.minTreeHeight = 4;
    this.metaWood = Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.OAK);
    this.oakLeaves = Blocks.LEAVES.getDefaultState().withProperty(BlockOldLeaf.VARIANT,
        BlockPlanks.EnumType.OAK).withProperty(BlockLeaves.CHECK_DECAY, false);
    this.enderLeaves = IWTechBlocks.BLOCK_ENDER_LEAVES.getDefaultState();
}
 
开发者ID:InfinityStudio,项目名称:InspiringWorld,代码行数:9,代码来源:EnderTreeNormalGen.java


示例6: registerVanillaVariantProps

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
private static void registerVanillaVariantProps() {
	// TODO: omit similar blocks
	registerVariantProperty(BlockStone.VARIANT);
	registerVariantProperty(BlockPlanks.VARIANT);
	registerVariantProperty(BlockSapling.TYPE);
	registerVariantProperty(BlockDirt.VARIANT);
	registerVariantProperty(BlockSand.VARIANT);
	registerVariantProperty(BlockOldLog.VARIANT);
	registerVariantProperty(BlockNewLog.VARIANT);
	registerVariantProperty(BlockOldLeaf.VARIANT);
	registerVariantProperty(BlockNewLeaf.VARIANT);
	registerVariantProperty(BlockSandStone.TYPE);
	registerVariantProperty(BlockTallGrass.TYPE);
	registerVariantProperty(BlockPistonExtension.TYPE);
	registerVariantProperty(BlockColored.COLOR);
	registerVariantProperty(BlockPistonMoving.TYPE);
	registerVariantProperty(Blocks.YELLOW_FLOWER.getTypeProperty());
	registerVariantProperty(Blocks.RED_FLOWER.getTypeProperty());
	registerVariantProperty(BlockStoneSlab.VARIANT);
	registerVariantProperty(BlockWoodSlab.VARIANT);
	registerVariantProperty(BlockAnvil.DAMAGE);
	registerVariantProperty(BlockQuartz.VARIANT);
	registerVariantProperty(BlockCarpet.COLOR);
	registerVariantProperty(BlockDoublePlant.VARIANT);
	registerVariantProperty(BlockStainedGlass.COLOR);
	registerVariantProperty(BlockStainedGlassPane.COLOR);
	registerVariantProperty(BlockPrismarine.VARIANT);
	registerVariantProperty(BlockRedSandstone.TYPE);
	registerVariantProperty(BlockStoneSlabNew.VARIANT);
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:31,代码来源:BlockPropertyRegistry.java


示例7: getUnlocalizedName

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
@Override
public String getUnlocalizedName(ItemStack stack)
{
	int dmg = stack.getMetadata();

	if(block instanceof BlockReinforcedOldLog)
		return getUnlocalizedName() + "_" + BlockOldLog.field_150168_M[dmg & 3];
	else if(block instanceof BlockReinforcedNewLog)
		return getUnlocalizedName() + "_" + BlockNewLog.field_150169_M[dmg & 3];

	return getUnlocalizedName();
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:13,代码来源:ItemBlockReinforcedLog.java


示例8: getCorrectCocoState

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
private IBlockState getCorrectCocoState(World worldObj, BlockPos pos) {
	if (worldObj.isAirBlock(pos)) {
		for (EnumFacing facing : EnumFacing.Plane.HORIZONTAL) {
			BlockPos testPos = pos.offset(facing);
			IBlockState testState = worldObj.getBlockState(testPos);
            Block testBlock = testState.getBlock();
			if (testBlock == Blocks.LOG && testState.getValue(BlockOldLog.VARIANT) == BlockPlanks.EnumType.JUNGLE) {
				return Blocks.COCOA.getDefaultState().withProperty(BlockHorizontal.FACING, facing);
			}
		}
	}
	return null;
}
 
开发者ID:Vanhal,项目名称:ProgressiveAutomation,代码行数:14,代码来源:Vanilla.java


示例9: setType

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
public static void setType(MetaBlock log, Wood type){
	switch(type){
	case OAK: log.withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.OAK); return;
	case SPRUCE: log.withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE); return;
	case BIRCH: log.withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.BIRCH); return;
	case JUNGLE: log.withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE); return;
	case ACACIA: log.withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.ACACIA); return;
	case DARKOAK: log.withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.DARK_OAK); return;
	default: log.withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.OAK); return;
	}
}
 
开发者ID:Greymerk,项目名称:minecraft-roguelike,代码行数:12,代码来源:Log.java


示例10: getVariant

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
private static EnumType getVariant(IBlockState bs) {
  if (bs.getProperties().containsKey(BlockNewLog.VARIANT)) {
    return bs.getValue(BlockNewLog.VARIANT);
  }
  if (bs.getProperties().containsKey(BlockOldLog.VARIANT)) {
    return bs.getValue(BlockOldLog.VARIANT);
  }
  return null;
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:10,代码来源:AxeHarvestingTarget.java


示例11: onItemUse

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
/**
 * Called when a Block is right-clicked with this Item
 */
public EnumActionResult onItemUse(EntityPlayer stack, World playerIn, BlockPos worldIn, EnumHand pos, EnumFacing hand, float facing, float hitX, float hitY)
{
    ItemStack itemstack = stack.getHeldItem(pos);

    if (!stack.canPlayerEdit(worldIn.offset(hand), hand, itemstack))
    {
        return EnumActionResult.FAIL;
    }
    else
    {
        EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(itemstack.getMetadata());

        if (enumdyecolor == EnumDyeColor.WHITE)
        {
            if (applyBonemeal(itemstack, playerIn, worldIn))
            {
                if (!playerIn.isRemote)
                {
                    playerIn.playEvent(2005, worldIn, 0);
                }

                return EnumActionResult.SUCCESS;
            }
        }
        else if (enumdyecolor == EnumDyeColor.BROWN)
        {
            IBlockState iblockstate = playerIn.getBlockState(worldIn);
            Block block = iblockstate.getBlock();

            if (block == Blocks.LOG && iblockstate.getValue(BlockOldLog.VARIANT) == BlockPlanks.EnumType.JUNGLE)
            {
                if (hand == EnumFacing.DOWN || hand == EnumFacing.UP)
                {
                    return EnumActionResult.FAIL;
                }

                worldIn = worldIn.offset(hand);

                if (playerIn.isAirBlock(worldIn))
                {
                    IBlockState iblockstate1 = Blocks.COCOA.onBlockPlaced(playerIn, worldIn, hand, facing, hitX, hitY, 0, stack);
                    playerIn.setBlockState(worldIn, iblockstate1, 10);

                    if (!stack.capabilities.isCreativeMode)
                    {
                        itemstack.func_190918_g(1);
                    }

                    return EnumActionResult.SUCCESS;
                }
            }

            return EnumActionResult.FAIL;
        }

        return EnumActionResult.PASS;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:62,代码来源:ItemDye.java


示例12: onItemUse

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
/**
 * Called when a Block is right-clicked with this Item
 */
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
    if (!playerIn.canPlayerEdit(pos.offset(facing), facing, stack))
    {
        return EnumActionResult.FAIL;
    }
    else
    {
        EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

        if (enumdyecolor == EnumDyeColor.WHITE)
        {
            if (applyBonemeal(stack, worldIn, pos, playerIn))
            {
                if (!worldIn.isRemote)
                {
                    worldIn.playEvent(2005, pos, 0);
                }

                return EnumActionResult.SUCCESS;
            }
        }
        else if (enumdyecolor == EnumDyeColor.BROWN)
        {
            IBlockState iblockstate = worldIn.getBlockState(pos);
            Block block = iblockstate.getBlock();

            if (block == Blocks.LOG && iblockstate.getValue(BlockOldLog.VARIANT) == BlockPlanks.EnumType.JUNGLE)
            {
                if (facing != EnumFacing.DOWN && facing != EnumFacing.UP)
                {
                    pos = pos.offset(facing);

                    if (worldIn.isAirBlock(pos))
                    {
                        IBlockState iblockstate1 = Blocks.COCOA.getStateForPlacement(worldIn, pos, facing, hitX, hitY, hitZ, 0, playerIn, stack);
                        worldIn.setBlockState(pos, iblockstate1, 10);

                        if (!playerIn.capabilities.isCreativeMode)
                        {
                            --stack.stackSize;
                        }
                    }

                    return EnumActionResult.SUCCESS;
                }

                return EnumActionResult.FAIL;
            }

            return EnumActionResult.FAIL;
        }

        return EnumActionResult.PASS;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:60,代码来源:ItemDye.java


示例13: onItemUse

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
/**
 * Called when a Block is right-clicked with this Item
 */
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
    if (!playerIn.canPlayerEdit(pos.offset(facing), facing, stack))
    {
        return EnumActionResult.FAIL;
    }
    else
    {
        EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

        if (enumdyecolor == EnumDyeColor.WHITE)
        {
            if (applyBonemeal(stack, worldIn, pos, playerIn))
            {
                if (!worldIn.isRemote)
                {
                    worldIn.playEvent(2005, pos, 0);
                }

                return EnumActionResult.SUCCESS;
            }
        }
        else if (enumdyecolor == EnumDyeColor.BROWN)
        {
            IBlockState iblockstate = worldIn.getBlockState(pos);
            Block block = iblockstate.getBlock();

            if (block == Blocks.LOG && iblockstate.getValue(BlockOldLog.VARIANT) == BlockPlanks.EnumType.JUNGLE)
            {
                if (facing != EnumFacing.DOWN && facing != EnumFacing.UP)
                {
                    pos = pos.offset(facing);

                    if (worldIn.isAirBlock(pos))
                    {
                        IBlockState iblockstate1 = Blocks.COCOA.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, 0, playerIn);
                        worldIn.setBlockState(pos, iblockstate1, 10);

                        if (!playerIn.capabilities.isCreativeMode)
                        {
                            --stack.stackSize;
                        }
                    }

                    return EnumActionResult.SUCCESS;
                }

                return EnumActionResult.FAIL;
            }

            return EnumActionResult.FAIL;
        }

        return EnumActionResult.PASS;
    }
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:60,代码来源:ItemDye.java


示例14: isJungleTree

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
private boolean isJungleTree(IBlockState state) {
	return state.getBlock() == Blocks.LOG && state.getValue(BlockOldLog.VARIANT) == EnumType.JUNGLE;
}
 
开发者ID:Aroma1997,项目名称:BetterChests,代码行数:4,代码来源:CocoaHandler.java


示例15: validBlock

import net.minecraft.block.BlockOldLog; //导入依赖的package包/类
private boolean validBlock(@Nonnull IBlockState iblockstate) {
  return iblockstate.getBlock() == Blocks.LOG && iblockstate.getValue(BlockOldLog.VARIANT) == BlockPlanks.EnumType.JUNGLE;
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:4,代码来源:CocoaFarmer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BMPImageWriterSpi类代码示例发布时间:2022-05-21
下一篇:
Java ProgressSource类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap