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


Java World.isRainingAt方法代码示例

本文整理汇总了Java中net.minecraft.world.World.isRainingAt方法的典型用法代码示例。如果您正苦于以下问题:Java World.isRainingAt方法的具体用法?Java World.isRainingAt怎么用?Java World.isRainingAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.World的用法示例。


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

示例1: updateTick

import net.minecraft.world.World; //导入方法依赖的package包/类
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    int i = ((Integer)state.getValue(MOISTURE)).intValue();

    if (!this.hasWater(worldIn, pos) && !worldIn.isRainingAt(pos.up()))
    {
        if (i > 0)
        {
            worldIn.setBlockState(pos, state.withProperty(MOISTURE, Integer.valueOf(i - 1)), 2);
        }
        else if (!this.hasCrops(worldIn, pos))
        {
            this.func_190970_b(worldIn, pos);
        }
    }
    else if (i < 7)
    {
        worldIn.setBlockState(pos, state.withProperty(MOISTURE, Integer.valueOf(7)), 2);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:BlockFarmland.java

示例2: updateTick

import net.minecraft.world.World; //导入方法依赖的package包/类
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    int i = ((Integer)state.getValue(MOISTURE)).intValue();

    if (!this.hasWater(worldIn, pos) && !worldIn.isRainingAt(pos.up()))
    {
        if (i > 0)
        {
            worldIn.setBlockState(pos, state.withProperty(MOISTURE, Integer.valueOf(i - 1)), 2);
        }
        else if (!this.hasCrops(worldIn, pos))
        {
            worldIn.setBlockState(pos, Blocks.DIRT.getDefaultState());
        }
    }
    else if (i < 7)
    {
        worldIn.setBlockState(pos, state.withProperty(MOISTURE, Integer.valueOf(7)), 2);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:BlockFarmland.java

示例3: catchOnFire

import net.minecraft.world.World; //导入方法依赖的package包/类
private void catchOnFire(World worldIn, BlockPos pos, int chance, Random random, int age)
{
    int i = this.getFlammability(worldIn.getBlockState(pos).getBlock());

    if (random.nextInt(chance) < i)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);

        if (random.nextInt(age + 10) < 5 && !worldIn.isRainingAt(pos))
        {
            int j = age + random.nextInt(5) / 4;

            if (j > 15)
            {
                j = 15;
            }

            worldIn.setBlockState(pos, this.getDefaultState().withProperty(AGE, Integer.valueOf(j)), 3);
        }
        else
        {
            worldIn.setBlockToAir(pos);
        }

        if (iblockstate.getBlock() == Blocks.TNT)
        {
            Blocks.TNT.onBlockDestroyedByPlayer(worldIn, pos, iblockstate.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true)));
        }
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:31,代码来源:BlockFire.java

示例4: randomDisplayTick

import net.minecraft.world.World; //导入方法依赖的package包/类
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
    if (worldIn.isRainingAt(pos.up()) && !worldIn.getBlockState(pos.down()).isFullyOpaque() && rand.nextInt(15) == 1)
    {
        double d0 = (double)((float)pos.getX() + rand.nextFloat());
        double d1 = (double)pos.getY() - 0.05D;
        double d2 = (double)((float)pos.getZ() + rand.nextFloat());
        worldIn.spawnParticle(EnumParticleTypes.DRIP_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:BlockLeaves.java

示例5: tryCatchFire

import net.minecraft.world.World; //导入方法依赖的package包/类
private void tryCatchFire(World worldIn, BlockPos pos, int chance, Random random, int age, EnumFacing face)
{
    int i = worldIn.getBlockState(pos).getBlock().getFlammability(worldIn, pos, face);

    if (random.nextInt(chance) < i)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);

        if (random.nextInt(age + 10) < 5 && !worldIn.isRainingAt(pos))
        {
            int j = age + random.nextInt(5) / 4;

            if (j > 15)
            {
                j = 15;
            }

            worldIn.setBlockState(pos, this.getDefaultState().withProperty(AGE, Integer.valueOf(j)), 3);
        }
        else
        {
            worldIn.setBlockToAir(pos);
        }

        if (iblockstate.getBlock() == Blocks.TNT)
        {
            Blocks.TNT.onBlockDestroyedByPlayer(worldIn, pos, iblockstate.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true)));
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:31,代码来源:BlockFire.java

示例6: randomDisplayTick

import net.minecraft.world.World; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
    if (worldIn.isRainingAt(pos.up()) && !worldIn.getBlockState(pos.down()).isFullyOpaque() && rand.nextInt(15) == 1)
    {
        double d0 = (double)((float)pos.getX() + rand.nextFloat());
        double d1 = (double)pos.getY() - 0.05D;
        double d2 = (double)((float)pos.getZ() + rand.nextFloat());
        worldIn.spawnParticle(EnumParticleTypes.DRIP_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:BlockLeaves.java

示例7: canDie

import net.minecraft.world.World; //导入方法依赖的package包/类
protected boolean canDie(World worldIn, BlockPos pos)
{
    return worldIn.isRainingAt(pos) || worldIn.isRainingAt(pos.west()) || worldIn.isRainingAt(pos.east()) || worldIn.isRainingAt(pos.north()) || worldIn.isRainingAt(pos.south());
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:5,代码来源:SpecialFire.java

示例8: canDie

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
protected boolean canDie(World worldIn, BlockPos pos) {
	return worldIn.isRainingAt(pos) || worldIn.isRainingAt(pos.west()) || worldIn.isRainingAt(pos.east()) || worldIn.isRainingAt(pos.north()) || worldIn.isRainingAt(pos.south());
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:5,代码来源:BlockSpecialFire.java


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