本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}