本文整理汇总了Java中net.minecraft.world.World.immediateBlockTick方法的典型用法代码示例。如果您正苦于以下问题:Java World.immediateBlockTick方法的具体用法?Java World.immediateBlockTick怎么用?Java World.immediateBlockTick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.immediateBlockTick方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generate
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public boolean generate(World worldIn, Random rand, BlockPos position) {
if (!isValidSpot(worldIn, position.up())) return false;
int solidNeighbors = 0;
if (isValidSpot(worldIn, position.west())) solidNeighbors++;
if (isValidSpot(worldIn, position.east())) solidNeighbors++;
if (isValidSpot(worldIn, position.north())) solidNeighbors++;
if (isValidSpot(worldIn, position.south())) solidNeighbors++;
if (isValidSpot(worldIn, position.down())) solidNeighbors++;
if(solidNeighbors==4) {
worldIn.setBlockState(position, block, 2);
worldIn.immediateBlockTick(position, block, rand);
return true;
}
return false;
}
示例2: addComponentParts
import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 12, 4, 12, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 12, 13, 12, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 1, 12, 12, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 0, 12, 12, 12, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 11, 4, 12, 12, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 11, 10, 12, 12, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 11, 7, 12, 12, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 0, 4, 12, 1, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 0, 10, 12, 1, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 0, 7, 12, 1, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 11, 2, 10, 12, 10, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 8, 0, 7, 8, 0, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
for (int i = 1; i <= 11; i += 2)
{
this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 0, i, 11, 0, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 12, i, 11, 12, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 10, i, 0, 11, i, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 10, i, 12, 11, i, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
this.setBlockState(worldIn, Blocks.NETHER_BRICK.getDefaultState(), i, 13, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK.getDefaultState(), i, 13, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK.getDefaultState(), 0, 13, i, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK.getDefaultState(), 12, 13, i, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK_FENCE.getDefaultState(), i + 1, 13, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK_FENCE.getDefaultState(), i + 1, 13, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK_FENCE.getDefaultState(), 0, 13, i + 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK_FENCE.getDefaultState(), 12, 13, i + 1, structureBoundingBoxIn);
}
this.setBlockState(worldIn, Blocks.NETHER_BRICK_FENCE.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK_FENCE.getDefaultState(), 0, 13, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK_FENCE.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.NETHER_BRICK_FENCE.getDefaultState(), 12, 13, 0, structureBoundingBoxIn);
for (int k = 3; k <= 9; k += 2)
{
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, k, 1, 8, k, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 7, k, 11, 8, k, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
}
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 8, 2, 12, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 12, 2, 8, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 0, 8, 1, 3, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 9, 8, 1, 12, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 4, 3, 1, 8, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 4, 12, 1, 8, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
for (int l = 4; l <= 8; ++l)
{
for (int j = 0; j <= 2; ++j)
{
this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), l, -1, j, structureBoundingBoxIn);
this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), l, -1, 12 - j, structureBoundingBoxIn);
}
}
for (int i1 = 0; i1 <= 2; ++i1)
{
for (int j1 = 4; j1 <= 8; ++j1)
{
this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), i1, -1, j1, structureBoundingBoxIn);
this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), 12 - i1, -1, j1, structureBoundingBoxIn);
}
}
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 5, 7, 5, 7, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 6, 6, 4, 6, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
this.setBlockState(worldIn, Blocks.NETHER_BRICK.getDefaultState(), 6, 0, 6, structureBoundingBoxIn);
IBlockState iblockstate = Blocks.FLOWING_LAVA.getDefaultState();
this.setBlockState(worldIn, iblockstate, 6, 5, 6, structureBoundingBoxIn);
BlockPos blockpos = new BlockPos(this.getXWithOffset(6, 6), this.getYWithOffset(5), this.getZWithOffset(6, 6));
if (structureBoundingBoxIn.isVecInside(blockpos))
{
worldIn.immediateBlockTick(blockpos, iblockstate, randomIn);
}
return true;
}
示例3: generate
import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
if (worldIn.getBlockState(position.up()).getBlock() != Blocks.NETHERRACK)
{
return false;
}
else if (worldIn.getBlockState(position).getMaterial() != Material.AIR && worldIn.getBlockState(position).getBlock() != Blocks.NETHERRACK)
{
return false;
}
else
{
int i = 0;
if (worldIn.getBlockState(position.west()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
if (worldIn.getBlockState(position.east()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
if (worldIn.getBlockState(position.north()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
if (worldIn.getBlockState(position.south()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
if (worldIn.getBlockState(position.down()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
int j = 0;
if (worldIn.isAirBlock(position.west()))
{
++j;
}
if (worldIn.isAirBlock(position.east()))
{
++j;
}
if (worldIn.isAirBlock(position.north()))
{
++j;
}
if (worldIn.isAirBlock(position.south()))
{
++j;
}
if (worldIn.isAirBlock(position.down()))
{
++j;
}
if (!this.insideRock && i == 4 && j == 1 || i == 5)
{
IBlockState iblockstate = this.block.getDefaultState();
worldIn.setBlockState(position, iblockstate, 2);
worldIn.immediateBlockTick(position, iblockstate, rand);
}
return true;
}
}
示例4: generate
import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
if (worldIn.getBlockState(position.up()).getBlock() != Blocks.STONE)
{
return false;
}
else if (worldIn.getBlockState(position.down()).getBlock() != Blocks.STONE)
{
return false;
}
else
{
IBlockState iblockstate = worldIn.getBlockState(position);
if (iblockstate.getMaterial() != Material.AIR && iblockstate.getBlock() != Blocks.STONE)
{
return false;
}
else
{
int i = 0;
if (worldIn.getBlockState(position.west()).getBlock() == Blocks.STONE)
{
++i;
}
if (worldIn.getBlockState(position.east()).getBlock() == Blocks.STONE)
{
++i;
}
if (worldIn.getBlockState(position.north()).getBlock() == Blocks.STONE)
{
++i;
}
if (worldIn.getBlockState(position.south()).getBlock() == Blocks.STONE)
{
++i;
}
int j = 0;
if (worldIn.isAirBlock(position.west()))
{
++j;
}
if (worldIn.isAirBlock(position.east()))
{
++j;
}
if (worldIn.isAirBlock(position.north()))
{
++j;
}
if (worldIn.isAirBlock(position.south()))
{
++j;
}
if (i == 3 && j == 1)
{
IBlockState iblockstate1 = this.block.getDefaultState();
worldIn.setBlockState(position, iblockstate1, 2);
worldIn.immediateBlockTick(position, iblockstate1, rand);
}
return true;
}
}
}
示例5: generate
import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
if (worldIn.getBlockState(position.up()).getBlock() != Blocks.NETHERRACK)
{
return false;
}
else if (!worldIn.isAirBlock(position) && worldIn.getBlockState(position).getBlock() != Blocks.NETHERRACK)
{
return false;
}
else
{
int i = 0;
if (worldIn.getBlockState(position.west()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
if (worldIn.getBlockState(position.east()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
if (worldIn.getBlockState(position.north()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
if (worldIn.getBlockState(position.south()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
if (worldIn.getBlockState(position.down()).getBlock() == Blocks.NETHERRACK)
{
++i;
}
int j = 0;
if (worldIn.isAirBlock(position.west()))
{
++j;
}
if (worldIn.isAirBlock(position.east()))
{
++j;
}
if (worldIn.isAirBlock(position.north()))
{
++j;
}
if (worldIn.isAirBlock(position.south()))
{
++j;
}
if (worldIn.isAirBlock(position.down()))
{
++j;
}
if (!this.insideRock && i == 4 && j == 1 || i == 5)
{
IBlockState iblockstate = this.block.getDefaultState();
worldIn.setBlockState(position, iblockstate, 2);
worldIn.immediateBlockTick(position, iblockstate, rand);
}
return true;
}
}
示例6: generate
import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
if (worldIn.getBlockState(position.up()).getBlock() != Blocks.STONE)
{
return false;
}
else if (worldIn.getBlockState(position.down()).getBlock() != Blocks.STONE)
{
return false;
}
else
{
IBlockState iblockstate = worldIn.getBlockState(position);
if (!iblockstate.getBlock().isAir(iblockstate, worldIn, position) && iblockstate.getBlock() != Blocks.STONE)
{
return false;
}
else
{
int i = 0;
if (worldIn.getBlockState(position.west()).getBlock() == Blocks.STONE)
{
++i;
}
if (worldIn.getBlockState(position.east()).getBlock() == Blocks.STONE)
{
++i;
}
if (worldIn.getBlockState(position.north()).getBlock() == Blocks.STONE)
{
++i;
}
if (worldIn.getBlockState(position.south()).getBlock() == Blocks.STONE)
{
++i;
}
int j = 0;
if (worldIn.isAirBlock(position.west()))
{
++j;
}
if (worldIn.isAirBlock(position.east()))
{
++j;
}
if (worldIn.isAirBlock(position.north()))
{
++j;
}
if (worldIn.isAirBlock(position.south()))
{
++j;
}
if (i == 3 && j == 1)
{
IBlockState iblockstate1 = this.block.getDefaultState();
worldIn.setBlockState(position, iblockstate1, 2);
worldIn.immediateBlockTick(position, iblockstate1, rand);
}
return true;
}
}
}