當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。