本文整理匯總了Java中net.minecraft.init.Blocks.FLOWING_LAVA屬性的典型用法代碼示例。如果您正苦於以下問題:Java Blocks.FLOWING_LAVA屬性的具體用法?Java Blocks.FLOWING_LAVA怎麽用?Java Blocks.FLOWING_LAVA使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.FLOWING_LAVA屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getFluid
public Fluid getFluid() {
Fluid fluid = FluidRegistry.lookupFluidForBlock(getBlockState().getBlock());
if (fluid != null) return fluid;
else if (getBlockState().getBlock() == Blocks.FLOWING_LAVA) return FluidRegistry.LAVA;
else if (getBlockState().getBlock() == Blocks.FLOWING_WATER) return FluidRegistry.WATER;
return null;
}
示例2: transformSourceBlock
protected void transformSourceBlock(Block turningBlockSource, Block turningBlockFlowing) {
if (FluidUtils.isSourceBlock(getWorld(), getPos())) {
getWorld().setBlockState(getPos(), turningBlockSource.getDefaultState());
} else {
Set<BlockPos> traversed = new HashSet<BlockPos>();
Stack<BlockPos> pending = new Stack<BlockPos>();
pending.push(getPos());
traversed.add(getPos());
while (!pending.isEmpty()) {
BlockPos pos = pending.pop();
for (EnumFacing d : EnumFacing.VALUES) {
BlockPos newPos = pos.offset(d);
Block checkingBlock = getWorld().getBlockState(newPos).getBlock();
if ((checkingBlock == getBlockState().getBlock() || getBlockState().getBlock() == Blocks.FLOWING_WATER && checkingBlock == Blocks.WATER || getBlockState().getBlock() == Blocks.FLOWING_LAVA && checkingBlock == Blocks.LAVA) && traversed.add(newPos)) {
if (FluidUtils.isSourceBlock(getWorld(), newPos)) {
getWorld().setBlockState(newPos, turningBlockSource.getDefaultState());
onTransition(newPos);
return;
} else {
getWorld().setBlockState(newPos, turningBlockFlowing.getDefaultState());
onTransition(newPos);
pending.push(newPos);
}
}
}
}
}
}
示例3: safeImpact
@Override
public void safeImpact(BlockPos pos, @Nullable EnumFacing side, World world, int amplifier) {
int box = 1 + (int) ((float) amplifier / 2F);
BlockPos posI = pos.add(box, box, box);
BlockPos posF = pos.add(-box, -box, -box);
Iterable<BlockPos> spots = BlockPos.getAllInBox(posI, posF);
for (BlockPos spot : spots) {
IBlockState state = world.getBlockState(spot);
boolean place = amplifier > 2 || world.rand.nextBoolean();
if (place && state.getBlock() == Blocks.WATER && world.isAirBlock(spot.up())) {
world.setBlockState(spot, Blocks.ICE.getDefaultState(), 3);
} else if (state.getBlock() == Blocks.ICE) {
world.setBlockState(spot, Blocks.PACKED_ICE.getDefaultState(), 3);
} else if (state.getBlock() == Blocks.SNOW_LAYER) {
world.setBlockState(spot, Blocks.SNOW.getDefaultState(), 3);
} else if (state.getBlock() == Blocks.SNOW) {
world.setBlockState(spot, Blocks.PACKED_ICE.getDefaultState(), 3);
} else if (state.getBlock() == Blocks.FROSTED_ICE) {
world.setBlockState(spot, Blocks.ICE.getDefaultState(), 3);
} else if (state.getBlock() == Blocks.LAVA) {
world.setBlockState(spot, Blocks.OBSIDIAN.getDefaultState(), 3);
} else if (state.getBlock() == Blocks.FLOWING_LAVA) {
world.setBlockState(spot, Blocks.OBSIDIAN.getDefaultState(), 3);
} else if (state.getBlock() == Blocks.FLOWING_WATER) {
world.setBlockState(spot, Blocks.ICE.getDefaultState(), 3);
}
}
}
示例4: isFlammableWithin
public boolean isFlammableWithin(AxisAlignedBB bb)
{
int i = MathHelper.floor(bb.minX);
int j = MathHelper.ceil(bb.maxX);
int k = MathHelper.floor(bb.minY);
int l = MathHelper.ceil(bb.maxY);
int i1 = MathHelper.floor(bb.minZ);
int j1 = MathHelper.ceil(bb.maxZ);
if (this.isAreaLoaded(i, k, i1, j, l, j1, true))
{
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
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$pooledmutableblockpos.setPos(k1, l1, i2)).getBlock();
if (block == Blocks.FIRE || block == Blocks.FLOWING_LAVA || block == Blocks.LAVA)
{
blockpos$pooledmutableblockpos.release();
return true;
}
}
}
}
blockpos$pooledmutableblockpos.release();
}
return false;
}
示例5: getFlowingBlock
public static BlockDynamicLiquid getFlowingBlock(Material materialIn)
{
if (materialIn == Material.WATER)
{
return Blocks.FLOWING_WATER;
}
else if (materialIn == Material.LAVA)
{
return Blocks.FLOWING_LAVA;
}
else
{
throw new IllegalArgumentException("Invalid material");
}
}
示例6: isFlammableWithin
public boolean isFlammableWithin(AxisAlignedBB bb)
{
int i = MathHelper.floor_double(bb.minX);
int j = MathHelper.ceiling_double_int(bb.maxX);
int k = MathHelper.floor_double(bb.minY);
int l = MathHelper.ceiling_double_int(bb.maxY);
int i1 = MathHelper.floor_double(bb.minZ);
int j1 = MathHelper.ceiling_double_int(bb.maxZ);
if (this.isAreaLoaded(i, k, i1, j, l, j1, true))
{
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
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$pooledmutableblockpos.setPos(k1, l1, i2)).getBlock();
if (block == Blocks.FIRE || block == Blocks.FLOWING_LAVA || block == Blocks.LAVA)
{
blockpos$pooledmutableblockpos.release();
return true;
}
else if (block.isBurning(this, new BlockPos(k1, l1, i2)))
{
return true;
}
}
}
}
blockpos$pooledmutableblockpos.release();
}
return false;
}
示例7: tryPlaceContainedLiquid
public boolean tryPlaceContainedLiquid(@Nullable EntityPlayer player, World worldIn, BlockPos posIn)
{
if (this.containedBlock == Blocks.AIR)
{
return false;
}
else
{
IBlockState iblockstate = worldIn.getBlockState(posIn);
Material material = iblockstate.getMaterial();
boolean flag = !material.isSolid();
boolean flag1 = iblockstate.getBlock().isReplaceable(worldIn, posIn);
if (!worldIn.isAirBlock(posIn) && !flag && !flag1)
{
return false;
}
else
{
if (worldIn.provider.doesWaterVaporize() && this.containedBlock == Blocks.FLOWING_WATER)
{
int l = posIn.getX();
int i = posIn.getY();
int j = posIn.getZ();
worldIn.playSound(player, posIn, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F);
for (int k = 0; k < 8; ++k)
{
worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)l + Math.random(), (double)i + Math.random(), (double)j + Math.random(), 0.0D, 0.0D, 0.0D, new int[0]);
}
}
else
{
if (!worldIn.isRemote && (flag || flag1) && !material.isLiquid())
{
worldIn.destroyBlock(posIn, true);
}
SoundEvent soundevent = this.containedBlock == Blocks.FLOWING_LAVA ? SoundEvents.ITEM_BUCKET_EMPTY_LAVA : SoundEvents.ITEM_BUCKET_EMPTY;
worldIn.playSound(player, posIn, soundevent, SoundCategory.BLOCKS, 1.0F, 1.0F);
worldIn.setBlockState(posIn, this.containedBlock.getDefaultState(), 11);
}
return true;
}
}
}
示例8: drawSlot
protected void drawSlot(int entryID, int insideLeft, int yPos, int insideSlotHeight, int mouseXIn, int mouseYIn)
{
FlatLayerInfo flatlayerinfo = (FlatLayerInfo)GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().get(GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - entryID - 1);
IBlockState iblockstate = flatlayerinfo.getLayerMaterial();
Block block = iblockstate.getBlock();
Item item = Item.getItemFromBlock(block);
if (item == Items.field_190931_a)
{
if (block != Blocks.WATER && block != Blocks.FLOWING_WATER)
{
if (block == Blocks.LAVA || block == Blocks.FLOWING_LAVA)
{
item = Items.LAVA_BUCKET;
}
}
else
{
item = Items.WATER_BUCKET;
}
}
ItemStack itemstack = new ItemStack(item, 1, item.getHasSubtypes() ? block.getMetaFromState(iblockstate) : 0);
String s = item.getItemStackDisplayName(itemstack);
this.drawItem(insideLeft, yPos, itemstack);
GuiCreateFlatWorld.this.fontRendererObj.drawString(s, insideLeft + 18 + 5, yPos + 3, 16777215);
String s1;
if (entryID == 0)
{
s1 = I18n.format("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())});
}
else if (entryID == GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - 1)
{
s1 = I18n.format("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())});
}
else
{
s1 = I18n.format("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())});
}
GuiCreateFlatWorld.this.fontRendererObj.drawString(s1, insideLeft + 2 + 213 - GuiCreateFlatWorld.this.fontRendererObj.getStringWidth(s1), yPos + 3, 16777215);
}
示例9: getTexture
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();
}
示例10: isAssociatedBlock
@Override
public boolean isAssociatedBlock(Block other)
{
return super.isAssociatedBlock(other) || other == Blocks.LAVA || other == Blocks.FLOWING_LAVA;
}