本文整理汇总了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);
}
}
示例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);
}
}
示例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)));
}
}
}
示例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]);
}
}
示例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)));
}
}
}
示例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]);
}
}
示例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());
}
示例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());
}