本文整理汇总了Java中net.minecraft.world.World.notifyNeighborsRespectDebug方法的典型用法代码示例。如果您正苦于以下问题:Java World.notifyNeighborsRespectDebug方法的具体用法?Java World.notifyNeighborsRespectDebug怎么用?Java World.notifyNeighborsRespectDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.notifyNeighborsRespectDebug方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkWitherSpawn
import net.minecraft.world.World; //导入方法依赖的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: trySpawnGolem
import net.minecraft.world.World; //导入方法依赖的package包/类
private void trySpawnGolem(World worldIn, BlockPos pos)
{
BlockPattern.PatternHelper blockpattern$patternhelper;
if ((blockpattern$patternhelper = this.getSnowmanPattern().match(worldIn, pos)) != null)
{
for (int i = 0; i < this.getSnowmanPattern().getThumbLength(); ++i)
{
BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(0, i, 0);
worldIn.setBlockState(blockworldstate.getPos(), Blocks.air.getDefaultState(), 2);
}
EntitySnowman entitysnowman = new EntitySnowman(worldIn);
BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(0, 2, 0).getPos();
entitysnowman.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.05D, (double)blockpos1.getZ() + 0.5D, 0.0F, 0.0F);
worldIn.spawnEntityInWorld(entitysnowman);
for (int j = 0; j < 120; ++j)
{
worldIn.spawnParticle(EnumParticleTypes.SNOW_SHOVEL, (double)blockpos1.getX() + worldIn.rand.nextDouble(), (double)blockpos1.getY() + worldIn.rand.nextDouble() * 2.5D, (double)blockpos1.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
}
for (int i1 = 0; i1 < this.getSnowmanPattern().getThumbLength(); ++i1)
{
BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(0, i1, 0);
worldIn.notifyNeighborsRespectDebug(blockworldstate1.getPos(), Blocks.air);
}
}
else if ((blockpattern$patternhelper = this.getGolemPattern().match(worldIn, pos)) != null)
{
for (int k = 0; k < this.getGolemPattern().getPalmLength(); ++k)
{
for (int l = 0; l < this.getGolemPattern().getThumbLength(); ++l)
{
worldIn.setBlockState(blockpattern$patternhelper.translateOffset(k, l, 0).getPos(), Blocks.air.getDefaultState(), 2);
}
}
BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
EntityIronGolem entityirongolem = new EntityIronGolem(worldIn);
entityirongolem.setPlayerCreated(true);
entityirongolem.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.05D, (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
worldIn.spawnEntityInWorld(entityirongolem);
for (int j1 = 0; j1 < 120; ++j1)
{
worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)blockpos.getY() + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
}
for (int k1 = 0; k1 < this.getGolemPattern().getPalmLength(); ++k1)
{
for (int l1 = 0; l1 < this.getGolemPattern().getThumbLength(); ++l1)
{
BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(k1, l1, 0);
worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air);
}
}
}
}
示例3: onItemUse
import net.minecraft.world.World; //导入方法依赖的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)
{
if (playerIn.isRemote)
{
return EnumActionResult.SUCCESS;
}
else if (hand != EnumFacing.UP)
{
return EnumActionResult.FAIL;
}
else
{
IBlockState iblockstate = playerIn.getBlockState(worldIn);
Block block = iblockstate.getBlock();
boolean flag = block.isReplaceable(playerIn, worldIn);
if (!flag)
{
worldIn = worldIn.up();
}
int i = MathHelper.floor((double)(stack.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
EnumFacing enumfacing = EnumFacing.getHorizontal(i);
BlockPos blockpos = worldIn.offset(enumfacing);
ItemStack itemstack = stack.getHeldItem(pos);
if (stack.canPlayerEdit(worldIn, hand, itemstack) && stack.canPlayerEdit(blockpos, hand, itemstack))
{
IBlockState iblockstate1 = playerIn.getBlockState(blockpos);
boolean flag1 = iblockstate1.getBlock().isReplaceable(playerIn, blockpos);
boolean flag2 = flag || playerIn.isAirBlock(worldIn);
boolean flag3 = flag1 || playerIn.isAirBlock(blockpos);
if (flag2 && flag3 && playerIn.getBlockState(worldIn.down()).isFullyOpaque() && playerIn.getBlockState(blockpos.down()).isFullyOpaque())
{
IBlockState iblockstate2 = Blocks.BED.getDefaultState().withProperty(BlockBed.OCCUPIED, Boolean.valueOf(false)).withProperty(BlockBed.FACING, enumfacing).withProperty(BlockBed.PART, BlockBed.EnumPartType.FOOT);
playerIn.setBlockState(worldIn, iblockstate2, 10);
playerIn.setBlockState(blockpos, iblockstate2.withProperty(BlockBed.PART, BlockBed.EnumPartType.HEAD), 10);
playerIn.notifyNeighborsRespectDebug(worldIn, block, false);
playerIn.notifyNeighborsRespectDebug(blockpos, iblockstate1.getBlock(), false);
SoundType soundtype = iblockstate2.getBlock().getSoundType();
playerIn.playSound((EntityPlayer)null, worldIn, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
itemstack.func_190918_g(1);
return EnumActionResult.SUCCESS;
}
else
{
return EnumActionResult.FAIL;
}
}
else
{
return EnumActionResult.FAIL;
}
}
}
示例4: checkWitherSpawn
import net.minecraft.world.World; //导入方法依赖的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);
}
}
}
}
}
示例5: trySpawnGolem
import net.minecraft.world.World; //导入方法依赖的package包/类
private void trySpawnGolem(World worldIn, BlockPos pos)
{
BlockPattern.PatternHelper blockpattern$patternhelper = this.getSnowmanPattern().match(worldIn, pos);
if (blockpattern$patternhelper != null)
{
for (int i = 0; i < this.getSnowmanPattern().getThumbLength(); ++i)
{
BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(0, i, 0);
worldIn.setBlockState(blockworldstate.getPos(), Blocks.AIR.getDefaultState(), 2);
}
EntitySnowman entitysnowman = new EntitySnowman(worldIn);
BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(0, 2, 0).getPos();
entitysnowman.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.05D, (double)blockpos1.getZ() + 0.5D, 0.0F, 0.0F);
worldIn.spawnEntityInWorld(entitysnowman);
for (int j = 0; j < 120; ++j)
{
worldIn.spawnParticle(EnumParticleTypes.SNOW_SHOVEL, (double)blockpos1.getX() + worldIn.rand.nextDouble(), (double)blockpos1.getY() + worldIn.rand.nextDouble() * 2.5D, (double)blockpos1.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
}
for (int i1 = 0; i1 < this.getSnowmanPattern().getThumbLength(); ++i1)
{
BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(0, i1, 0);
worldIn.notifyNeighborsRespectDebug(blockworldstate1.getPos(), Blocks.AIR, false);
}
}
else
{
blockpattern$patternhelper = this.getGolemPattern().match(worldIn, pos);
if (blockpattern$patternhelper != null)
{
for (int k = 0; k < this.getGolemPattern().getPalmLength(); ++k)
{
for (int l = 0; l < this.getGolemPattern().getThumbLength(); ++l)
{
worldIn.setBlockState(blockpattern$patternhelper.translateOffset(k, l, 0).getPos(), Blocks.AIR.getDefaultState(), 2);
}
}
BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
EntityIronGolem entityirongolem = new EntityIronGolem(worldIn);
entityirongolem.setPlayerCreated(true);
entityirongolem.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.05D, (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
worldIn.spawnEntityInWorld(entityirongolem);
for (int j1 = 0; j1 < 120; ++j1)
{
worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)blockpos.getY() + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
}
for (int k1 = 0; k1 < this.getGolemPattern().getPalmLength(); ++k1)
{
for (int l1 = 0; l1 < this.getGolemPattern().getThumbLength(); ++l1)
{
BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(k1, l1, 0);
worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.AIR, false);
}
}
}
}
}
示例6: checkWitherSpawn
import net.minecraft.world.World; //导入方法依赖的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);
}
}
}
}
}
示例7: trySpawnGolem
import net.minecraft.world.World; //导入方法依赖的package包/类
private void trySpawnGolem(World worldIn, BlockPos pos)
{
BlockPattern.PatternHelper blockpattern$patternhelper = this.getSnowmanPattern().match(worldIn, pos);
if (blockpattern$patternhelper != null)
{
for (int i = 0; i < this.getSnowmanPattern().getThumbLength(); ++i)
{
BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(0, i, 0);
worldIn.setBlockState(blockworldstate.getPos(), Blocks.AIR.getDefaultState(), 2);
}
EntitySnowman entitysnowman = new EntitySnowman(worldIn);
BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(0, 2, 0).getPos();
entitysnowman.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.05D, (double)blockpos1.getZ() + 0.5D, 0.0F, 0.0F);
worldIn.spawnEntityInWorld(entitysnowman);
for (int j = 0; j < 120; ++j)
{
worldIn.spawnParticle(EnumParticleTypes.SNOW_SHOVEL, (double)blockpos1.getX() + worldIn.rand.nextDouble(), (double)blockpos1.getY() + worldIn.rand.nextDouble() * 2.5D, (double)blockpos1.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
}
for (int i1 = 0; i1 < this.getSnowmanPattern().getThumbLength(); ++i1)
{
BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(0, i1, 0);
worldIn.notifyNeighborsRespectDebug(blockworldstate1.getPos(), Blocks.AIR);
}
}
else
{
blockpattern$patternhelper = this.getGolemPattern().match(worldIn, pos);
if (blockpattern$patternhelper != null)
{
for (int k = 0; k < this.getGolemPattern().getPalmLength(); ++k)
{
for (int l = 0; l < this.getGolemPattern().getThumbLength(); ++l)
{
worldIn.setBlockState(blockpattern$patternhelper.translateOffset(k, l, 0).getPos(), Blocks.AIR.getDefaultState(), 2);
}
}
BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
EntityIronGolem entityirongolem = new EntityIronGolem(worldIn);
entityirongolem.setPlayerCreated(true);
entityirongolem.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.05D, (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
worldIn.spawnEntityInWorld(entityirongolem);
for (int j1 = 0; j1 < 120; ++j1)
{
worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)blockpos.getY() + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
}
for (int k1 = 0; k1 < this.getGolemPattern().getPalmLength(); ++k1)
{
for (int l1 = 0; l1 < this.getGolemPattern().getThumbLength(); ++l1)
{
BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(k1, l1, 0);
worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.AIR);
}
}
}
}
}