本文整理匯總了Java中net.minecraft.init.Blocks.lava方法的典型用法代碼示例。如果您正苦於以下問題:Java Blocks.lava方法的具體用法?Java Blocks.lava怎麽用?Java Blocks.lava使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.lava方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ChunkProviderGenerate
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public ChunkProviderGenerate(World worldIn, long p_i45636_2_, boolean p_i45636_4_, String p_i45636_5_)
{
this.worldObj = worldIn;
this.mapFeaturesEnabled = p_i45636_4_;
this.field_177475_o = worldIn.getWorldInfo().getTerrainType();
this.rand = new Random(p_i45636_2_);
this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16);
this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16);
this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8);
this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4);
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
this.field_147434_q = new double[825];
this.parabolicField = new float[25];
for (int i = -2; i <= 2; ++i)
{
for (int j = -2; j <= 2; ++j)
{
float f = 10.0F / MathHelper.sqrt_float((float)(i * i + j * j) + 0.2F);
this.parabolicField[i + 2 + (j + 2) * 5] = f;
}
}
if (p_i45636_5_ != null)
{
this.settings = ChunkProviderSettings.Factory.jsonToFactory(p_i45636_5_).func_177864_b();
this.field_177476_s = this.settings.useLavaOceans ? Blocks.lava : Blocks.water;
worldIn.func_181544_b(this.settings.seaLevel);
}
}
示例2: isFlammableWithin
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public boolean isFlammableWithin(AxisAlignedBB bb)
{
int i = MathHelper.floor_double(bb.minX);
int j = MathHelper.floor_double(bb.maxX + 1.0D);
int k = MathHelper.floor_double(bb.minY);
int l = MathHelper.floor_double(bb.maxY + 1.0D);
int i1 = MathHelper.floor_double(bb.minZ);
int j1 = MathHelper.floor_double(bb.maxZ + 1.0D);
if (this.isAreaLoaded(i, k, i1, j, l, j1, true))
{
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
for (int k1 = i; k1 < j; ++k1)
{
for (int l1 = k; l1 < l; ++l1)
{
for (int i2 = i1; i2 < j1; ++i2)
{
Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock();
if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava)
{
return true;
}
}
}
}
}
return false;
}
示例3: getStaticBlock
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public static BlockStaticLiquid getStaticBlock(Material materialIn)
{
if (materialIn == Material.water)
{
return Blocks.water;
}
else if (materialIn == Material.lava)
{
return Blocks.lava;
}
else
{
throw new IllegalArgumentException("Invalid material");
}
}
示例4: getHeatSource
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public int getHeatSource()
{
Block block = this.worldObj.getBlockState(this.pos.add(0,-1,0)).getBlock();
if(block == Blocks.fire)
return 2;
else if(block == Blocks.flowing_lava)
return 2;
else if(block == Blocks.lava)
return 5;
return 0;
}
示例5: getStaticBlock
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public static BlockStaticLiquid getStaticBlock(Material materialIn) {
if (materialIn == Material.water) {
return Blocks.water;
} else if (materialIn == Material.lava) {
return Blocks.lava;
} else {
throw new IllegalArgumentException("Invalid material");
}
}
示例6: doMining
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
void doMining(World world, EntityPlayerMP player, int x, int y, int z) // Calling this 27 times, to blast mine a 3x3x3 area
{
Block toBeBroken = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if (toBeBroken.getBlockHardness(world, x, y, z) == -1) { return; } // Unbreakable
if (toBeBroken.getHarvestLevel(meta) > 1) { return; }
if (toBeBroken.getMaterial() == Material.water) { return; }
if (toBeBroken.getMaterial() == Material.lava) { return; }
if (toBeBroken.getMaterial() == Material.air) { return; }
if (toBeBroken.getMaterial() == Material.portal) { return; }
// Need to do checks here against invalid blocks
if (toBeBroken == Blocks.water) { return; }
if (toBeBroken == Blocks.flowing_water) { return; }
if (toBeBroken == Blocks.lava) { return; }
if (toBeBroken == Blocks.flowing_lava) { return; }
if (toBeBroken == Blocks.obsidian) { return; }
if (toBeBroken == Blocks.mob_spawner) { return; }
// Crashing blocks: Redstone Lamp, Extended Piston
// They're likely trying to drop things that cannot be dropped (active states of themselves)
//WorldSettings.GameType gametype = WorldSettings.GameType.getByName("survival");
WorldSettings.GameType gametype = world.getWorldInfo().getGameType();
BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(world, gametype, player, x, y, z);
if (event.isCanceled()) { return; } // Not allowed to do this
//toBeBroken.dropBlockAsItem(world, x, x, z, meta, 0); // The last one is Fortune
boolean removalSuccess = world.setBlockToAir(x, y, z);
if (removalSuccess) { toBeBroken.onBlockDestroyedByPlayer(world, x, y, z, meta); }
Item preBlockItem = toBeBroken.getItemDropped(meta, player.getRNG(), 0);
if (preBlockItem == null) { return; } // Item doesn't exist
ItemStack blockItem = new ItemStack(preBlockItem);
blockItem.setItemDamage(meta);
EntityItem entityItem = new EntityItem(world, x, y + 0.5d, z, blockItem);
entityItem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityItem);
}
示例7: getTexture
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public TextureAtlasSprite getTexture(IBlockState state)
{
Block block = state.getBlock();
IBakedModel ibakedmodel = this.getModelForState(state);
if (ibakedmodel == null || ibakedmodel == this.modelManager.getMissingModel())
{
if (block == Blocks.wall_sign || block == Blocks.standing_sign || block == Blocks.chest || block == Blocks.trapped_chest || block == Blocks.standing_banner || block == Blocks.wall_banner)
{
return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/planks_oak");
}
if (block == Blocks.ender_chest)
{
return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/obsidian");
}
if (block == Blocks.flowing_lava || block == Blocks.lava)
{
return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/lava_still");
}
if (block == Blocks.flowing_water || block == Blocks.water)
{
return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/water_still");
}
if (block == Blocks.skull)
{
return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/soul_sand");
}
if (block == Blocks.barrier)
{
return this.modelManager.getTextureMap().getAtlasSprite("minecraft:items/barrier");
}
}
if (ibakedmodel == null)
{
ibakedmodel = this.modelManager.getMissingModel();
}
return ibakedmodel.getParticleTexture();
}
示例8: onImpact
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
@Override
public void onImpact(MovingObjectPosition target)
{
if (target.entityHit != null) // We hit a living thing!
{
// Damage
target.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), (float)this.damage);
}
else // Hit the terrain
{
Block block = this.worldObj.getBlock(target.blockX, target.blockY, target.blockZ);
int meta = this.worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ);
boolean breakThis = true;
// Checking here against invalid blocks
if (block == Blocks.bedrock) { breakThis = false; }
else if (block == Blocks.water) { breakThis = false; }
else if (block == Blocks.flowing_water) { breakThis = false; }
else if (block == Blocks.lava) { breakThis = false; }
else if (block == Blocks.flowing_lava) { breakThis = false; }
else if (block == Blocks.obsidian) { breakThis = false; }
else if (block == Blocks.mob_spawner) { breakThis = false; }
else if (block.getMaterial() == Material.water) { breakThis = false; }
else if (block.getMaterial() == Material.lava) { breakThis = false; }
else if (block.getMaterial() == Material.air) { breakThis = false; }
else if (block.getMaterial() == Material.portal) { breakThis = false; }
else if (block.getHarvestLevel(meta) > 0) { breakThis = false; }
else if (block.getBlockHardness(this.worldObj, target.blockX, target.blockY, target.blockZ) > 3) { breakThis = false; }
if (this.shootingEntity instanceof EntityPlayerMP)
{
WorldSettings.GameType gametype = this.worldObj.getWorldInfo().getGameType();
BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(this.worldObj, gametype, (EntityPlayerMP) this.shootingEntity, target.blockX, target.blockY, target.blockZ);
if (event.isCanceled()) { breakThis = false; } // Not allowed to do this
}
if (breakThis) // Nothing preventing us from breaking this block!
{
this.worldObj.setBlockToAir(target.blockX, target.blockY, target.blockZ);
block.dropBlockAsItem(this.worldObj, target.blockX, target.blockY, target.blockZ, meta, 0);
}
}
// SFX
for (int i = 0; i < 4; ++i) { this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); }
this.worldObj.playSoundAtEntity(this, Block.soundTypeGravel.getBreakSound(), 1.0F, 1.0F);
this.setDead(); // Hit something, so begone.
}