ItemWateringCan.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:ExPetrum 作者:
public void tryHydrateBlock(EntityPlayer player, int tier, BlockPos pos, World w, IBlockState state, IFluidHandlerItem cap, ItemStack is)
{
    while ((state.getMaterial() == Material.PLANTS || w.isAirBlock(pos)) && pos.getY() > 0)
    {
        pos = pos.down();
        state = w.getBlockState(pos);
    }

    if (state.getBlock() instanceof IAcceptsWaterCan)
    {
        ((IAcceptsWaterCan)state.getBlock()).acceptWatering(player, w, pos, state, cap, is, tier);
    }

    w.spawnParticle(EnumParticleTypes.WATER_SPLASH, pos.getX() + w.rand.nextFloat(), pos.getY() + 1, pos.getZ() + w.rand.nextFloat(), 0, 0, 0);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号