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


Java BlockRailBase类代码示例

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


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

示例1: generateChest

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
protected boolean generateChest(World worldIn, StructureBoundingBox structurebb, Random randomIn, int x, int y, int z, ResourceLocation loot)
{
    BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z));

    if (structurebb.isVecInside(blockpos) && worldIn.getBlockState(blockpos).getMaterial() == Material.AIR && worldIn.getBlockState(blockpos.down()).getMaterial() != Material.AIR)
    {
        IBlockState iblockstate = Blocks.RAIL.getDefaultState().withProperty(BlockRail.SHAPE, randomIn.nextBoolean() ? BlockRailBase.EnumRailDirection.NORTH_SOUTH : BlockRailBase.EnumRailDirection.EAST_WEST);
        this.setBlockState(worldIn, iblockstate, x, y, z, structurebb);
        EntityMinecartChest entityminecartchest = new EntityMinecartChest(worldIn, (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F));
        entityminecartchest.setLootTable(loot, randomIn.nextLong());
        worldIn.spawnEntityInWorld(entityminecartchest);
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:StructureMineshaftPieces.java

示例2: generateChest

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
/**
 * Adds chest to the structure and sets its contents
 */
protected boolean generateChest(World worldIn, StructureBoundingBox structurebb, Random randomIn, int x, int y, int z, ResourceLocation loot)
{
    BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z));

    if (structurebb.isVecInside(blockpos) && worldIn.getBlockState(blockpos).getMaterial() == Material.AIR && worldIn.getBlockState(blockpos.down()).getMaterial() != Material.AIR)
    {
        IBlockState iblockstate = Blocks.RAIL.getDefaultState().withProperty(BlockRail.SHAPE, randomIn.nextBoolean() ? BlockRailBase.EnumRailDirection.NORTH_SOUTH : BlockRailBase.EnumRailDirection.EAST_WEST);
        this.setBlockState(worldIn, iblockstate, x, y, z, structurebb);
        EntityMinecartChest entityminecartchest = new EntityMinecartChest(worldIn, (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F));
        entityminecartchest.setLootTable(loot, randomIn.nextLong());
        worldIn.spawnEntityInWorld(entityminecartchest);
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:StructureMineshaftPieces.java

示例3: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSPCT6(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT6.java

示例4: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)) && world.getBlock(x, y, z) instanceof RailMonoMagnetBase)
    {
        if (!world.isRemote)
        {
            LocoBase entityminecart = new NSPCT4M(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT4M.java

示例5: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)) && world.getBlock(x, y, z) instanceof RailMonoMagnetBase)
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSPCT4(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT4.java

示例6: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSPCT5L(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT5L.java

示例7: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSPCT8(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT8.java

示例8: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSBT1(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSBT1.java

示例9: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSPCT5(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT5.java

示例10: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSPCT2(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT2.java

示例11: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSTCT1(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSTCT1.java

示例12: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSPCT1(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT1.java

示例13: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            MinecartBase entityminecart = new NSPCT3(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT3.java

示例14: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            LocoBase entityminecart = new NSET2(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSET2.java

示例15: onItemUse

import net.minecraft.block.BlockRailBase; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) {
    if (BlockRailBase.func_150051_a(world.getBlock(x, y, z)))
    {
        if (!world.isRemote)
        {
            LocoBase entityminecart = new NSPCT8J(world, (double) x + 0.5, (double) y + 0.5, (double) z + 0.5);

            if (itemStack.hasDisplayName())
            {
                entityminecart.setMinecartName(itemStack.getDisplayName());
            }

            world.spawnEntityInWorld(entityminecart);
        }

        --itemStack.stackSize;
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:NSDN,项目名称:NyaSamaRailway,代码行数:25,代码来源:ItemNSPCT8J.java


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