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


Java BlockFalling类代码示例

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


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

示例1: populate

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
@Override
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
    BlockFalling.fallInstantly = true;
    int var4 = par2 * 16;
    int var5 = par3 * 16;
    this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
    this.rand.setSeed(this.worldObj.getSeed());
    final long var7 = this.rand.nextLong() / 2L * 2L + 1L;
    final long var9 = this.rand.nextLong() / 2L * 2L + 1L;
    this.rand.setSeed(par2 * var7 + par3 * var9 ^ this.worldObj.getSeed());
    this.decoratePlanet(this.worldObj, this.rand, var4, var5);
    this.onPopulate(par1IChunkProvider, par2, par3);

    BlockFalling.fallInstantly = false;
}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:17,代码来源:ChunkProviderSpaceCraters.java

示例2: populate

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
@Override
public void populate(IChunkProvider chunk, int x, int z)
{
	BlockFalling.fallInstantly = true;
	int var4 = x * 16;
	int var5 = z * 16;
	BiomeGenBase biomeGen = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
	this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
	this.rand.setSeed(this.worldObj.getSeed());
	long var7 = this.rand.nextLong() / 2L * 2L + 1L;
	long var9 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed(x * var7 + z * var9 ^ this.worldObj.getSeed());
	biomeGen.decorate(this.worldObj, this.rand, var4, var5);
	this.decoratePlanet(this.worldObj, this.rand, var4, var5);
	SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomeGen, var4 + 8, var5 + 8, 16, 16, this.rand);
	this.onPopulate(chunk, x, z);
	BlockFalling.fallInstantly = false;
}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:19,代码来源:ChunkProviderSpaceLakes.java

示例3: getHotbarBlock

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
private int getHotbarBlock() {
    for (int index = 36; index < 45; index++) {
        ItemStack itemStack = mc.thePlayer.inventoryContainer.getSlot(index).getStack();
        if (itemStack != null) {
            if (itemStack.getItem() instanceof ItemBlock) {
                if (((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockFalling)
                    continue;

                if (itemStack.stackSize >= 1) {
                    return index - 36;
                }
            }
        }
    }

    return -1;
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:18,代码来源:Scaffold.java

示例4: createParticle

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
@Nullable
public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
    IBlockState iblockstate = Block.getStateById(p_178902_15_[0]);

    if (iblockstate.getBlock() != Blocks.AIR && iblockstate.getRenderType() == EnumBlockRenderType.INVISIBLE)
    {
        return null;
    }
    else
    {
        int i = Minecraft.getMinecraft().getBlockColors().getColor(iblockstate);

        if (iblockstate.getBlock() instanceof BlockFalling)
        {
            i = ((BlockFalling)iblockstate.getBlock()).getDustColor(iblockstate);
        }

        float f = (float)(i >> 16 & 255) / 255.0F;
        float f1 = (float)(i >> 8 & 255) / 255.0F;
        float f2 = (float)(i & 255) / 255.0F;
        return new ParticleFallingDust(worldIn, xCoordIn, yCoordIn, zCoordIn, f, f1, f2);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:ParticleFallingDust.java

示例5: createParticle

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
    IBlockState iblockstate = Block.getStateById(p_178902_15_[0]);

    if (iblockstate.getBlock() != Blocks.AIR && iblockstate.getRenderType() == EnumBlockRenderType.INVISIBLE)
    {
        return null;
    }
    else
    {
        int i = Minecraft.getMinecraft().getBlockColors().getColor(iblockstate);

        if (iblockstate.getBlock() instanceof BlockFalling)
        {
            i = ((BlockFalling)iblockstate.getBlock()).getDustColor(iblockstate);
        }

        float f = (float)(i >> 16 & 255) / 255.0F;
        float f1 = (float)(i >> 8 & 255) / 255.0F;
        float f2 = (float)(i & 255) / 255.0F;
        return new ParticleFallingDust(worldIn, xCoordIn, yCoordIn, zCoordIn, f, f1, f2);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:ParticleFallingDust.java

示例6: populate

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
@Override
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
    BlockFalling.fallInstantly = true;
    final int var4 = par2 * 16;
    final int var5 = par3 * 16;
    this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
    this.rand.setSeed(this.worldObj.getSeed());
    final long var7 = this.rand.nextLong() / 2L * 2L + 1L;
    final long var9 = this.rand.nextLong() / 2L * 2L + 1L;
    this.rand.setSeed(par2 * var7 + par3 * var9 ^ this.worldObj.getSeed());

    this.dungeonGenerator.handleTileEntities(this.rand);

    if (!ConfigManagerCore.disableMoonVillageGen)
    {
        this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
    }

    this.decoratePlanet(this.worldObj, this.rand, var4, var5);
    BlockFalling.fallInstantly = false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:23,代码来源:ChunkProviderMoon.java

示例7: populate

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
@Override
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
    BlockFalling.fallInstantly = true;
    final int k = par2 * 16;
    final int l = par3 * 16;
    this.rand.setSeed(this.worldObj.getSeed());
    final long i1 = this.rand.nextLong() / 2L * 2L + 1L;
    final long j1 = this.rand.nextLong() / 2L * 2L + 1L;
    this.rand.setSeed(par2 * i1 + par3 * j1 ^ this.worldObj.getSeed());
    if (k == 0 && l == 0)
    {
        this.worldObj.setBlock(k, 64, l, GCBlocks.spaceStationBase, 0, 3);

        final TileEntity var8 = this.worldObj.getTileEntity(k, 64, l);

        if (var8 instanceof IMultiBlock)
        {
            ((IMultiBlock) var8).onCreate(new BlockVec3(k, 64, l));
        }

        new WorldGenSpaceStation().generate(this.worldObj, this.rand, k - 10, 62, l - 3);
    }
    BlockFalling.fallInstantly = false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:26,代码来源:ChunkProviderOrbit.java

示例8: populate

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
@Override
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
	BlockFalling.fallInstantly = true;
	int var4 = par2 * 16;
	int var5 = par3 * 16;
	worldObject.getBiomeGenForCoords(var4 + 16, var5 + 16);
	random.setSeed(worldObject.getSeed());
	long var7 = random.nextLong() / 2l * 2l + 1l;
	long var9 = random.nextLong() / 2l * 2l + 1l;
	random.setSeed(par2 * var7 + par3 * var9 ^ worldObject.getSeed());
	decoratePlanet(this.worldObject, random, var4, var5);
	
	if (pitNest != null) {
		pitNest.generateStructuresInChunk(worldObject, new Random(), par2, par3);
	}
	
	BlockFalling.fallInstantly = false;

	if (villageGenerator != null) {
		villageGenerator.generateStructuresInChunk(worldObject, random, par2, par3);
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:23,代码来源:GenChunkProvider.java

示例9: updateBlocks

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
private void updateBlocks() {
    try {
        BlockFalling.fallInstantly = true;
        for (BlockPos pos : blocksToUpdate) {
            IBlockState state = serverWorld.getBlockState(pos);
            if (state.getBlock() instanceof BlockFalling) {
                state.getBlock().updateTick(serverWorld, pos, state, serverWorld.rand);
            }
            state.neighborChanged(serverWorld, pos, Blocks.AIR, pos);
            serverWorld.notifyNeighborsOfStateChange(pos, state.getBlock(), true);
        }
    }
    catch (Throwable e) {
        e.printStackTrace();
    }

    BlockFalling.fallInstantly = false;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:19,代码来源:ExplosionMaker.java

示例10: placeHut

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
public static void placeHut(final World world, BlockPos startpos, int[][][] data, IBlockState[] states, Random rand) {
  for (int pass = 0; pass <= 1; pass++) {
    for (int y = 0; y < data.length; y++) {
      for (int x = 0; x < 6; x++) {
        for (int z = 0; z < 6; z++) {
          BlockPos pos = startpos.add(x + 5, -y + 5, z + 5);
          if (data[y][z][x] != -1) {
            IBlockState state = states[data[y][z][x]];
            if (state == null || (pass == 0 && (state.getBlock() instanceof BlockCarpet || state.getBlock() instanceof BlockSapling))) {
              world.setBlockToAir(pos);
            } else if (state.getBlock() instanceof BlockFalling) {
              while (world.getBlockState(pos).getBlock().isReplaceable(world, pos) && !world.isAirBlock(new BlockPos(pos.getX(), 0, pos.getZ()))) {
                world.setBlockState(pos, state);
                world.immediateBlockTick(pos, state, rand);
              }
            } else if (!(state.getBlock() instanceof BlockSlab)
                || (world.getBlockState(pos).getBlock().isReplaceable(world, pos) && world.getBlockState(pos).getMaterial() != Material.WATER)) {
              world.setBlockState(pos, state);
            }
          }
        }
      }
    }
  }
}
 
开发者ID:HenryLoenwind,项目名称:TravelHut,代码行数:26,代码来源:WorldGenHandler.java

示例11: isValidTankBlock

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
public static boolean isValidTankBlock(World world, BlockPos pos, IBlockState state, EnumFacing facing) {
	if(state == null) {
		return false;
	}

	if(world.isAirBlock(pos)) {
		return false;
	}

	if(state.getBlock() instanceof BlockFalling) {
		return false;
	}

	if(Compatibility.INSTANCE.isCNBLoaded) {
		if(CNBAPIAccess.apiInstance.isBlockChiseled(world, pos)) {
			return facing != null && CNBCompatibility.INSTANCE.isValid(world, pos, facing);
		}
	}

	return isBlockGlass(state) || facing == null || world.isSideSolid(pos, facing);
}
 
开发者ID:Lordmau5,项目名称:FFS,代码行数:22,代码来源:GenericUtil.java

示例12: populate

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
@Override
public void populate(int x, int z) {
       BlockFalling.fallInstantly = true;
       net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.worldObj, this.rand, x, z, false);
       BlockPos blockpos = new BlockPos(x * 16, 0, z * 16);
       
       this.worldObj.getBiomeForCoordsBody(blockpos.add(16, 0, 16)).decorate(this.worldObj, this.worldObj.rand, blockpos);
       long i = (long)x * (long)x + (long)z * (long)z;
       
       if (i > 4096L)
       {
       	
       }
       net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.worldObj, this.rand, x, z, false);
       BlockFalling.fallInstantly = false;
}
 
开发者ID:Vashmeed,项目名称:nVoid,代码行数:17,代码来源:ChunkGeneratorVoidIsland.java

示例13: fall

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
protected void fall(World worldIn, BlockPos pos, IBlockState state)
{
	int i = 32;

	if ((!BlockFalling.fallInstantly) && (worldIn.isAreaLoaded(pos.add(-i, -i, -i), pos.add(i, i, i))))
	{
		if (!worldIn.isRemote)
		{
			EntityFallingBlockTFC entityfallingblock = new EntityFallingBlockTFC(worldIn, pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, state);
			onStartFalling(entityfallingblock);
			worldIn.spawnEntity(entityfallingblock);
		}
	}
	else
	{
		((World)worldIn).setBlockToAir(pos);

		BlockPos blockpos;
		for (blockpos = pos.down(); (canFallInto(worldIn, blockpos)) && (blockpos.getY() > 0); blockpos = blockpos.down()) {}

		if (blockpos.getY() > 0)
		{
			worldIn.setBlockState(blockpos.up(), getDefaultState());
		}
	}
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:27,代码来源:BlockGravity.java

示例14: populate

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
@Override
public void populate(IChunkProvider par1IChunkProvider, int chunkX, int chunkZ)
{

    BlockFalling.fallInstantly = true;
    final int blockX = chunkX * 16;
    final int blockZ = chunkZ * 16;
    this.rand.setSeed(this.worldObjNonPrivate.getSeed());
    final long seed1 = this.rand.nextLong() / 2L * 2L + 1L;
    final long seed2 = this.rand.nextLong() / 2L * 2L + 1L;
    this.rand.setSeed(chunkX * seed1 + chunkZ * seed2 ^ this.worldObjNonPrivate.getSeed());
    if (blockX == 0 && blockZ == 0)
    {
        // this generates the basis structure

        new MothershipWorldGen().generate(this.worldObjNonPrivate, this.rand, 0, 64, 0);
    }
    BlockFalling.fallInstantly = false;
}
 
开发者ID:katzenpapst,项目名称:amunra,代码行数:20,代码来源:MothershipChunkProvider.java

示例15: populate

import net.minecraft.block.BlockFalling; //导入依赖的package包/类
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
{
	BlockFalling.fallInstantly = true;

	MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, worldObj.rand, p_73153_2_, p_73153_3_, false));

	int k = p_73153_2_ * 16;
	int l = p_73153_3_ * 16;
	BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
	biomegenbase.decorate(this.worldObj, this.worldObj.rand, k, l);

	MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, worldObj.rand, p_73153_2_, p_73153_3_, false));

	BlockFalling.fallInstantly = false;
}
 
开发者ID:Alex-the-666,项目名称:It-s-About-Time-Minecraft-Mod,代码行数:19,代码来源:ChunkProviderNowhere.java


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