本文整理汇总了Java中net.minecraft.block.state.pattern.BlockPattern.match方法的典型用法代码示例。如果您正苦于以下问题:Java BlockPattern.match方法的具体用法?Java BlockPattern.match怎么用?Java BlockPattern.match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.state.pattern.BlockPattern
的用法示例。
在下文中一共展示了BlockPattern.match方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkWitherSpawn
import net.minecraft.block.state.pattern.BlockPattern; //导入方法依赖的package包/类
public void checkWitherSpawn(World worldIn, BlockPos pos, TileEntitySkull te)
{
if (te.getSkullType() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL && !worldIn.isRemote)
{
BlockPattern blockpattern = this.getWitherPattern();
BlockPattern.PatternHelper blockpattern$patternhelper = blockpattern.match(worldIn, pos);
if (blockpattern$patternhelper != null)
{
for (int i = 0; i < 3; ++i)
{
BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, 0, 0);
worldIn.setBlockState(blockworldstate.getPos(), blockworldstate.getBlockState().withProperty(NODROP, Boolean.valueOf(true)), 2);
}
for (int j = 0; j < blockpattern.getPalmLength(); ++j)
{
for (int k = 0; k < blockpattern.getThumbLength(); ++k)
{
BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(j, k, 0);
worldIn.setBlockState(blockworldstate1.getPos(), Blocks.air.getDefaultState(), 2);
}
}
BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 0, 0).getPos();
EntityWither entitywither = new EntityWither(worldIn);
BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
entitywither.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.55D, (double)blockpos1.getZ() + 0.5D, blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F, 0.0F);
entitywither.renderYawOffset = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F;
entitywither.func_82206_m();
for (EntityPlayer entityplayer : worldIn.getEntitiesWithinAABB(EntityPlayer.class, entitywither.getEntityBoundingBox().expand(50.0D, 50.0D, 50.0D)))
{
entityplayer.triggerAchievement(AchievementList.spawnWither);
}
worldIn.spawnEntityInWorld(entitywither);
for (int l = 0; l < 120; ++l)
{
worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)(blockpos.getY() - 2) + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
}
for (int i1 = 0; i1 < blockpattern.getPalmLength(); ++i1)
{
for (int j1 = 0; j1 < blockpattern.getThumbLength(); ++j1)
{
BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(i1, j1, 0);
worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air);
}
}
}
}
}
示例2: checkWitherSpawn
import net.minecraft.block.state.pattern.BlockPattern; //导入方法依赖的package包/类
public void checkWitherSpawn(World worldIn, BlockPos pos, TileEntitySkull te)
{
if (te.getSkullType() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL && !worldIn.isRemote)
{
BlockPattern blockpattern = this.getWitherPattern();
BlockPattern.PatternHelper blockpattern$patternhelper = blockpattern.match(worldIn, pos);
if (blockpattern$patternhelper != null)
{
for (int i = 0; i < 3; ++i)
{
BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, 0, 0);
worldIn.setBlockState(blockworldstate.getPos(), blockworldstate.getBlockState().withProperty(NODROP, Boolean.valueOf(true)), 2);
}
for (int j = 0; j < blockpattern.getPalmLength(); ++j)
{
for (int k = 0; k < blockpattern.getThumbLength(); ++k)
{
BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(j, k, 0);
worldIn.setBlockState(blockworldstate1.getPos(), Blocks.AIR.getDefaultState(), 2);
}
}
BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 0, 0).getPos();
EntityWither entitywither = new EntityWither(worldIn);
BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
entitywither.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.55D, (double)blockpos1.getZ() + 0.5D, blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F, 0.0F);
entitywither.renderYawOffset = blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F;
entitywither.ignite();
for (EntityPlayer entityplayer : worldIn.getEntitiesWithinAABB(EntityPlayer.class, entitywither.getEntityBoundingBox().expandXyz(50.0D)))
{
entityplayer.addStat(AchievementList.SPAWN_WITHER);
}
worldIn.spawnEntityInWorld(entitywither);
for (int l = 0; l < 120; ++l)
{
worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)(blockpos.getY() - 2) + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
}
for (int i1 = 0; i1 < blockpattern.getPalmLength(); ++i1)
{
for (int j1 = 0; j1 < blockpattern.getThumbLength(); ++j1)
{
BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(i1, j1, 0);
worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.AIR, false);
}
}
}
}
}
示例3: checkWitherSpawn
import net.minecraft.block.state.pattern.BlockPattern; //导入方法依赖的package包/类
public void checkWitherSpawn(World worldIn, BlockPos pos, TileEntitySkull te)
{
if (te.getSkullType() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL && !worldIn.isRemote)
{
BlockPattern blockpattern = this.getWitherPattern();
BlockPattern.PatternHelper blockpattern$patternhelper = blockpattern.match(worldIn, pos);
if (blockpattern$patternhelper != null)
{
for (int i = 0; i < 3; ++i)
{
BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, 0, 0);
worldIn.setBlockState(blockworldstate.getPos(), blockworldstate.getBlockState().withProperty(NODROP, Boolean.valueOf(true)), 2);
}
for (int j = 0; j < blockpattern.getPalmLength(); ++j)
{
for (int k = 0; k < blockpattern.getThumbLength(); ++k)
{
BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(j, k, 0);
worldIn.setBlockState(blockworldstate1.getPos(), Blocks.AIR.getDefaultState(), 2);
}
}
BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 0, 0).getPos();
EntityWither entitywither = new EntityWither(worldIn);
BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
entitywither.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.55D, (double)blockpos1.getZ() + 0.5D, blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F, 0.0F);
entitywither.renderYawOffset = blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F;
entitywither.ignite();
for (EntityPlayer entityplayer : worldIn.getEntitiesWithinAABB(EntityPlayer.class, entitywither.getEntityBoundingBox().expandXyz(50.0D)))
{
entityplayer.addStat(AchievementList.SPAWN_WITHER);
}
worldIn.spawnEntityInWorld(entitywither);
for (int l = 0; l < 120; ++l)
{
worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)(blockpos.getY() - 2) + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
}
for (int i1 = 0; i1 < blockpattern.getPalmLength(); ++i1)
{
for (int j1 = 0; j1 < blockpattern.getThumbLength(); ++j1)
{
BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(i1, j1, 0);
worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.AIR);
}
}
}
}
}